[Top][All Lists]
[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.
- Re: [Maposmatic-dev] A proposal to solve the translation problem, (continued)
- Re: [Maposmatic-dev] A proposal to solve the translation problem, Thomas Petazzoni, 2012/04/05
- Re: [Maposmatic-dev] A proposal to solve the translation problem, Jeroen van Rijn, 2012/04/05
- Re: [Maposmatic-dev] A proposal to solve the translation problem, David MENTRE, 2012/04/06
- Re: [Maposmatic-dev] A proposal to solve the translation problem, Thomas Petazzoni, 2012/04/06
- Re: [Maposmatic-dev] A proposal to solve the translation problem, Jeroen van Rijn, 2012/04/06
- Re: [Maposmatic-dev] A proposal to solve the translation problem, Thomas Petazzoni, 2012/04/06
- Re: [Maposmatic-dev] A proposal to solve the translation problem, David MENTRE, 2012/04/06
- Re: [Maposmatic-dev] A proposal to solve the translation problem, David MENTRE, 2012/04/06
- Re: [Maposmatic-dev] A proposal to solve the translation problem, David Decotigny, 2012/04/03
- Re: [Maposmatic-dev] A proposal to solve the translation problem, Thomas Petazzoni, 2012/04/04
Re: [Maposmatic-dev] A proposal to solve the translation problem,
Konstantin Mochalov <=
[Maposmatic-dev] (no subject), Konstantin Mochalov, 2012/04/04
Re: [Maposmatic-dev] A proposal to solve the translation problem, Thomas Petazzoni, 2012/04/10