-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 11.11.2011 13:33, schrieb Franz:
> Hi,
> 
> is there any special method / guide how to translate report and report
> description?
> 
> I have translated my report description in BudgetingPlugin [...]

Interesting. I had a quick look. I confess, that I haven't worked much
with the report system before, so I can't be definitive regarding
translations in this part of Trac.

OTOH markup in the following lines will most probably NOT work as you
expect, just because there is no such thing like object/variable
translation in Trac's/Babels gettext methods.

> 769    descr = _(report[2])

> 775    sql += " VALUES(%s, null, '%s', '%s', '%s');" % (report[0],
_(report[1]), report[3], descr)

As a side-note: Following PEP8 you should shorten lines for better
commenting/diff/editing experience.

> Might this be a practicable way (maybe also for Trac itself)?
> 
> I still have a problem, because I've used German words in my SQL
> statement (because they are displayed in reports view). I would find
> it a poor design if I put this also in my messages.pot - but what
> would be the alternative?

None right now. There is no support in Trac core right now, apart from
standard fields. Any custom field label can't be translated. A plugin
offers at least the possibility by binding an additional message
catalog, but to make it really work, you'd have to translate the SQL
statement on every request. This collides with saving fixed query
strings in the report Trac db table.

Adding variables or translation markup into SQL statement would most
likely be too much to configure for even advanced admins. Translations
are always less flexible, because they can't be changed as quickly as
the report SQL statement. This is a serious conflict. Runtime-changeable
message catalogs are not invented AFAIK, so there's not much hope for
progress either.

Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6+iQoACgkQ31DJeiZFuHfaLACgqRlrSAra3EaFrejL6VgF9bMb
YdEAnAp6UVzy9QJPh06fr/ipI4CWKnpl
=/tsn
-----END PGP SIGNATURE-----

-- 
You received this message because you are subscribed to the Google Groups "Trac 
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/trac-dev?hl=en.

Reply via email to