Forum

Accueil » Liferay Portal » English » 3. Development

Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Nilesh Gundecha
Page Title Localization
18 mai 2011 03:47
Réponse

Nilesh Gundecha

Rang: Regular Member

Publications: 189

Date d'inscription: 30 novembre 2009

Publications Récentes

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 : -

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


Any help would be highly appreciated??

Thanks and Regards,
Nilesh.
Nilesh Gundecha
RE: Page Title Localization
23 mai 2011 23:58
Réponse

Nilesh Gundecha

Rang: Regular Member

Publications: 189

Date d'inscription: 30 novembre 2009

Publications Récentes

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.
Jelmer Kuperus
RE: Page Title Localization
30 mars 2013 05:21
Réponse

Jelmer Kuperus

Rang: Liferay Legend

Publications: 1190

Date d'inscription: 10 mars 2010

Publications Récentes

Something like this probably:

 1com.liferay.portal.model.Layout layout = LayoutLocalServiceUtil.addLayout(
 2  group.getCreatorUserId(),
 3  group.getGroupId(),
 4  privateLayout,
 5  LayoutConstants.DEFAULT_PARENT_LAYOUT_ID,
 6  new HashMap<Locale, String>() {{
 7            put(LocaleUtil.getDefault(), "Default name");
 8            put(new Locale("nl", "NL"), "Dutch name");
 9  }},
10  Collections.<Locale, String>emptyMap(),
11  Collections.<Locale, String>emptyMap(),
12  Collections.<Locale, String>emptyMap(),
13  Collections.<Locale, String>emptyMap(),
14  LayoutConstants.TYPE_PORTLET,
15  false,
16  friendlyURL,
17  serviceContext
18);