T('mycontent') is the function for translation in web2py.
You can throw the content of a field to it
content = T(row.contentfield)
and it will appear at translation files to translate.
Since u apply it just to a few fields/rows/tables, it can work fine.
But for large contents, you will need a tool/api to automate translation,
and use a function to call it.
Alexandre Andrade
2011/12/26 Mathias Van Daele <[email protected]>
> Hey Anthony, thanks for your answer !
>
> Your solution for question 1 working fine ! (with label)
> For questions 2 I am still trying...
>
> Mathias
>
>
> Op 26 december 2011 19:06 schreef Anthony <[email protected]> het
> volgende:
>
> Concerning question 1 : How can I translate
>>> "name_father","name_mother",..**. in a form from this table ?
>>>
>>
>> Field() takes a "label" argument, which I think you should be able to
>> translate:
>>
>> Field('name_father', ..., label=T('Father Name'))
>>
>> If that doesn't work, try T('Father Name', lazy=False), which immediately
>> translates and returns a string.
>>
>>
>>>
>>> Concerning question 2 : Suppose table "size" contains some values like
>>> "big","small"...
>>> I am looking for a function to get these values translated too.
>>>
>>
>> In places where you display results, you could put the outputs inside
>> T(), as usual. I haven't tried it, but using the field's "represent"
>> attribute (
>> http://web2py.com/books/default/chapter/29/6#Record-representation) or a
>> virtual field (
>> http://web2py.com/books/default/chapter/29/6#New-style-virtual-fields-(experimental))
>> might work as well, depending on what you're doing.
>>
>> Anthony
>>
>
>
--
Atenciosamente
Alexandre Andrade
Hipercenter.com Classificados Gratuitos