mirror of
https://github.com/scratchfoundation/scratch-l10n.git
synced 2024-12-22 21:52:35 -05:00
Update README.md
This commit is contained in:
parent
757566ef14
commit
b00f2b9be2
1 changed files with 27 additions and 2 deletions
29
README.md
29
README.md
|
@ -1,7 +1,32 @@
|
||||||
# scratch-l10n
|
# scratch-l10n
|
||||||
|
|
||||||
Localization for the Scratch 3.0 editor - https://www.transifex.com/llk/public
|
Translation of all Scratch projects is managed on the Transifex service: https://www.transifex.com/llk/public
|
||||||
|
|
||||||
This repository collects translations submitted to the Scratch projects on Transifex. **Please do not submit PRs. If you would like to contribute translations, please sign up to translate on Transifex.**
|
This repository collects translations submitted to the Scratch projects on Transifex. **Please do not submit PRs. If you would like to contribute translations, please sign up to translate on Transifex.**
|
||||||
|
|
||||||
July 2017 Note: The project for the Scratch 3.0 editor is not yet public on Transifex as we're actively changing the code and the strings to translate are not yet stable. When the strings to translate are stable enough that it would be productive for translators to start translating we'll make it public. Thanks for your patience.
|
## Using scratch-l10n in development
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
```bash
|
||||||
|
npm install --save-dev scratch-l10n
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Basic Use
|
||||||
|
```js
|
||||||
|
import locales, {localeData, isRtl} from 'scratch-l10n';
|
||||||
|
import editorMessages from 'scratch-l10n/locales/editor-messages';
|
||||||
|
```
|
||||||
|
* `locales`: currently supported locales for the Scratch project
|
||||||
|
* `isRtl`: function that returns true if the locale is one that is written right-to-left
|
||||||
|
* `localeData`: locale data for the supported locales, in the format accepted by `addLocaleData` required by `react-intl`
|
||||||
|
* `editorMessages`: the actual message strings for all supported locales for a particular resource. `editorMessages` collects all the strings for the interface, extensions and paint-editor.
|
||||||
|
|
||||||
|
#### Useful Scripts
|
||||||
|
scratch-l10n provides:
|
||||||
|
* `build-i18n-src`: script that uses babel and plugins to extract all `FormattedMessage` strings for translation. Combines the message from all the source files into one `en.json`
|
||||||
|
* `tx-push-src`: script to push the `en.json` file to Transifex. Requires that the environment variable `TX_TOKEN` is set with a value that has developer access to the Scratch projects on Transifex (i.e. Scratch Team only)
|
||||||
|
|
||||||
|
#### Versioning
|
||||||
|
scratch-l10n uses semantic versioning - breaking changes will increment the major version number, and new features (e.g. a new language) will increment the minor version number. However, the patch number is actually a datetime string. That way it's easy to see how recently the translations were updated.
|
||||||
|
|
||||||
|
In general, changes that require a PR (new functionality, new language) should increment the minor version. Pulling new translations from Transifex is automated and will commit to master directly.
|
||||||
|
|
Loading…
Reference in a new issue