From 076f7a82de86f343475372ce80a6c6ef620691b7 Mon Sep 17 00:00:00 2001 From: damencho Date: Mon, 24 Oct 2016 14:42:23 -0500 Subject: [PATCH] Updates translation readme. --- lang/readme.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/lang/readme.md b/lang/readme.md index 2911c3412..e9b8ca244 100644 --- a/lang/readme.md +++ b/lang/readme.md @@ -1,20 +1,20 @@ Jitsi Meet Translation ========================== -Jitsi Meet uses [i18next](http://i18next.com) library for translation. -i18next uses separate json files for each language. +Jitsi Meet uses [i18next](http://i18next.com) library for translation. +i18next uses separate json files for each language. Translating Jitsi Meet ====================== -The translation of Jitsi Meet is integrated with Pootle. You can translate Jitsi Meet via our Pootle user interface on -[http://translate.jitsi.org](http://translate.jitsi.org). +The translation of Jitsi Meet is integrated with Pootle. You can translate Jitsi Meet via our Pootle user interface on +[http://translate.jitsi.org](http://translate.jitsi.org). **WARNING: Please don't create or edit manually the language files! Please use our Pootle user interface!** Development =========== If you want to add new functionality for Jitsi Meet and you have texts that need to be translated please use our translation module. -It is located in modules/translation. You must add key and value in main.json file in English for each translatable text. +It is located in modules/translation. You must add key and value in main.json file in English for each translatable text. Than you can use the key to get the translated text for the current language. **WARNING: Please don't change the other language files except main.json! They must be updated and translated via our Pootle user interface!** @@ -36,21 +36,19 @@ You can add translatable text in the HTML: ``` APP.translation.generateTranslationHTML("dialog.OK") // returns OK ``` - + The value in the options parameter will be added in data-i18n-options attribute of the element. - + **Note:** If you dynamically add HTML elements don't forget to call APP.translation.translateElement(jquery_selector) to translate the text initially. -* **via Javascript string** - call APP.translation.translateString(key, options). You can use that method to get the translated string in Javascript and then attach it in the HTML. - + ``` - APP.translation.translateString("dialog.OK") // returns the value for the key of the current language file. "OK" for example. + APP.translation.translateString("dialog.OK") // returns the value for the key of the current language file. "OK" for example. ``` -For the available values of ``options`` parameter for the above methods of translation module see [i18next documentation](http://i18next.com/pages/doc_features). +For the available values of ``options`` parameter for the above methods of translation module see [i18next documentation](http://i18next.com/pages/doc_features). **Note:** It is useful to add attributes in the HTML for persistent HTML elements because when the language is changed the text will be automatically translated. - Otherwise you should call ``APP.translation.translateString`` and manually change the text every time the language is changed.