In the original game, all i18n-related content was loaded into the resource pipeline through LocalizedContentManager.LoadString -> Load<Dictionary<string, string>>(assetName) for subsequent reading.
However, in SMAPI, there are only two ways to load language files:
- Initialize mod: SCore.LoadMods -> SCore.ReloadTranslations -> Load mod/i18n/locale.json
- reload command: ReloadI18nCommand -> SCore.ReloadTranslations -> Load mod/i18n/locale.json
Apart from these, all calls to translations are read-only, retrieving target values from a list maintained by smapi using keys, rather than reading from the resource pipeline.
In the OnLocaleChanged event, translations are also treated differently. Other resources are redirected through the resource pipeline via suffixes.
In the original game, all i18n-related content was loaded into the resource pipeline through LocalizedContentManager.LoadString -> Load<Dictionary<string, string>>(assetName) for subsequent reading.
However, in SMAPI, there are only two ways to load language files:
Apart from these, all calls to translations are read-only, retrieving target values from a list maintained by smapi using keys, rather than reading from the resource pipeline.
In the OnLocaleChanged event, translations are also treated differently. Other resources are redirected through the resource pipeline via suffixes.