The bottom file is the default file for /languages/javascript/sound.json
. The top one, sound (localized).json
, has been stripped of unimportant fields and what remains are the strings related to localizing.
NOTE: When localizing files, they should be the same name as the default file. e.g.
sound.json
, notsound_localized.json
The fields related to localizing are:
id
- identifies each block so the original can be overwritten.name
- name of section and actual text that appears on block.help
- description of section and hover information text for blocks.
- Create a branch of master
- Create a new directory under
languages/javascript/localizations/
with the name of the two character locale code of the language you are translating.mkdir languages/javascript/localizations/es
for Spanish- Can be found here under "Code 2" column
- Copy files from
languages/javascript/
into the new directory - Strip unimportant parts of JSON. To make sure it is still valid JSON, please use a validator (usually its commas that mess things up)
- Replace any text of the fields "name" or "help" with the appropriate language
- Add appropriate filenames to
localizations
variable in the build script (format shown below). - Pull request
Below is an example format of the build script localizations
variable. The variable in this format states that for javascript language, there are localization files for Spanish (es) with the file names of array.json and boolean.json.
If the files are not listed in the build script, then they will not be found by the program
var localizations = {
javascript: {
es: ['array', 'boolean']
}
};
languages
└── javascript
├── localizations
│ └── es
│ ├── sound.json
│ └── ...
├── array.css
├── array.js
├── array.json
├── array_runtime.js
└── ...
From the implementation of overwriteAttributes, it looks like it will. Try it?