i18n: use zh-TW and zh-CN over zh-Hant and zh-Hans (#377)

Both crowdin and docsearch i18n configs use TW and CN over Hant and Hans. This should reduce some config confusions.
cc @ericnakagawa. Also, apparently you're working on algolia search i18n?
This commit is contained in:
Cheng Lou 2018-01-11 15:40:53 -08:00 committed by Joel Marcey
parent c08142c094
commit 00270c26a7
5 changed files with 17 additions and 17 deletions

View file

@ -41,8 +41,8 @@ files:
'tr': 'tr' 'tr': 'tr'
'uk': 'uk' 'uk': 'uk'
'vi': 'vi' 'vi': 'vi'
'zh-CN': 'zh-Hans' 'zh-CN': 'zh-CN'
'zh-TW': 'zh-Hant' 'zh-TW': 'zh-TW'
- -
source: '/website/i18n/en.json' source: '/website/i18n/en.json'
translation: '/website/i18n/%locale%.json' translation: '/website/i18n/%locale%.json'

View file

@ -31,7 +31,7 @@ The `pages/en/help-with-translations.js` file includes the same starter help pag
The `languages.js` file tells Docusaurus what languages you want to enable for your site. By default, we expect English to be enabled. The `languages.js` file tells Docusaurus what languages you want to enable for your site. By default, we expect English to be enabled.
The `crowdin.yaml` file is used to configure crowdin integration, and is copied up one level into your docusaurus project repo. If your docusaurus project resides in `/project/website`, then `crowdin.yaml` will be copied to `/project/crowdin.yaml`. The `crowdin.yaml` file is used to configure crowdin integration, and is copied up one level into your docusaurus project repo. If your docusaurus project resides in `/project/website`, then `crowdin.yaml` will be copied to `/project/crowdin.yaml`.
## Translating Your Existing Docs ## Translating Your Existing Docs
@ -140,8 +140,8 @@ files:
'ko': 'ko' 'ko': 'ko'
'mr': 'mr-IN' 'mr': 'mr-IN'
'pt-BR': 'pt-BR' 'pt-BR': 'pt-BR'
'zh-CN': 'zh-Hans' 'zh-CN': 'zh-CN'
'zh-TW': 'zh-Hant' 'zh-TW': 'zh-TW'
``` ```
You can go [here](https://support.crowdin.com/configuration-file/) to learn more about customizing your `crowdin.yaml` file. You can go [here](https://support.crowdin.com/configuration-file/) to learn more about customizing your `crowdin.yaml` file.
@ -150,7 +150,7 @@ You can go [here](https://support.crowdin.com/configuration-file/) to learn more
You will want to manually sync your files to and from crowdin. The sync process will upload any markdown files in `/docs` as well as translatable strings in `website/i18n/en.json`. (These strings can be generated by running `yarn write-translations`.) You will want to manually sync your files to and from crowdin. The sync process will upload any markdown files in `/docs` as well as translatable strings in `website/i18n/en.json`. (These strings can be generated by running `yarn write-translations`.)
You can add the following to your `package.json` to manually trigger crowdin. You can add the following to your `package.json` to manually trigger crowdin.
```json ```json
"scripts": { "scripts": {
@ -209,7 +209,7 @@ Note that in the `crowdin.yaml` file, `CROWDIN_PROJECT_ID` and `CROWDIN_API_KEY`
Now, Circle will help you automatically get translations prior to building your website. The provided `crowdin.yaml` file will copy translated documents into `website/translated_docs/`, and translated versions of the `i18n/en.json` strings file will into `i18n/${language}.json`. Now, Circle will help you automatically get translations prior to building your website. The provided `crowdin.yaml` file will copy translated documents into `website/translated_docs/`, and translated versions of the `i18n/en.json` strings file will into `i18n/${language}.json`.
If you wish to use Crowdin on your machine locally, you can install the [Crowdin CLI tool](https://support.crowdin.com/cli-tool/) and run the same commands found in the `circle.yaml` file. The only difference is that you must set `project_identifier` and `api_key` values in the `crowdin.yaml` file since you will not have Circle environment variables set up. If you wish to use Crowdin on your machine locally, you can install the [Crowdin CLI tool](https://support.crowdin.com/cli-tool/) and run the same commands found in the `circle.yaml` file. The only difference is that you must set `project_identifier` and `api_key` values in the `crowdin.yaml` file since you will not have Circle environment variables set up.
## Versioned Translations ## Versioned Translations
@ -224,4 +224,4 @@ If you wish to have translation and versioning for your documentation, add the f
Translated, versioned documents will be copied into `website/translated_docs/${language}/${version}/`. Translated, versioned documents will be copied into `website/translated_docs/${language}/${version}/`.
> Ensure in your Crowdin settings, in the Translations section, that "Duplicate Strings" are set to ["Hide - all duplicates will share the same translation"](https://support.crowdin.com/api/create-project/). This setting will ensure that identical strings between versions share a single translation. > Ensure in your Crowdin settings, in the Translations section, that "Duplicate Strings" are set to ["Hide - all duplicates will share the same translation"](https://support.crowdin.com/api/create-project/). This setting will ensure that identical strings between versions share a single translation.

View file

@ -41,8 +41,8 @@ files:
'tr': 'tr' 'tr': 'tr'
'uk': 'uk' 'uk': 'uk'
'vi': 'vi' 'vi': 'vi'
'zh-CN': 'zh-Hans' 'zh-CN': 'zh-CN'
'zh-TW': 'zh-Hant' 'zh-TW': 'zh-TW'
- -
source: '/website/i18n/en.json' source: '/website/i18n/en.json'
translation: '/website/i18n/%locale%.json' translation: '/website/i18n/%locale%.json'

View file

@ -174,8 +174,8 @@ const languages = [
{ {
enabled: false, enabled: false,
name: '中文', name: '中文',
tag: 'zh-Hans', tag: 'zh-CN',
}, },
{enabled: false, name: '繁體中文', tag: 'zh-Hant'}, {enabled: false, name: '繁體中文', tag: 'zh-TW'},
]; ];
module.exports = languages; module.exports = languages;

View file

@ -174,12 +174,12 @@ const languages = [
{ {
enabled: false, enabled: false,
name: "简体中文", name: "简体中文",
tag: "zh-Hans" tag: "zh-CN"
}, },
{ {
enabled: false, enabled: false,
name: "繁體中文", name: "繁體中文",
tag: "zh-Hant" tag: "zh-TW"
} }
]; ];
module.exports = languages; module.exports = languages;