Skip to content

Single file language system, support regex matching and common * base on locale id #171

@sandtechnology

Description

@sandtechnology

Backward support: support message.json (v1) and overrides/[locale]/message.json (v2) format.

Basic format (Filename: message_i18n.json):

#For global overrides updating
"last-default-language": "en_US",
#Default, containing all value for user custom, allow user to edit directly 
"global-overrides" : {
"key": "value",
"key1":
{
"key2":"value"
},
}
language-specific-overrides:{
#User defined for one language
"en_US":{
},
#User defined for one language (* used)
"en_*":{
},
#User defined for one language (regex)
"!en_.*":{
}

}

Configuration changes:

game-language and enabled-languages option will be changed:

languages:
 update-from-crowdin-OTA: true
 #origin game-language
 default-language: default
 player-based-language:
   use: false
   #origin enabled-languages
   languages-used: ["*"]

Updating Logic:

Key-based-version: Each key having its own version, which will be stored in message_i18n_version.json, for all old version format, will use it's language-version value, so the version of all keys will start from current language-version+1, when version changed, will use following logic:

Language changed:

Directly replace the global-overrides to currently build-in values, and create a backup before that named with suffix -origin-[locale-name].

Key-version-changed and updated from legacy:

If current used built-in language value not equals the current value, rename that key with suffix bak-[language version], then add orgin value, and create a backup file named with suffix -bak-[uuid].

Addition command?

/qs updatehelper language for updating those string by asking?

Metadata

Metadata

Assignees

No one assigned

    Labels

    todowontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions