|
TranslateWordMobi
Instructions for translators
IntroductionWordmobi has multilingual support since version 0.4.4. At this moment, the following translations are available:
Translating WordmobiIf you want to see your language supported, follow the steps below. Getting latest source code and Python for S60
Creating our locale fileYou will need to choose one language for starting from. In source files (e:\python\lib), these translations are available as files that start with wmlocale (see table in previous section). These file names follow the nomenclature wmlocale_<ISO 639-1 code>_<ISO 3166-1 code>. ISO 639-1 is a two letters code for representing language names and ISO 3166-1 is another two letters code for country names. Country name may be omitted if the language does not have any variation or Wordmobi does not have this variation yet. Using this pattern, copy one translation available and rename it according to your language\country (if any). For instance, a UK user could create the file wmlocale_en_uk.py. TranslatingBelow, we have a snippet from locale file wmlocale_en_us.py. # -*- coding: cp1252 -*- # Wordmobi main menu wm_menu_post = u"Posts" wm_menu_comm = u"Comments" wm_menu_tags = u"Tags" wm_menu_cats = u"Categories" # ... wm_err_upd_page = u"Impossible to access update page %s" wm_err_downld_fail = u"Impossible to download %s" The rules are:
TestingFor non programmersThe simple way to test is just replacing some original locale file with yours. I mean, copy you translation contents inside wmlocale_en_us.py (overwrite original contents) and run default.py, via Python Shell. Select English_EUA inside settings menu. For programmersIf you are comfortable for editing Python code, edit settings.py and find the following code snippet, at the end of file: langs = [ (LABELS.loc.st_menu_en_us, u"en_us"),
(LABELS.loc.st_menu_pt_br, u"pt_br"),
(LABELS.loc.st_menu_es, u"es"),
(LABELS.loc.st_menu_tr, u"tr")]Just modify this array and copy your locale file to e:\python\lib. For instance, copy wmlocale_en_uk.py to e:\python\lib and change langs as follow: langs = [ (LABELS.loc.st_menu_en_us, u"en_us"),
(LABELS.loc.st_menu_pt_br, u"pt_br"),
(LABELS.loc.st_menu_es, u"es"),
(LABELS.loc.st_menu_tr, u"tr")
(u"English (UK)", u"en_uk") ]u"English (UK)" must be unicode and will be presented at language selection menu. u"en_uk" must match with the end of your locale file name. SubmittingJust drop me an email with your translation (marcelobarrosalmeida at gmail.com). |
Sign in to add a comment