← Back to team overview

schooltoolers team mailing list archive

Compiling SchoolTool translations

 

One rather significant omission from last week's release was... translations.

Be assured that SchoolTool has been designed from the ground up for
good translation and internationalization, as long as we remember to
compile and include the language files!

Apologies for the omission.

Justas provides some details work arounds for the impatient.  Or you
can wait for a bugfix release slated for Tuesday April 12.

Selecting SchoolTool interface language
---------------------------------------

By default, the language is selected from browser's preferences.

You can force SchoolTool pages to be always displayed in a desired language.

Edit main.conf:

$ sudo vi /etc/schooltool/schooltool-2009/main.conf

And append a line "lang LANG_CODE" at the end, where LANG_CODE is the
desired language code.  Several examples:

lang ru
lang en_UK
lang fr


Compiling the languages
-----------------------

The current SchoolTool 2009 release has a (soon to be fixed) flaw:
language messages are not compiled, thus only English language is
available.

You can compile the messages manually:

$ cd /usr/lib/python2.5/site-packages/schooltool/locales
$ sudo sh -c 'for f in ./*/LC_MESSAGES/schooltool.po; do msgfmt -o
{f%.po}.mo ${f}; echo compiling: ${f}; done'

You should see a long list of templates being compiled:

compiling: ./af/LC_MESSAGES/schooltool.po
compiling: ./am/LC_MESSAGES/schooltool.po
compiling: ./ar/LC_MESSAGES/schooltool.po
...
compiling: ./yi/LC_MESSAGES/schooltool.po
compiling: ./zh_CN/LC_MESSAGES/schooltool.po

After this you need to restart the SchoolTool service:

$ cd /
$ sudo /etc/init.d/schooltool-2009 stop
$ sudo /etc/init.d/schooltool-2009 start

It is important not to run schooltool-2009 script from
/usr/lib/python2.5/... directory, as you will get a traceback with
DistributionNotFound exception.  Just don't forget "cd /" command.

If your SchoolTool deployment is for some reason using python 2.4, use
/usr/lib/python2.4/... directory instead.



Applying translations from Launchpad
------------------------------------

 Basically what one needs to do:

 Go to a translation download page, for example
https://translations.launchpad.net/schooltool/development/+pots/schooltool/ru/+export

 Select a .MO export and download it.

 The suggested filename for Russian export is
ru_LC_MESSAGES_schooltool.mo.  It needs to be saved as
/usr/lib/python2.5/site-packages/schooltool/locales/ru/LC_MESSAGES/schooltool.mo

  But the user cannot do that directly because he needs superuser
rights.  So save to some location, rename to schooltool.mo, sudo mv to
schooltool/locales/ru/LC_MESSAGES/

  Restart the SchoolTool services - here you go, your translation is applied.


Justas