You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`zh` is same as `zh-cn`, so maintain `zh` and change `zh-cn` to link to `zh`.
Also, added support for `i18n/locales_not_for_build_local` that keeps
locales not for build as local setting for developer. Because building
dashboard takes much time.
Copy file name to clipboardexpand all lines: docs/developer/internationalization.md
+30-17
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
Based on current browser locale the Dashboard can be displayed in one of the supported languages listed below. In case it does not work, make sure that your browser's locale is identified with correct language code. In more details, Dashboard determines requested language based on HTTP `Accept-Language` header from browser. We can check which language codes are requested by browser on `Network` tab in developer tool of browser.
4
4
5
-
| Language | Code |
6
-
|--------------------|------|
7
-
| English (default) | en |
8
-
| French | fr |
9
-
| Japanese | ja |
10
-
| Korean | ko |
11
-
| Simplified Chinese | zh |
12
-
| Chinese (PRC) | zh-cn|
13
-
| Chinese (Hong Kong)| zh-hk|
14
-
| Chinese (Singapore)| zh-sg|
15
-
| Chinese (Taiwan) | zh-tw|
5
+
| Language | Code| Remarks |
6
+
|---------------------|---------|------------|
7
+
| English (default) | en| - |
8
+
| French | fr| - |
9
+
| Japanese | ja| - |
10
+
| Korean | ko| - |
11
+
| Simplified Chinese | zh| - |
12
+
| Chinese (PRC) | zh-cn| Same as zh |
13
+
| Chinese (Hong Kong)| zh-hk| - |
14
+
| Chinese (Singapore)| zh-sg| - |
15
+
| Chinese (Taiwan) | zh-tw| - |
16
16
17
17
## Building localized dashboard
18
18
@@ -43,13 +43,19 @@ Find new localizable texts in `i18n/[locale]/messages.[locale].xlf` file and tra
43
43
44
44
Since dashboard team can not review translation files in your language, so dashboard team transfers authority to review and approve for updating your translation file. At first, you need to organize translation team for your language that manages dashboard translation file.
45
45
46
-
1. Add your locale, e.g. `fr` or `ja`, into `"languages"` array of `"xfillmergeOptions"` in `package.json` file.
47
-
**Important: Locales should be written in lower case to be handled by Dashboard, e.g. `zh-tw`, not `zh-TW`**
48
-
2. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/messages.fr.xlf`, would be generated.
49
-
3. Create a new directory for generated file, e.g. `i18n/fr` and move generated file there.
46
+
1. Create your locale directory under `i18n` directory, e.g. `i18n/fr` or `i18n/ja`.
47
+
2. Add your locale, e.g. `fr` or `ja`, into `"languages"` array of `"xliffmergeOptions"` in `package.json` file. If you want to add only locale and use an existing translation file for it, i.e. add `zh-cn` but use existing `i18n/zh/messages.zh.xlf` file for it, skip this step and go step 5.
48
+
**Important: Locales should be written in lower case to be handled by Dashboard, e.g. `zh-cn`, not `zh-CN`**
49
+
3. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/fr/messages.fr.xlf`, would be generated in your locale directory.
50
+
If `i18n/[locale]/messages.[locale].xlf` is not normal file type, our script ignores `xliffmerge` for the locale.
50
51
4. Open your translation file and translate texts in `<target>` element into your language.
52
+
5. If you want to use an existing translation file for the locale, create symbolic link `messages.[locale].xlf` to the existing translation file like follow:
53
+
```
54
+
cd i18n/zh-cn
55
+
ln -s ../zh/messages.zh.xlf messages.zh-cn.xlf
56
+
```
51
57
52
-
After preparation of new translation file, configure `i18n/locale conf.json` file to build translated dashboard as follows:
58
+
After preparation of new translation file, configure `i18n/locale_conf.json` file to support translated dashboard as follows:
53
59
54
60
```
55
61
{"translations": [ "en", "fr", "ko", "zh" ]}
@@ -61,14 +67,21 @@ To add Japanese translation file, add `"ja"` into `"translations"` array in alph
To save time for building localized version in your develop environment, you can set locales not to build by creating `i18n/locale_not_for_build_local` and adding into it like below:
71
+
72
+
```
73
+
fr
74
+
ko
75
+
```
76
+
64
77
Then you can build your localized dashboard with `npm run build`.
65
78
66
79
Before submit Pull Request, add `i18n/[locale]/OWNERS` file for your translation team like below:
0 commit comments