Skip to content

Migrate mod translation to general resource pipeline #955

@lycc193

Description

@lycc193

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.

Metadata

Metadata

Assignees

Labels

duplicateThis ticket is redundant with another existing ticket.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions