Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there a way to use texts based on the user language when creating buttons in macros

Rainer Broleen December 14, 2016

For example when using the create-from-template macro, can I enter the value of the 'Button text' parameter based on the current users UI language?

Or asking another way:

How can I localize the 'Button text' parameter for the create-from-template macro so that the user will see the buttons' text in his language when visiting the corresponding page?

1 answer

1 vote
Robert Krause
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 14, 2016

Hi Rainer,

yes, there are a couple of ways to do this. The Tutorial on internationalisation is a good point to start. It is also possible to use this for JavaScript (AJS.I18n.getText(...)) or soy templates (add transformer to web resources).

Best regards,
Robert 

Rainer Broleen December 15, 2016

Hi Robert,

thanks for your answer. Since the macro in question is a built-in macro, I doubt I can change its implementation in regard to internationalization. I was looking more for a method like that which is documented for the 'template name' parameter. To refer to the current date there one use the at notation: @currentDate.

I guess what I am looking for is a way to access a text already defined in the confluence language pack. I would assume a language pack contains a text for 'Create' or 'Create page' which has already been translated. If there were a handle for such texts then I could refer to them when filling out macro parameters.

Example @i18n:createPage.

Best regards

Rainer

Robert Krause
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 15, 2016

In that case you can create a translation pack. To find out which keys to translate you can add "?i18ntranslate=on" to the end of the url. This should show you the i18n keys, instead of the localized labels.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events