add getLocalisation for pmc responses

This commit is contained in:
CWX
2025-01-27 21:28:41 +00:00
parent 7017f73d2e
commit 1cff358e52
3 changed files with 9 additions and 4 deletions
+5
View File
@@ -119,4 +119,9 @@ public class I18nService
var rawLocalizedString = GetLocalised(key);
return rawLocalizedString.Replace("%s", value?.ToString());
}
public List<string> GetLocalisedKeys()
{
return _loadedLocales["en"].Value?.Keys.ToList()!;
}
}
+3 -3
View File
@@ -16,9 +16,9 @@ public class LocaleService(
protected LocaleConfig _localeConfig = _configServer.GetConfig<LocaleConfig>();
/**
* 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<string, string> GetLocaleDb()
{
var desiredLocale = _databaseServer.GetTables().Locales.Global[GetDesiredGameLocale()];
@@ -52,7 +52,7 @@ public class LocalisationService
public ICollection<string> GetKeys()
{
throw new NotImplementedException();
return _i18nService.GetLocalisedKeys();
}
public string GetRandomTextThatMatchesPartialKey(string partialKey)