Hi,
I have several dictionaries which needs translation, where would you
recommended I store these?
I currently have them in model-files and they typically looks something
like this:
choices = collections.OrderedDict((
('1', T('Choice 1')),
('2', T('Choice 2')),
...
))
Then I use them in string-Fields with the IS_IN_SET validator.
Since models are evaluated at every request it seems like a waste to have
these files with 'static' data being parsed all the time. For example, I
currently have around 2000 lines consisting of similar lists representing
different choices (country names, etc.).
Therefore it seems natural (to me) to move them into modules and translate
them when needed using "current.T" or alternatively to translate them "once
and for all" (don't know if this is possible).
However, if I define the dict in a module it seems like these strings are
only added to the "language list" when they are first evaluated by some
function, see this related question
<https://groups.google.com/forum/#!searchin/web2py/translation$20modules|sort:relevance/web2py/XXDhtjjMhXQ/s2hJCVY_eycJ>
In this case, how do I go about generating the full list of all the
translation strings without manually triggering the translation for each of
them?
Maybe I'm going about this the wrong way so would like to hear how other
people structure their translation resources.
Thanks
// Jim
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.