We actually have that already. The way to do is:

T(' hello world ## comment')

This was introduced for a different purpose, allow the same string to have 
two different translations in different places. The comment causes the 
string to be treated as different in different places.

Check if this works for you and, if not, we can improve it.

Notice that you may need to include ## in the actual translated string. You 
can do this by adding a ## at the end

T(' hello world ## not a comment ## a comment')




On Thursday, 22 March 2012 08:18:16 UTC-5, Kalpa Welivitigoda wrote:
>
> Hi,
>
> I am working on a translation enhancement project on sahana-eden[1]. 
> sahana-eden uses the translation feature of web2py. Is it possible to have 
> a modified T() function so that the developer can leave a comment for the 
> translator, for example T("This is a SAMPLE", "keep SAMPLE as it is") where 
> the second argument is the comment. Or is there any other mechanism in 
> web2py to accomplish this task. Further the language file in 
> /applications/<application name>/languages/.py should be in the format
>
> "source string": "target string": "comment"
>
> I may be able to modify my local web2py so that this is accomplished. 
> Rather I would like to see this upstream as for 
> 1) sahana-eden is deployed with web2py framework so it needs it's core 
> functions build into it (patching is not so nice)
> 2) there will be many other projects existing or about to deploy on web2py 
> which will be benefited with this method.
>
> The whole idea is that the translator has more information that will 
> ultimately help to end in a better translation.
>
> I'm willing to contribute in code if the developers want me to.
>
> [1] eden.sahanafoundation.org
>
> Thank you
>

Reply via email to