Thanks, Raluca.

Raluca Stavro wrote:
> See this document in order to learn the basics of the translations
> module: http://platform.xwiki.org/xwiki/bin/view/Features/I18N .
>
> A trick to solve your problem would be to have a single 'name'
> property for the 'Species' class.
> Let's say that you attached an object of type 'YourSpace.Species'
> class to a document named 'YourSpace.DocName'.
> You set the value of the 'name' property to 'sp_name_key' (use a key
> in order to be able to use translations based on it).
> Edit the document in wiki mode and write:
> {{velocity}}
>   #set($thisDocSpeciesNameKey =
> $doc.getObject('YourSpace.Species').getProperty('name').value) ##
> $thisDocSpeciesNameKey value is 'sp_name_key'
>   $msg.get("$!thisDocSpeciesNameKey")
> {{/velocity}}
> ## save the document
>
> In the translations document, for the 'en' version you write the key &
> value like this:
> sp_name_key=my EN sp name
> ## save the document
>
> For the 'fr' version, you write this:
> sp_name_key=my FR sp name
> ## save the document
>
> Now, if you go to .../view/YourSpace/DocName (your document in 'view'
> mode), by changing the language you will see that the displayed name
> is different for each language.

I think I see how this works. I'll implement sample here. I'm already 
using this method for panels, but I've never used it for class properties.

But, in any case, I'll also try to write a model for using a kind of 
"translation class". Is the application available at 
http://l10n.xwiki.org working the way you describe? Thanks!

Ricardo

-- 
Ricardo Rodríguez
CTO
eBioTIC.
Life Sciences, Data Modeling and Information Management Systems

_______________________________________________
users mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to