From 59d599e54a5dc029412a7664a41bb3946e516646 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sat, 19 Sep 2015 12:01:09 +0200 Subject: [PATCH] Updated Translation (markdown) --- Translation.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/Translation.md b/Translation.md index dca67b0..5b86d40 100644 --- a/Translation.md +++ b/Translation.md @@ -5,9 +5,14 @@ The translation concept follows similar concepts as GNU gettext: - As message IDs we use the original sentences in English. Therefore any untranslated messages will fall back to English and no English translation files need to be added. - Plural forms are supported. -## How to translate +## TL;DR: How to translate -tl;dr: Go into the directory `i18n`. Copy any of the files into your languages [two-letter ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes#Partial_ISO_639_table), i.e. to `es.json` for a Spanish. Open the file in a text editor and change the messages after the english message ID. Save the file in UTF-8 character encoding. Done. (Pull requests highly welcome!) +1. Go into the directory `i18n`. +2. Copy one of the files into your languages [two-letter ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes#Partial_ISO_639_table), i.e. to `es.json` for a Spanish. +3. Open the file in a text editor and change the messages after the english message ID. +4. Save the file in UTF-8 character encoding. +5. Add your new language code into the array called `supportedLanguages` in `lib/zerobin.js` (around line 300). +6. Done (Pull requests highly welcome!) ## Technical Details @@ -31,4 +36,19 @@ Many languages use plural forms and some even more then one. For number dependen [...] } -Some languages can have more then one plural forms. Which form to use depending on a given number is [decided based on a formula](http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html). \ No newline at end of file +Some languages can have more then one plural forms. Which form to use depending on a given number is [decided based on a formula](http://localization-guide.readthedocs.org/en/latest/l10n/pluralforms.html). + +### Gotchas + +Currently we do not inform the JS part about the available languages on the server, but instead these are statically encoded in the file `lib/zerobin.js` in the property `i18n.supportedLanguages` (around line 300). If you add a new language, remember to add it there, too. + +For the language labels displayed in the optional language selection drop down menu, a file called `i18n/languages.json` was created. Most languages should already be included with a translated language label and its English translation. + +If you provide translations for one of the languages not included in the list, you need to add it in there. Create a new property with a (not yet existing) ISO code and the language labels in its native form and translated to English, as in the example below: + + { + [...] + "qp": ["tlhIngan Hol", "Klingon"], + "13": ["1337 5934|<", "Leetspeak"], + [...] + }