mirror of
https://github.com/scratchfoundation/scratch-l10n.git
synced 2024-12-22 21:52:35 -05:00
d20c6391ba
www uses l10n localeData instead of loading it’s own now, so no need to update customLocale separately.
2.7 KiB
2.7 KiB
Resolves
- Resolves #
Proposed Changes
Describe what this Pull Request does
Checklist for updating translations
There are two situations in which we create manual PRs to update translations:
- We don't want to wait for Travis's automatic weekly update; or,
- We need to add a language that has become ready
1. Updating translations manually
- Pull editor translations from Transifex with
> npm run pull:editor
- Pull www translations from Transifex with
> npm run pull:www
- Test the result with
> npm run test
- Confirm that you see changes to files like
editor/<resource>/<lang code>.json
Adding a language
-
Edit
src/supported-locales.js
:- Add entry for the language in the
locales
const - Check if language is right-to-left. If so:
- Add entry in
rtlLocales
- Add entry in
- Add entry for the language in the
-
Check if the new language uses a country code
- Check https://www.transifex.com/explore/languages. If the language has a country code:
- Edit
src/supported-locales.js
:- Add new entry to
localeMap
. Format is'<W3C HTML browser locale string>': '<Transifex ICU locale string>'
- Add new entry to
- Edit
.tx/config
:- Add to the
lang_map
list. Format is<Transifex ICU locale string>:<W3C HTML browser locale string>
- NOTE: we are moving away from using the
tx
cli;.tx/config
will eventually be deprecated
- Add to the
-
Edit
src/index.js
:- Add 'import' line and export line
- Add entry in
localeData
array
-
Check if locale is in
react-intl
- Look in https://unpkg.com/react-intl/locale-data/
- If not in
react-intl
:- Edit
src/supported-locales.js
:- In
customLocales
, add entry with parent set to areact-intl
locale
- In
- Edit
src/index.js
:- In
localeData
, add entry for parent locale
- In
- Edit
-
Update translations per the "Updating translations" section above
-
Confirm that we see changes to:
src/supported-locales.js
src/index.js
.tx/config
(if language needed a new locale)- Multiple files like
editor/<resource>/<lang code>.json
-
Bump minor version number in
package.json
-
Update scratch-blocks dependency
- scratch-blocks has its own translations. It will not pick up the new language unless the scratch-l10n dependency in
package.json
is updated to the new minor version.
- scratch-blocks has its own translations. It will not pick up the new language unless the scratch-l10n dependency in
-
Add language po files to scratchr2_translations
- manually update
scratchr2_translations/legacy
withtx pull -l <locale>
and check in changes
- manually update
-
Add language to scratchr2 settings
- manually update
settings/base.py
with the new language
- manually update