using AIStudio.Tools.PluginSystem; namespace AIStudio.Tests.Tools.PluginSystem; /// /// A language plugin with texts of its own and a base language behind it, as PluginLanguage has. /// /// The texts of the language itself. /// The texts of the base language, which answer for the keys the language lacks. public sealed class FakeLanguagePlugin(IReadOnlyDictionary content, IReadOnlyDictionary? baseContent = null) : ILanguagePlugin { /// public bool TryGetText(string key, out string value, bool logWarning = false) { if (content.TryGetValue(key, out var text) || baseContent is not null && baseContent.TryGetValue(key, out text)) { value = text; return true; } value = string.Empty; return false; } /// public string IETFTag => "de-DE"; /// public string LangName => "Deutsch (Deutschland)"; /// public IReadOnlyDictionary Content => content; }