ILocalizationProvider.cs 940 B

1234567891011121314151617181920212223242526
  1. namespace PixiEditor.Extensions.Common.Localization;
  2. public interface ILocalizationProvider
  3. {
  4. public static ILocalizationProvider Current { get; private set; }
  5. public string LocalizationDataPath { get; }
  6. public LocalizationData LocalizationData { get; }
  7. public Language CurrentLanguage { get; set; }
  8. public LanguageData SelectedLanguage { get; }
  9. public LanguageData FollowSystem { get; }
  10. public event Action<Language> OnLanguageChanged;
  11. /// <summary>
  12. /// Loads the localization data from the specified file.
  13. /// </summary>
  14. public void LoadData();
  15. public void LoadLanguage(LanguageData languageData);
  16. public void LoadDebugKeys(Dictionary<string, string> languageKeys, bool rightToLeft);
  17. public void ReloadLanguage();
  18. public Language DefaultLanguage { get; }
  19. protected static void SetAsCurrent(ILocalizationProvider provider)
  20. {
  21. Current = provider;
  22. }
  23. }