Code.org's various projects are translated by volunteers using Crowdin. For more information about our translation process, please visit code.org/translate. Join our Code.org project on Crowdin to start translating immediately!
This project provides scripts for centralizing source assets to be localized, synchronizing with Crowdin, and then re-integrating the localized assets back in to their respective projects.
gem install crowdin-cli
TODO: how to use Chef to update crowdin.yaml with API Key
cd i18n/code.orgMake sure you're on staging branch./in.shGather files from each subproject and store them in ../locales/en-US./up.shUpload new and updated strings to Crowdin./down.shDownload latest translations from Crowdin. NOTE: You might not see output for a few minutes while Crowdin builds../out.shMove translated files out to each subproject. NOTE: This takes a while too.- Commit and push all translations
git commit -m "code.org translations mm/dd" # use today's date
git pushcd code-dot-org/i18n/hourofcode.com./sync.rb
cd code-dot-org/i18n/curriculum./sync.rb
- Update the string in the i18n Gsheet
ssh staging.code.organd check that your changes were synced tostaging/pegasus/cache/i18n/en-US.yml- Commit and push
en-US.yml
- Add a unique key and your string value to the i18n Gsheet. NOTE: Make sure your string value only has plain HTML. Organization is by category/page; try to prepend each string of a common category with the same key. For example, all teacher dashboard strings begin with 'dashboard'
ssh staging.code.organd check that your changes were synced tostaging/pegasus/cache/i18n/en-US.yml- Commit and push
en-US.ymlNOTE: If you see that it switched from "en-US" to en-US, it's OK to commit.
@@ -1,4 +1,4 @@
-"en-US":
+en-US:- On your development environment, pull staging branch and do the following to sync the string for all locales.
cd i18n/code.org
./sync-pegasus.sh- Commit and push i18n/locales/source/pegasus/mobile.yml + all locale files in pegasus/i18n/cache/xx-YY.yml except for en-US.yml
git commit -m "new pegasus string XYZ"
git push- Make changes in
blockly-core/i18n/en-US/core.json - Run:
cd blockly-core/i18n && ./codeorg-messages.sh && cp ../msg/js/en_us.js ../../apps/lib/blockly/ && cd ../../apps && grunt build && cd - - Check in the resulting changes in the files:
blockly-core/i18n/locales/en-US/core.jsonblockly-core/msg/js/en_us.jsapps/lib/blockly/en_us.js
Example changelist adding a new string.
- Make changes in
apps/i18n/<app>/en_us.json
- Make changes in
dashboard/config/localesNOTE: Choose from the following files depending on where it best fits categorically.
- contract_match.en.yml
- data.en.yml
- devise.en.yml
- dsls.en.yml
- en.yml
- scripts.en.yml
- slides.en.yml
- text_match.en.yml
- unplugged.en.yml
- DO NOT directly modify
match.en.ymlormulti.en.ymlPlease make changes to the levels directly in levelbuilder.
If you see an error similar to the following:
/Users/brent/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/json-1.8.1/lib/json/common.rb:155:in `encode': "\xC3" on US-ASCII (Encoding::InvalidByteSequenceError)
check the values of environment variables LANG and LC_ALL. On my MacBook this only seemed to work when these values were not set. On my Linux machine, this only seemed to work when these were set to LINUX=en_US.UTF-8 and LC_ALL=POSIX