[Trac-tickets] Re: [The Trac Project] #2063: Please use attribute
'value' instead of content in select options
The Trac Project
noreply at edgewall.com
Wed Sep 14 08:40:29 CDT 2005
#2063: Please use attribute 'value' instead of content in select options
---------------------------+------------------------------------------------
Reporter: vyt at vzljot.ru | Owner: jonas
Type: defect | Status: new
Priority: normal | Milestone:
Component: general | Version: devel
Severity: normal | Resolution:
Keywords: |
---------------------------+------------------------------------------------
Comment (by eblot):
> Emmanuel, can you show your <?cs var:translate[field.value] ?> function
?
Have a look at: http://anciens.enib.fr/trac/public/wiki/TracFrench (in
french, but you'll recognize the Trac interface)
Unfortunetly, translation is much more complex than it first seems, as the
translation effort needs to be done on Python files as well as Clearsilver
templates files (not to mention the Wiki pages themselves)
Let's take a sample file, `ticket.cs`
http://anciens.enib.fr/trac/public/browser/tasks/trac/french-
task/templates/ticket.cs, search for `alt:translation`
I'm using the `alt` syntax so that if a term has not been translated, the
original english word is shown (instead of an error or a empty space).
The translation dictionnary is instanciated in the new `translate()`
method in util.py, translated terms are loaded from a new section from the
trac.ini configuration file.
The translation dictionnary is used by templates files as well as the
Python engine. It is only used for "dynamic" words. "Static" words are
still hardcoded in template and Python files.
I'm not that happy with this solution, but that is the best balance I
found for now (knowing that I want to upgrade as easily as possible the
translation to the future release of Trac, at least [milestone:0.9 0.9];
and I do not want to invest to much effort translating Trac, as I believe
a better solution will be designed from the ground up for translation in a
next major release of Trac).
Either way, I think we should use the same way for translations (russian,
portuguese, japanese, french, etc.) so if someone comes with a better
solution, I'll be happy to follow it.
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2063>
The Trac Project <http://trac.edgewall.com/>
More information about the Trac-Tickets
mailing list