Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Benson Fung
Display different languge on navigation bar
April 28, 2013 2:19 AM
Answer

Benson Fung

Rank: New Member

Posts: 16

Join Date: October 8, 2008

Recent Posts

Hi,

If I would like to display different language(except English) on the navigation bar, where should I set it up?
Furthermore, I observed that if I change to another langauge, say Japanese, the 'Sign In' on the sign in link will be changed to Japanese characters. However, I can't find where these characters are in the entire liferay software repository.


Please help.


Thanks
Benson
Apoorva Prakash
RE: Display different languge on navigation bar
April 28, 2013 3:07 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hey Benson ,

Benson Fung:

If I would like to display different language(except English) on the navigation bar, where should I set it up?

You need to customize navigation.vm file of your theme.
Benson Fung:

Furthermore, I observed that if I change to another langauge, say Japanese, the 'Sign In' on the sign in link will be changed to Japanese characters. However, I can't find where these characters are in the entire liferay software repository.

See this for reference: Language property hook and language and TZ

HTH.

Thanks and REgards,
Apoorva Prakash
KK rajput
RE: Display different languge on navigation bar
April 29, 2013 12:12 AM
Answer

KK rajput

Rank: Expert

Posts: 266

Join Date: April 10, 2008

Recent Posts

Benson Fung:

However, I can't find where these characters are in the entire liferay software repository.


If you have portal source then you can find it under portal-impl/src/content. e.g for Japanese you will get a file with name Language_ja.properties.

HTH
Kamal
Benson Fung
RE: Display different languge on navigation bar
April 29, 2013 7:56 PM
Answer

Benson Fung

Rank: New Member

Posts: 16

Join Date: October 8, 2008

Recent Posts

Hi Prakash,

Thanks for your information. In terms of the navigation.vm, what I mean is suppose the page name on the navigation bar is 'Welcome'. However, if I change to another language from English, how can I configure the theme? I understand I need to create file,'content/Language_jp.propreties'(e.g. Japanese). I want to know where is the corresponding key name of Welcome in Language_en.properties? Actually, I can't find Language_en.properties in the default theme.

Do you understand what I mean?


Please help


Thank you very much
Benson
Apoorva Prakash
RE: Display different languge on navigation bar
April 29, 2013 9:22 PM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Benson Fung:
Hi Prakash,

Thanks for your information. In terms of the navigation.vm, what I mean is suppose the page name on the navigation bar is 'Welcome'. However, if I change to another language from English, how can I configure the theme? I understand I need to create file,'content/Language_jp.propreties'(e.g. Japanese). I want to know where is the corresponding key name of Welcome in Language_en.properties? Actually, I can't find Language_en.properties in the default theme.

Do you understand what I mean?

Please help

Thank you very much
Benson


Hello Benson,

By navigation.vm, i mean the file of theme form which the nav items are generated. You can see this file in templates folder of theme inside the server.

For changing languages in theme, you have to create a language hook, see this. It will let you use localized strings in velocity templates as under:

1$languageUtil.get($company_id, $locale, "property-name"))


HTH.

Thanks and Regards,
Apoorva Prakash
KK rajput
RE: Display different languge on navigation bar
April 29, 2013 10:50 PM
Answer

KK rajput

Rank: Expert

Posts: 266

Join Date: April 10, 2008

Recent Posts

Hi Benson,
I got ur doubt. See there are two level language.properties file at web component level and at portal level. Theme is applied mainly on portal level or at a particular space level. So as per my knowledge you need to create a hook to override existing keys or for adding new keys and value at portal level. You can check the link provided by Apoorva Prakash if you still have any doubt then feel free to ask.

HTH
Kamal
Benson Fung
RE: Display different languge on navigation bar
April 30, 2013 1:03 AM
Answer

Benson Fung

Rank: New Member

Posts: 16

Join Date: October 8, 2008

Recent Posts

Hi Prakash,

Thank you.

I going to create a hook and save it into [TOMCAT_FOLDER]/webapps/ROOT/WEB-INF/liferay-hook.xml. And then I would like to create Language_zh.properties at [TOMCAT_FOLDER]webapps/ROOT/WEB-INF/classes/content/Language_zh.properties.

However, what is the property name in the properties file? I have no clue about that. Right now, I created a page called Welcome via Site Pages of Control Panel. And would like to change the 'Welcome' to Chinese character once change language. Where is the property-name of 'Welcome' stored? Please advise


Thanks
Benson
Benson Fung
RE: Display different languge on navigation bar
April 30, 2013 1:05 AM
Answer

Benson Fung

Rank: New Member

Posts: 16

Join Date: October 8, 2008

Recent Posts

HI KK,

Where is the existing property key of the text on the navigation bar stored? Please advise.


Thanks
Benson
Apoorva Prakash
RE: Display different languge on navigation bar
April 30, 2013 1:18 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hey Benson,

Benson Fung:
Hi Prakash,

Thank you.

I going to create a hook and save it into [TOMCAT_FOLDER]/webapps/ROOT/WEB-INF/liferay-hook.xml. And then I would like to create Language_zh.properties at [TOMCAT_FOLDER]webapps/ROOT/WEB-INF/classes/content/Language_zh.properties.


I am sorry but the way you are doing it is wrong... See this for basic hook development approach...

Benson Fung:

However, what is the property name in the properties file? I have no clue about that. Right now, I created a page called Welcome via Site Pages of Control Panel. And would like to change the 'Welcome' to Chinese character once change language. Where is the property-name of 'Welcome' stored? Please advise


You need to download the Liferay portal source. You can see various language properties file in liferay-portal-src-6.1.1-ce-ga2\portal-impl\src\content.

HTH.

Thanks And Regards,
Apoorva Prakash
Vilmos Papp
RE: Display different languge on navigation bar
April 30, 2013 2:29 AM
Answer

Vilmos Papp

LIFERAY STAFF

Rank: Liferay Master

Posts: 521

Join Date: October 21, 2010

Recent Posts

Hi Benson,

Two things:

1.) If you want to localize your page's name/title you can do it from the UI (Manage > Page)
2.) You can find the relevant Language_[lang code].properties files from the portal source, or by extracting it from the portal-impl.jar file of your server

If you want to customize localization based on the 2.) option, you should go ahead and create a hook. You can find the steps in the Wiki how to do it.

Regards,
Vilmos
Benson Fung
RE: Display different languge on navigation bar
April 30, 2013 2:46 AM
Answer

Benson Fung

Rank: New Member

Posts: 16

Join Date: October 8, 2008

Recent Posts

Hi Vilmos,

Thanks for your answer. When I create a page via 'Site Pages' of control panel, it doesn't create Language_en.properties file in the ROOT/WEB-INF/classes/contentf/Language_en.properties. Do you know why?


Please help

Thanks
Benson
Vilmos Papp
RE: Display different languge on navigation bar
April 30, 2013 4:04 AM
Answer

Vilmos Papp

LIFERAY STAFF

Rank: Liferay Master

Posts: 521

Join Date: October 21, 2010

Recent Posts

Because the Language.properties are not for the contents you create. It is for the buttons, messages, etc. comes with the portal and portlets. For the Page localization you can do that when you edit the page itself.

Please read this documentation, there you will see where you can put your localization: http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/using-page-templat-1