Am 20.06.2007 um 17:10 schrieb Christian Boos:
> Christopher Lenz wrote:
>> in the wake of the Babel release today, I'm creating a new branch
>> where we can start integrating I18n support into Trac. The target
>> release for merging this work would be >=0.12, i.e. definitely after
>> 0.11.
>
> To ease merging between 0.11 and i18n/0.12, would it make sense to
> introduce the usage of _("...") on trunk as well, at some point,  
> with a
> no-op _ function?

Yeah, that is a good idea.

I would propose:

* add the module "trac.util.translation" (which is where you'd import  
the gettext functions from on the i18n branch) which defines the  
functions "gettext(string)" and "ngettext(singular, plural, num)".  
Those functions would simply return their arguments appropriately.  
Basically noops as you suggest, plus a tiny bit of logic in ngettext  
to return the correct english pluralization.

* also make the "_", "gettext", and "ngettext" functions available in  
the default template context.

* alias the "gettext" function to "_" and install it in the  
__builtins__ namespace so that it is available without importing it  
everywhere. Although I'm not entirely sure we even want that  
behavior... the question is at what point the function gets installed;  
on the branch it's done by the RequestDispatcher, which might lead to  
surprises when using _() without importing it when running outside of  
the context of a request.

* we start marking up any localizable strings in the python code on  
trunk, and merge those changes to the i18n branch. Same with the  
templates (please consult <http://genshi.edgewall.org/wiki/ 
Documentation/i18n.html> first, there's no need to explicitly markup  
all the text)

Cheers,
Chris
--
Christopher Lenz
   cmlenz at gmx.de
   http://www.cmlenz.net/


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