Changes for page Writing Internationalized XWiki Applications
Last modified by Raphaƫl Jakse on 2022/03/17
Change comment:
Added snippet for selecting translated objects
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. ThomasMortagne1 +XWiki.Sergiu - Content
-
... ... @@ -53,7 +53,12 @@ 53 53 54 54 This is currently not implemented (see our logged issue: [[XWIKI-69>>http://jira.xwiki.org/jira/browse/XWIKI-69]]). There are 2 workarounds you can use: 55 55 56 -* Have several objects, one for each language, with a language field, and then decide which object to use (for example in a Class Sheet, based on the current language). 56 +* Have several objects, one for each language, with a language field, and then decide which object to use (for example in a Class Sheet, based on the current language):((( 57 +{{code language="none"}} 58 +$doc.getObject('Your.Class', 'lang', $context.language') 59 +## Will select the object whose 'lang' property is set to the current language 60 +{{/code}} 61 +))) 57 57 * Use Velocity scripting to do an IF in your object. For example, you could have:((( 58 58 {{code language="none"}} 59 59 #if ($context.language == "fr")