Last modified by Simon Urli on 2023/10/10

From version 90.1
edited by Thomas Mortagne
on 2014/11/27
Change comment: There is no comment for this version
To version 91.2
edited by Pascal Bastien
on 2016/06/29
Change comment: utilisateur courent -> utilisateur courant

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.ThomasMortagne
1 +XWiki.pbas
Content
... ... @@ -94,6 +94,31 @@
94 94  {{hello greetUser="true"/}}
95 95  {{/code}}
96 96  
97 +== Translations ==
98 +
99 +
100 +
101 +When your macro is ready, you might want to provide the description of the macro and its parameters in different languages. For that, you need to create a set of translation keys and values (as described [[here>>DevGuide.InternationalizingApplications]]) and then just use the following convention for the keys you add in this storage (no modification is needed on the macro itself, the association of the translations to the macro is done based on a convention of the form of the translation keys):
102 +
103 +{{code}}
104 +rendering.macro.<macro id>.name=Name of the macro, displayed in the macros list in the macros wizard
105 +rendering.macro.<macro id>.description=Description of the macro, displayed as a help in the macros list in the macros wizard
106 +
107 +rendering.macro.<macro id>.parameter.<parameter name>.name=Name of the macro parameter, to be displayed in the form for the macro settings in the macros wizard
108 +rendering.macro.<macro id>.parameter.<parameter name>.description=Description of the macro parameter, to be displayed as a help in the form for the macro settings in the macros wizard
109 +{{/code}}
110 +
111 +Don't forget to make sure that the visibility of the translations is the same as the visibility of the macro, so that anywhere you use the macro you also have the translations.
112 +
113 +In our example, french translations would be something like this:
114 +
115 +{{code}}
116 +rendering.macro.hello.name=Macro pour dire bonjour
117 +rendering.macro.hello.description=Ceci est une macro qui va dire "Bonjour" a l'utilisateur
118 +rendering.macro.hello.parameter.greetUser.name=Personnaliser le message
119 +rendering.macro.hello.parameter.greetUser.description=Personnaliser le message pour l'utilisateur courant en train de visualiser la page. Les valeurs possibles sont "true" (oui) et "false" (non).
120 +{{/code}}
121 +
97 97  = WYSIWYG Access =
98 98  
99 99  A wiki macros is treated just like any other rendering macro in the system. As such, the moment you save your wiki macro it will be available to the users through the WYSIWYG editor's **Insert Macro** dialog box:

Get Connected