From 875203516e5d1908c38e8b94a2109ce94f3b2366 Mon Sep 17 00:00:00 2001
From: MichaelWangzitao
+ To support the multiple languages, attributes such as name, short_name, and description can be set as a reference to a string resource. Typically, string resources are stored in the corresponding multi-language JSON file in the MiniApp package's i18n directory. The multi-language file’s name complies with IETF BCP 47.
+ 为了支持多语言能力name, short_name, description等参数可以被设置为字符串资源的索引。通常情况下字符串资源被保存在MiniApp包i18n目录下相应的多语言文件中。多语言文件命名规范符合IETF BCP 47。
+
+ The following example describes two simple multi-language files:
+
+ 以下例子描述2个简单的多语言文:
+ i18n/en-US.json i18n/zh-Hans.json
+ Developers can refer to a resource using the syntax $string:‹resource-name›, for example, "decscription": "$string:description_application".
+
+ 用户可以使用$string:‹resource-name›的方式引用字符串资源,例如:"decscription": "$string:description_application".
+
+ The following example describes a simple manifest fragment that supports multiple languages capability:
+
+ 以下例子描述一个简单的支持多语言的manifest片段:
+
+ In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts sting: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。
+
+ 通过上述方式,应用市场在读取应用manifest时,会根据自身的配置信息,从i18n目录下相应的语言文件,提取字符串信息,生成本地描述。例如 应用市场配置信息为汉语简体,则应用市场会解析manifest中"name": "$string:name"语句,从i18n目录的zh-Hans.json文件,提取sting:name信息:小程序试用版,并在应用市场生成该应用的本地化名称:小程序试用版。
+
The following members are localizable and share the same default configuration of
To support the multiple languages, attributes such as name, short_name, and description can be set as a reference to a string resource. Typically, string resources are stored in the corresponding multi-language JSON file in the MiniApp package's i18n directory. The multi-language file’s name complies with IETF BCP 47.
+ reason
member
+ Internationalization
+ 国际化方案
+
Localizable members
@@ -1121,6 +1126,92 @@
+ I18n Solution
+ I18n方案
+
+
+
+ {
+ "strings": {
+ "name":"miniapp demo",
+ "short_name":"MD",
+ "description_application":"MiniApp Demo",
+ },
+ "files": {
+ "images":"image/en_picture.PNG",
+ },
+}
+
+
+ {
+ "strings": {
+ "name":"小程序试用版",
+ "short_name":"小程序",
+ "description_application":"迷你程序试用版本",
+ },
+ "files": {
+ "images":"image/zh_picture.PNG",
+ },
+}
+
+
+ {
+ "dir":"ltr",
+ "lang":"en-US",
+ "appID":"org.w3c.miniapp",
+ "name":"$string:name",
+ "short_name":"$string:short_name",
+ "versionName":"1.0.0",
+ "versionCode":"1",
+ "description":"$string:description_application",
+ "icons"[
+ {
+ "src":"common/icons/icon.png",
+ "sizes":"48x48",
+ }
+ ],
+ ...
+}
+
From 9e0cc4f9ca3b7e4b992eea8ca207fed4c04f5c0a Mon Sep 17 00:00:00 2001
From: MichaelWangzitao
reason
member
- Internationalization
- 国际化方案
-
+
+ Internationalization
+ 国际化方案
+
Localizable members
From a8c1bf911229d81589d62c752db960c98957e23d Mon Sep 17 00:00:00 2001
From: MichaelWangzitao
reason
member
- Internationalization
- 国际化方案
+ Internationalization
+ 国际化方案
- Localizable members
- 可本地化属性
+ Localizable members
+ 可本地化属性
dir
and lang
if not otherwise specified.
@@ -1128,8 +1128,8 @@
- I18n Solution
- I18n方案
+ I18n Solution
+ I18n方案
i18n/en-US.json
-{
- "strings": {
- "name":"miniapp demo",
- "short_name":"MD",
- "description_application":"MiniApp Demo",
- },
- "files": {
- "images":"image/en_picture.PNG",
- },
-}
-
+
+ + { + "strings": { + "name":"miniapp demo", + "short_name":"MD", + "description_application":"MiniApp Demo", + }, + "files": { + "images":"image/en_picture.PNG", + }, + } +
i18n/zh-Hans.json
-{
- "strings": {
- "name":"小程序试用版",
- "short_name":"小程序",
- "description_application":"迷你程序试用版本",
+
+
+{
+ "strings": {
+ "name":"小程序试用版",
+ "short_name":"小程序",
+ "description_application":"迷你程序试用版本",
},
- "files": {
- "images":"image/zh_picture.PNG",
+ "files": {
+ "images":"image/zh_picture.PNG",
},
}
-
+
Developers can refer to a resource using the syntax $string:‹resource-name›, for example, "decscription": "$string:description_application". @@ -1184,24 +1188,25 @@
{
- "dir":"ltr",
- "lang":"en-US",
- "appID":"org.w3c.miniapp",
- "name":"$string:name",
- "short_name":"$string:short_name",
- "versionName":"1.0.0",
- "versionCode":"1",
- "description":"$string:description_application",
- "icons"[
+
+{
+ "dir":"ltr",
+ "lang":"en-US",
+ "appID":"org.w3c.miniapp",
+ "name":"$string:name",
+ "short_name":"$string:short_name",
+ "versionName":"1.0.0",
+ "versionCode":"1",
+ "description":"$string:description_application",
+ "icons"[
{
- "src":"common/icons/icon.png",
- "sizes":"48x48",
+ "src":"common/icons/icon.png",
+ "sizes":"48x48",
}
],
...
}
-
+
In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts sting: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。
From 6aee4f079146c2d204e099354de90a5940f4d393 Mon Sep 17 00:00:00 2001
From: MichaelWangzitao
以下例子描述一个简单的支持多语言的manifest片段:
-{ - "dir":"ltr", - "lang":"en-US", - "appID":"org.w3c.miniapp", - "name":"$string:name", - "short_name":"$string:short_name", - "versionName":"1.0.0", - "versionCode":"1", - "description":"$string:description_application", - "icons"[ - { - "src":"common/icons/icon.png", - "sizes":"48x48", - } - ], - ... -} -+
+ { + "dir": "ltr", + "lang": "en-US", + "appID": "org.w3c.miniapp", + "name": "$string:name", + "short_name": "string:short_name", + "versionName": "1.0.0", + "versionCode": 1, + "description": "$string:description_application", + "icons": [ + { + "src": "common/icons/icon.png", + "sizes": "48x48" + } + ] + } +
In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts sting: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。
From a92c9642b8e9ffe502a18ffd4aecff4d3ee91a52 Mon Sep 17 00:00:00 2001
From: MichaelWangzitao
- In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts sting: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。
+ In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts string: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。
通过上述方式,应用市场在读取应用manifest时,会根据自身的配置信息,从i18n目录下相应的语言文件,提取字符串信息,生成本地描述。例如 应用市场配置信息为汉语简体,则应用市场会解析manifest中"name": "$string:name"语句,从i18n目录的zh-Hans.json文件,提取sting:name信息:小程序试用版,并在应用市场生成该应用的本地化名称:小程序试用版。
From dfaf775960126e1a98081b16b86a4ecf7d432556 Mon Sep 17 00:00:00 2001
From: MichaelWangzitao
- 通过上述方式,应用市场在读取应用manifest时,会根据自身的配置信息,从i18n目录下相应的语言文件,提取字符串信息,生成本地描述。例如 应用市场配置信息为汉语简体,则应用市场会解析manifest中"name": "$string:name"语句,从i18n目录的zh-Hans.json文件,提取sting:name信息:小程序试用版,并在应用市场生成该应用的本地化名称:小程序试用版。
+ 通过上述方式,应用市场在读取应用manifest时,会根据自身的配置信息,从i18n目录下相应的语言文件,提取字符串信息,生成本地描述。例如 应用市场配置信息为汉语简体,则应用市场会解析manifest中"name": "$string:name"语句,从i18n目录的zh-Hans.json文件,提取string:name信息:小程序试用版,并在应用市场生成该应用的本地化名称:小程序试用版。
In this way, when reading the MiniApp Manifest, the MiniApp processor, such as marketplace, can extract the string resource information from the corresponding language file in the MiniApp package's i18n directory according to the configuration information of itself and generates the localized description. For example, if the configuration information of the marketplace is simplified Chinese, the marketplace parses the "name": "$string: name" statement in the manifest and extracts string: name information from the zh-Hans.json file in the MiniApp package's i18n directory. And then it generates the localized name of the MiniApp: 小程序试用版。