From: Lars Kr.Lundin <gramps@lk...> - 2002-05-06 21:24:39
On Mon, May 06, 2002 at 11:52:04AM -0500, Alex Roitman wrote:
> As for these, as you pointed out in your previous message, there's a constant trouble
> translating complicated relationship terms. For now, I am changing my incorrect %(removed-2)d to
> formally correct and very ugly (%(removed)d - 2), but in the future the existence of the
> language-specific relationship calculator (or interpreter of RC results) would be a great thing.
I have tried to find out how pygettext deals with %() but have not found a good explanation.
So I ask here instead.
Consider this string (from a .po-file):
msgid "%(p1)s is the %(level)dth great grandson of %(p2)s."
As far as I understand, the surrounding .py source must provide variables
with values that are interpolated into the string at runtime.
In the above example an integer variable 'level' and string variables 'p1' & 'p2'
are used at runtime to build the resulting string.
Is that correct ?
If that is correct then an idea somes to mind:
Due to the pecularieties of some languages translators may have to
resolve to cumbersome translations like:
msgstr "%(p1)s er tip-(%(level)d - 1)-oldesøn af %(p2)s."
Now, if the runtime enviroment of that string had an integer variable
'levelm1' which is always set to levelm1 = level - 1
then the above translation could be simplified to
msgstr "%(p1)s er tip-%(levelm1)d-oldesøn af %(p2)s."
Can pygettext handle that?
If it is indeed possible then it would greatly improve some translations
to introduce such variables into the string-generating code.
The current src/po/*.po files have constructs that could benefit from
these four variables
levelp1 = level + 1
levelm1 = level - 1
removedm2 = removed - 2
removedm3 = removed - 3
Linux user & Danish Amateur Genealogist
GEDCOMP: An extensive and free database for genealogists with
interest in Denmark: http://www.lklundin.dk/gedcomp/
From: Alex Roitman <shura@al...> - 2002-05-07 01:29:30
On Mon, May 06, 2002 at 09:25:08PM -0000, Lars Kr. Lundin wrote:
> If it is indeed possible then it would greatly improve some translations
> to introduce such variables into the string-generating code.
> The current src/po/*.po files have constructs that could benefit from
> these four variables
> levelp1 = level + 1
> levelm1 = level - 1
> removedm2 = removed - 2
> removedm3 = removed - 3
I am all for it! I incorrectly assumed before that this could be done simply
by changing it to %(level-1)d, but I never bothered to check and, of course,
it does not work :-)
But, as you pointed out before, this only solves a part of a problem,
specifically, marginally fixing a set of English-based relations
which extremely poorly translate because of the whole different
scheme of relations in other languages/cultures.
Being a partial solution, it is an easy one to implement as compared to
the other part -- an optional language-specific RC translator. I would be
very interested to help constructing this module, at least for
my language :-)
But it seems that it all would have to wait until after the 0.7.3 release :-)
Dept. of Neuroscience, Lions Research Building
2001 6th Street SE, Minneapolis, MN 55455
Tel (612) 626-7280 FAX (612) 626-9201