Added content API to language plugins to access all the data

This commit is contained in:
Thorsten Sommer 2025-04-25 15:24:57 +02:00
parent 2af61beea6
commit 85c93cea43
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
3 changed files with 10 additions and 0 deletions

View File

@ -29,4 +29,9 @@ public interface ILanguagePlugin
/// Gets the name of the language.
/// </summary>
public string LangName { get; }
/// <summary>
/// Get all keys and texts from the language plugin.
/// </summary>
public IReadOnlyDictionary<string, string> Content { get; }
}

View File

@ -22,5 +22,7 @@ public sealed class NoPluginLanguage : PluginBase, ILanguagePlugin
public string LangName => string.Empty;
public IReadOnlyDictionary<string, string> Content => new Dictionary<string, string>();
#endregion
}

View File

@ -165,6 +165,9 @@ public sealed class PluginLanguage : PluginBase, ILanguagePlugin
/// <inheritdoc />
public string LangName => this.langName;
/// <inheritdoc />
public IReadOnlyDictionary<string, string> Content => this.content.AsReadOnly();
#endregion
}