maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Maposmatic-dev] A proposal to solve the translation problem


From: Konstantin Mochalov
Subject: Re: [Maposmatic-dev] A proposal to solve the translation problem
Date: Wed, 4 Apr 2012 10:03:39 +0400

On Wed, Apr 4, 2012 at 1:13 AM, Thomas Petazzoni
<address@hidden> 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]