On 23 Jan 2014 at 03:55:37, Sergiu Dumitriu 
([email protected](mailto:[email protected])) wrote:

> On 01/22/2014 08:50 PM, Paul Libbrecht wrote:
> >
> > Hello fellow developers,
> >
> > at curriki we are slowly evolving to xwiki 2.1 (finally!) and it is not too 
> > easy.
> > Some of our objects are rendering user-interfaces messages that are 
> > expressed in xwiki syntax. To do so, they have the context.
> > But these objects are rendered sometimes in syntax 2.1 or syntax 1.0…
> >
> > Is there a way to tell the "current" syntax in the context object?
> >
> > thanks
> >
> > paul
>  
> Hi Paul,
>  
> 1. $doc.syntax [1]
>  
> 2. Something useful:
>  
> #foreach($d in $xwiki.searchDocuments("where doc.syntaxId='xwiki/1.0' or
> doc.syntaxId is null or doc.syntaxId = ''"))
> * [[$d]]
> #end

We also have a code snippet for this with more details:
http://extensions.xwiki.org/xwiki/bin/view/Extension/Syntaxes+Distribution+Chart

Thanks
-Vincent

> 3. That is why translation messages should not contain wiki markup or
> HTML code. See the paragraph starting with "Don't include markup in the
> translation" at [2].
>  
> [1]
> http://maven.xwiki.org/site/docs/xwiki-javadoc-4.1.x/com/xpn/xwiki/api/Document.html#getSyntax%28%29
> [2] http://dev.xwiki.org/xwiki/bin/Drafts/L10N+Conventions
>  
> --
> Sergiu Dumitriu
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to