Developer Area/Language Packs/GUI Translation Interface
From Mahara Wiki
< Developer Area | Language PacksRevision as of 00:54, 1 November 2011 by Kabalin
There is a customized tree of Mahara intended for translators called patch-adminlang.git. The tool has been developed by David Mudrak. It adds some code allowing you to translate Mahara through the web interface. It is recommended to run a separate installation of Mahara from this repository. Do not install production servers from this repo. Once some more features is added into this separate tree and it is bug free, it may be merged into the standard tree of Mahara.
About the adminlang repository
The repo is hosted at git repository (see http://gitorious.org/mahara-contrib/patch-adminlang).
Here is how branches are maintained. Note that only Mahara's STABLE branches are tracked.
---o---o---o---o---o---o---o---o git://gitorious.org/mahara/mahara.git#master \ o---o---o---o git://gitorious.org/mahara/mahara.git#1.4_STABLE \ o---o---o git://gitorious.org/mahara-contrib/patch-adminlang.git#adminlang-1.4
How to translate Mahara using this repository
- Install Mahara from this repo on your PC or testing server. Follow the steps described at [System_Administrator's_Guide/Installing_Mahara] but use
git clone git://gitorious.org/mahara-contrib/patch-adminlang.gitinstead of standard /mahara/mahara.git at Step 2.
- Switch to the branch that corresponds to the version of Mahara you plan to do the translation work on (probably the latest one).
git checkout -b adminlang-1.4 origin/adminlang-1.4
- Create a directory 'langpacks/xx.utf' in your Mahara data directory. 'xx' stands for your language code. Make sure the directory is writeable by the web server process. The structure of the directories within 'maharadata/langpacks/xx.utf8' has to correspond to the structure of the language-related directories in htdocs. You may find more details on language pack structure here.
- Copy the file 'langconfig.php' from the Mahara 'htdocs/lang/en.utf8' to 'maharadata/langpacks/xx.utf8/lang/xx.utf8' directory and change the string 'thislanguage' to your language.
$string['thislanguage'] = 'English';This variable will be used in the Language drop-down menu in Mahara Site Settings.
- Add the following configuration into your config.php and modify them as needed.
$cfg->lang_author = 'Your Name ';
$cfg->lang_copyright = '(C) 2006-2010 Catalyst IT Ltd http://catalyst.net.nz';All translated files in your package will have this information in the copyright header.
- Login as admin and go to Configure Site. Change Language to your new language.
- Go to Language card at Admin navigation. It opens admin/lang.php in the browser. Choose a file to edit. Add missing string or modify existing ones. Click on the existing string to edit it. There is no save button at the moment - every changed string is saved automatically on-the-fly by JSON AJAX request.