-
-
Notifications
You must be signed in to change notification settings - Fork 64
Guide: Help Translate
The instructions below are old. Use google folder now. Instructions are in every doc at the top. Let us know if they need to be made more clear: https://drive.google.com/drive/folders/1QDCwxmTWZ8-9nLUg_b0M47UYaHXFR3n0
Thanks for helping with our localization project. Follow these instructions to contribute a new translation.
-
If you haven't yet, make sure to fork the project on GitHub and get it set up locally on your computer (see: Getting Started with Github and Forks).
-
Find the two-letter code for the language you want to translate into on this page: ISO 639-1 codes
-
In
src/localization/
, make a copy ofen.js
called[your language code].js
(for example, if you're translating into German, it would bede.js
). -
At the top of your new file, change 'English' to the name of your language (in that language, for example 'Deutsch', not 'German'). Also change 'en' to the two-letter code for your language.
-
Update the
all.js
file:-
Under the block of lines starting with
import EN from './en';
, add a line for your language, replacing the language code in both places. For instance, for German, you would add the lineimport DE from './de';
. -
Similarly, add a line for your language in the block of lines starting with
en: EN,
; for example, for German, you would add the linede: DE,
, before the ending curly bracket (};
).
-
-
Back in your newly copied file: after
'langCode:'
, the rest of the file contains a series of short text "keys", nested Javascript "objects" (sections enclosed in curly brackets{}
), and longer text "values". You should translate only the text values into your language. The values are all followed by commas, as opposed to the keys, which are followed by colons. For example, in the following snippet, the bold parts need to be translated:
export default { 'langName': 'German', 'langCode': 'de', 'currentBenefits': { 'hasSection8': { 'label': 'Do you have Section 8 Housing?', 'hint': 'Section 8 provides rental housing assistance.', }, [...] }, [...] 'about': { 'header': 'About the Cliff Effects Tool', 'section1Header': 'What is this tool for?', [...] } [...] };