mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
I18n: Add Chinese (Simplified) (#56739)
* Prevent _old.json files from being created * Add contrib docs for adding new locale * add chinese (simplified)
This commit is contained in:
@@ -38,6 +38,18 @@ const ErrorMessage = ({ id, message }) => <Trans id={`errors.${id}`}>There was a
|
||||
|
||||
3. Before submitting your PR, run the `yarn i18n:extract` command to extract the messages you added into the `messages.po` file and make them available for translation.
|
||||
|
||||
## How to add a new language
|
||||
|
||||
1. Add new locale in Crowdin and sync files to repo
|
||||
1. Grafana OSS Crowdin project -> "dot dot dot" menu in top right -> Target languages
|
||||
2. Grafana OSS Crowdin project -> Integrations -> Github -> Sync Now
|
||||
3. If Crowdin's locale code is different from our IETF language tag, add a custom mapping in Project Settings -> Language mapping
|
||||
2. Update `public/app/core/internationalization/constants.ts` (add new constant, and add to `VALID_LOCALES`)
|
||||
3. Update `public/app/core/internationalization/index.tsx` to add the message loader for the new locale
|
||||
4. Update `public/app/core/components/SharedPreferences/SharedPreferences.tsx` to add the new locale to the options.
|
||||
5. Update `public/locales/i18next-parser.config.js` to add the new locale to `locales`
|
||||
6. Run `yarn i18n:extract` and commit the result
|
||||
|
||||
## How translations work in Grafana
|
||||
|
||||
Grafana uses the [LinguiJS](https://github.com/lingui/js-lingui) framework for managing translating phrases in the Grafana frontend. It:
|
||||
|
||||
Reference in New Issue
Block a user