No description
Find a file
Christopher Willis-Ford 6192ffed75 ci: use output parameter for MADE_CHANGES check
Previously, this was using outdated and 'insecure' syntax for setting an
environment variable. More info here:
https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

This could have been solved by using `echo STUFF >> "$GITHUB_ENV"` but I
think using a step output is even better, mainly because it's more clear
what kind of changes `MADE_CHANGES` is talking about.

I also reordered the commands so that if writing the step output fails,
the step will fail before pushing the changes. That means we'll no
longer end up with half-released changes (released on GitHub but not
NPM).
2023-11-20 07:58:35 -08:00
.github ci: use output parameter for MADE_CHANGES check 2023-11-20 07:58:35 -08:00
.tx New scripts to support www in scratch-l10n 2019-02-12 10:50:43 +01:00
editor pull new editor translations from Transifex 2023-10-23 03:20:51 +00:00
images Add contact-us-form screenshot 2020-05-28 14:11:31 -04:00
lib fix: fetch languages and correctly get language code in txAvailableLanguages 2022-11-29 16:22:39 -05:00
scripts fix: add missing stdout 2022-11-18 16:10:34 -05:00
src feat: add hindi 2023-07-24 17:53:34 -04:00
www pull new editor translations from Transifex 2023-11-18 03:18:01 +00:00
.babelrc Add scripts for automation 2018-11-25 18:05:44 -05:00
.eslintignore Remove dependency on react-intl 2021-06-15 08:56:03 -04:00
.eslintrc.js fix: use es6 in eslint to avoid disabling linting on some lines 2022-09-26 15:16:18 -04:00
.gitattributes add .gitattributes 2021-06-11 14:06:08 -07:00
.gitignore L10n packaging (#1) 2017-09-21 11:54:41 -04:00
.jshintrc Add www resources 2018-03-13 11:46:37 -04:00
.npmignore Add www resources 2018-03-13 11:46:37 -04:00
.nvmrc ci: cci to gha migration 2023-10-18 16:00:09 -04:00
LICENSE Include default Scratch License and TM files 2018-06-19 17:03:04 -04:00
package-lock.json feat: add hindi 2023-07-24 17:53:34 -04:00
package.json feat: add hindi 2023-07-24 17:53:34 -04:00
README.md added notes about .tx/config deprecation 2019-01-22 09:51:45 -05:00
TRADEMARK Include default Scratch License and TM files 2018-06-19 17:03:04 -04:00
webpack.config.js Refactor so it’s not a breaking change 2021-06-16 10:20:34 -04:00

scratch-l10n

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.

Using scratch-l10n in development

Installation

npm install --save-dev scratch-l10n

Basic Use

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.

Deprecations

We are moving away from using the tx cli, so the .tx/config file will eventually be deprecated.