On Wed, Apr 4, 2012 at 1:13 AM, Thomas Petazzoni <thomas.petazz...@enix.org> wrote: > Hello, > > Here is a proposal to solve the translation problem pointed by > Malenki, about the layout description strings, the stylesheet > description strings, and the "Best fit" string coming from the paper > sizes list. > > Since this solution is not entirely nice, I will wait for other > MapOSMatic developers to comment on it before committing. If you don't > like it, please suggest other solutions.
Maybe to load .mo file from ocitysmap? Django allows to load additional .mo files from configured directories: https://docs.djangoproject.com/en/1.4/topics/i18n/translation/#how-django-discovers-translations (possibly this is even feature of gettext library itself) Then to create noop function such as def gettext_noop(str): return str Add it to --keyword in xgettext invocation, and to decorate strings in ocitysmap with this function, i.e.: class MultiPageRenderer(Renderer): """ This Renderer creates a multi-pages map, with all the classic overlayed features and no index page. """ name = 'multi_page' description = gettext_noop('A multi-page layout.') multipages = True Then ./i18n.py will extract these strings to ocitysmap/locale/ocitysmap.pot, strings will be added to language translations which will be loaded by maposmatic django application too.