提交 31df7b8e 编写于 作者: S Shu Muto 提交者: Kubernetes Prow Robot

Update document for i18n (#4284)

Added description for authority of translation files.
上级 84709b3d
......@@ -13,13 +13,13 @@ Based on current browser locale the Dashboard can be displayed in one of the sup
## Building localized dashboard
To show localized dashboard, you need to build dashboard binary before.
To build dashboard binary, run `npm run build`. Or to run localized dashboard immediately, run `npm run start:prod`.
To build dashboard binary, run `npm run build`. Or to build and run localized dashboard immediately, run `npm run start:prod`.
Note: Building localized dashboard takes time, so development environment, e.g. `npm start`, does not compile localized versions.
## Translation management
All translation data is stored in `i18n/` directory in project's root. It includes `locale_conf.json` configuration file, translation source file `messages.xlf` and localized files for each language, e.g. `messages.fr.xlf` or `messages.ja.xlf`.
All translation data is stored in `i18n/` directory in project's root. It includes `locale_conf.json` configuration file, translation source file `messages.xlf` and localized files for each language, e.g. `fr/messages.fr.xlf` or `ja/messages.ja.xlf`.
## Introducing new localizable text
......@@ -28,17 +28,17 @@ Add `i18n` attribute into tag surrounding new text in Angular template html file
### To update translation source file and localized files
Run `npm run fix:i18n`. It will execute `ng xi18n` and `xliffmerge`, they will update `i18n/messages.*` files.
Run `npm run fix:i18n`. It will execute `ng xi18n` and `xliffmerge`, they will update `i18n/messages.xlf` and `i18n/[locale]/messages.[locale].xlf` files.
### To translate new localizable text
`xliffmerge` would copy new localizable texts from `<source>` element to `<target>` element with `state="new"` attribute in your language file, i.e. `i18n/messages.[locale].xlf`.
Find new localizable texts in `i18n/messages.[locale].xlf` file and translate text in the `<target>` element.
`xliffmerge` would copy new localizable texts from `<source>` element to `<target>` element with `state="new"` attribute in your language file, i.e. `i18n/[locale]/messages.[locale].xlf`.
Find new localizable texts in `i18n/[locale]/messages.[locale].xlf` file and translate text in the `<target>` element.
## Introducing new language
1. Add your language code, e.g. `fr` or `ja`, into `"languages"` array of `"xfillmergeOptions"` in `package.json` file.
2. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/messages.fr.xlf` would be generated.
2. Run `npm run fix:i18n`. Then translation file for your language, e.g. `i18n/fr/messages.fr.xlf`, would be generated.
3. Open your language file and translate texts in `<target>` element into your language.
After preparation of new translation file, configure `i18n/locale conf.json` file to build newly localized dashboard as follows:
......@@ -55,6 +55,8 @@ To add Japanese translation file, add `"ja"` into `"translations"` array in alph
Then you can build your localized dashboard with `npm run build`.
Dashboard team have willing to transfer authority to review/approve for updating your translation file. If your translation team have willing to manage your translation file, add `i18n/[locale]/OWNERS` file and organize your translation team in it.
At last, please create Pull Request and submit it to `kubernetes/dashboard`.
----
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册