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

Controlling Locale/Language for Space and Page Blueprints in Confluence

Robert Reiner _smartics_
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.
July 26, 2014

I'm trying to create a space/page with a space/page blueprint with a locale that differs from the site default. E.g. the site default it en, but I want to create a space with locale de. I have read some articles that discuss using different spaces for different locales, so I assume that there is a way to archive this.

I would like to set a locale for a space so that each application of a page blueprint will use the space's locale.

In my blueprints I use

<at:i18n at:key="mykey.desc"/>

to access the localized resources. It seems that the generation process uses the site default to determine the localization bundle:

i18NBeanFactory.getI18NBean(localeManager.getSiteDefaultLocale())

I also found no evidence that I can change this behaviour by setting a blueprint context parameter (e.g. com.atlassian.confluence.plugins.createcontent.api.contextproviders.BlueprintContextKeys).

Is my observation correct that Confluence selects the localization via the site default locale? If this is true, are there any workarounds to e.g. specify the locale via the wizard or taking the user's locale into account?

I suppose that setting the request language with com.atlassian.confluence.languages.LocaleManager does not offer any help? I gave it a try, but observed no effect. I have read the API doc, but I do not understand what these methods are designed for to do (i.e. who uses this information):

/**
     * Should set the language string from the request in a THREAD LOCAL cache.
     *
     * @param languageString
     */
    void setRequestLanguages(String languageString);

    /**
     * Should set the language string as given by Locale (en-gb for example) in a THREAD LOCAL cache.
     * Does nothing if the language string is invalid.
     *
     * @param language
     */
    void setLanguage(String language);

Has anybody managed to control the language/locale for creating spaces/pages with space/page blueprints independent of the site default locale?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Tim Eddelbüttel
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.
April 19, 2016

I'm also interested in that.

TAGS
AUG Leaders

Atlassian Community Events