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 questionIn 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