# Multilingual adaptation
- Developer Tools Version Requirements: 1.06.2312122 (It is recommended to use the latest nightly Developer Tools)
- Currently supported App Name, Privacy Release Information Access Permission Description, Privacy Popup Content, and Multilingual Adaptation of Splash Pages
# I. Steps to Use
# 1.1 Download the tool and create a folder
- Download the latest nightly Developer Tools
- If the project is in stock, create a new folder in the project directory for the configuration files in different languages (recommended in the project root directory, along with other code) push reach git Warehouse)
- If it is a newly upgraded multi-terminal project, the developer tools have been created for the developer by default.
i18n
Folder, and generated the base.json As well as the default will Name As well as the folder fill for the adapted file
# 1.2 Create a baseline profile
- If it is a multi-item inventory, it needs to be manually in the steps 1 of Create a folder base.json ( This is the base file and will be used in other languages, countries, and regions that are not internationalized.
# 1.3 Creating profiles in other languages
- The naming convention for json files is: BCP 47 (Needs attention ios Not available for system reasons. zh Need to use zh-Hans or zh-Hant)
- Creating other json Example: zh.json zh-Hans.json zh-Hans-Hk.json fr.json en.json
- And in the json The internationalized text is prepared in the following format in(To configure App Name as an example)
{
"ios": {
"name": "xx"
},
"android": {
"name": "yy"
},
"common": {
"someDesc": "zz"
}
}
Note: The priority of the coverage relationship when reading the same field is: zh-Hans-Hk.json > zh-Hans.json > zh.json > base.json
# 1.4 project.miniapp.json Complete multi-language adaptation
- Configure folder paths for multilingual adaptation
- Go to Project.miniapagejson, in the field that requires multilingual adaptation (e.g., name, privacy issue information access permission description) to %i18n_key% For example,% name%,% someDesc%
# 1.5 Privacy Prompt Box Multilingual Adaptation Example
- Available at
i18n
Folder to continue creatingprivacy
Folder to place the contents of the privacy window in different languages
- And then in
i18n
Configuration in the configuration file in the folder privacy Content, such as
{
"ios": {
"name": "xx" ,
"privacy":"i18n/privacy/fr.json
},
"android": {
"name": "yy"
},
"common": {
"someDesc": "zz"
}
}
- Finally, in project.miniapp.json In Configuration
privacy template
The path of
# 1.6 Startup Page Multilanguage Adaptation Example
Note: Developer tools are required 1.06.2407092
- Add to the internationalization file {splashscreen} Field with a value of the startup page picture address, for example base.json The configuration display reference in
- In the project.miniapagejson file, with the %{splashscreen}% Format Using Internationalization Startup Page Images
# iOS Note
- The startup page picture has 2 Stage, stage 1 Of the picture will be in the first APP At startup, it is determined by the user's language settings at this time, and then switching languages will not change. stage 2 The picture will change with the user's language settings