Fórum

Page Title Localization

thumbnail
Nilesh Gundecha, modificado 12 Anos atrás.

Page Title Localization

Regular Member Postagens: 205 Data de Entrada: 01/12/09 Postagens Recentes
Hi Friends,

I want the page names to be localized. What I mean is - On the Top Navigation Bar, I shall get the Page/Tab Names as per the locale I have selected.
Can anyone please provide me some inputs on this? I am using Liferay's Classic theme.

I checked whether same is working on liferay.com or not?? And I found that its working on liferay.com. Its just to my surprise it was only not working when I selected Japanese language. (Don't know why???)

Please let me know How I will be able to achieve this?? All the pages I am creating programmatically using below code snippet : -


com.liferay.portal.model.Layout layout = LayoutLocalServiceUtil.addLayout(group.getCreatorUserId(), group.getGroupId(), privateLayout,
			LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, name, StringPool.BLANK, StringPool.BLANK, 
                        LayoutConstants.TYPE_PORTLET, false, friendlyURL, serviceContext);


Any help would be highly appreciated??

Thanks and Regards,
Nilesh.
thumbnail
Nilesh Gundecha, modificado 12 Anos atrás.

RE: Page Title Localization

Regular Member Postagens: 205 Data de Entrada: 01/12/09 Postagens Recentes
Can anyone provide some inputs on this?? I got the solution how to achieve this via Control Panel. All we have to do is as below: -
1) Go to Control Panel
2) Select "Pages" in left hand side list
3) Select the desired page
4) And then click on the "Page" tab
5) You can see the drop down menu with title as "Localized Language:"
6) Select the locale and provide corresponding localized name.
7) SAVE.

Thats it.

But all this I want to do programmatically. Does anyone know what API should I refer for this??


Thanks and Regards,
Nilesh.
thumbnail
jelmer kuperus, modificado 11 Anos atrás.

RE: Page Title Localization

Liferay Legend Postagens: 1191 Data de Entrada: 10/03/10 Postagens Recentes
Something like this probably:

com.liferay.portal.model.Layout layout = LayoutLocalServiceUtil.addLayout(
  group.getCreatorUserId(), 
  group.getGroupId(), 
  privateLayout,
  LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, 
  new HashMap<locale, string>() {{
            put(LocaleUtil.getDefault(), "Default name");
            put(new Locale("nl", "NL"), "Dutch name");
  }},
  Collections.<locale, string>emptyMap(),
  Collections.<locale, string>emptyMap(),
  Collections.<locale, string>emptyMap(),
  Collections.<locale, string>emptyMap(),
  LayoutConstants.TYPE_PORTLET, 
  false, 
  friendlyURL, 
  serviceContext
);</locale,></locale,></locale,></locale,></locale,>