Thursday, April 12, 2012

Globalization in webcenter

Globalization feature in the Webcenter is good and find the below video to get more idea.
Here we can easily change the labels in the different language. But not the content in the pages. It depends on where the content comes from, If it comes from UCM or some other content server you need to translate the content in the content server as well or pass the language to the content query.

Note : The portal framework will behave generic and it will change all the text and labels in the Admin console according to the language set.




use this snippet in the custom phase listener or in the value change listener of the Template bean.

String language = Locale.getDefault().getLanguage();
Locale newLocale = new Locale(this.language);
FacesContext context = FacesContext.getCurrentInstance();
context.getViewRoot().setLocale(newLocale);

short summary :

1. Use resource bundles for everything
2. for the navigation model, in the title you can't use expression language BUT you can use expression when creating the template of your site so instead of adding a real title in the nav model, specify a key matching the value in the bundle. This way you can use EL in your template that renders the navigation
3. When you create custom taskflows, use resource bundles.
4. when you want to change labels in existing webcenter taskflows, customize the resource bundle.