Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Nilesh Gundecha
Page Title Localization
18 maggio 2011 3.47
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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 maggio 2011 23.58
Risposta

Nilesh Gundecha

Punteggio: Regular Member

Messaggi: 196

Data di Iscrizione: 30 novembre 2009

Messaggi recenti

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 marzo 2013 5.21
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1192

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

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);