From 1cff358e521920bdb8960f3204235bc93c6bd79d Mon Sep 17 00:00:00 2001 From: CWX Date: Mon, 27 Jan 2025 21:28:41 +0000 Subject: [PATCH] add getLocalisation for pmc responses --- Libraries/Core/Services/I18nService.cs | 5 +++++ Libraries/Core/Services/LocaleService.cs | 6 +++--- Libraries/Core/Services/LocalisationService.cs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Libraries/Core/Services/I18nService.cs b/Libraries/Core/Services/I18nService.cs index 423ac9ed..4e58412d 100644 --- a/Libraries/Core/Services/I18nService.cs +++ b/Libraries/Core/Services/I18nService.cs @@ -119,4 +119,9 @@ public class I18nService var rawLocalizedString = GetLocalised(key); return rawLocalizedString.Replace("%s", value?.ToString()); } + + public List GetLocalisedKeys() + { + return _loadedLocales["en"].Value?.Keys.ToList()!; + } } diff --git a/Libraries/Core/Services/LocaleService.cs b/Libraries/Core/Services/LocaleService.cs index bb54c4a7..7217a64d 100644 --- a/Libraries/Core/Services/LocaleService.cs +++ b/Libraries/Core/Services/LocaleService.cs @@ -16,9 +16,9 @@ public class LocaleService( protected LocaleConfig _localeConfig = _configServer.GetConfig(); /** - * Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en' - * @returns dictionary - */ + * Get the eft globals db file based on the configured locale in config/locale.json, if not found, fall back to 'en' + * @returns dictionary + */ public Dictionary GetLocaleDb() { var desiredLocale = _databaseServer.GetTables().Locales.Global[GetDesiredGameLocale()]; diff --git a/Libraries/Core/Services/LocalisationService.cs b/Libraries/Core/Services/LocalisationService.cs index d55eee2c..cd06b04c 100644 --- a/Libraries/Core/Services/LocalisationService.cs +++ b/Libraries/Core/Services/LocalisationService.cs @@ -52,7 +52,7 @@ public class LocalisationService public ICollection GetKeys() { - throw new NotImplementedException(); + return _i18nService.GetLocalisedKeys(); } public string GetRandomTextThatMatchesPartialKey(string partialKey)