h1.
h2.
MojoMojo uses .po files to stores words, phrases and sentences of a language. For example, the base language file is en.po for English. The .po files are found in:
lib/MojoMojo/I18N/
h2.
Let's say I want to add català as a language that MojoMojo supports. Here are the steps:
h3.
For example:
msgid "Upload" msgstr "Carregar"
h3There is also script update_po.sh, Enablewhich thecan create new Languageor update existing po file. Simply run:
In order for the new language to show up as an option[1], one must add the base name of the file (
script/update_po.shca
In order for the new language to show up as an option1, one must add the base name of the file (ca in this example) to the Template file:
root/base/page/bottomnav.tt
h2.
When editing a new language there will be lines that take variables (indicated with %1, %2 etc). One can use the comments above msgid to see exactly what the variable is and which file contains the phrase in order to make the best translation.
For example, when translating:
#. (page.path)#: root/base/page/atom.tt:10 root/base/page/rss.tt:8 root/base/page/rss_full.tt:7msgid "Recent changes in x"msgstr "Recent changes in %1"
The value that will come into %1 (and x) is page.path. One could also look into root/base/page/rss.tt at line 8 to see the full context:
loc('Recent changes in x', page.path)
h2.
fn1. The language choices are currently at the bottom of MojoMojo pages - February 18, 2009.