Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
major major
Set a locale for a page
January 24, 2013 2:59 AM
Answer

major major

Rank: New Member

Posts: 13

Join Date: November 1, 2012

Recent Posts

The question refers to Liferay 6.06:
I need to create the following: page A in certain locale and page B in other locale
A link in page A leads to page B.
What should I configure in order 2 define locale for a page, including LTR \ RTL etc
Thanksemoticon
Amit Doshi
RE: Set a locale for a page
January 24, 2013 5:14 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 543

Join Date: December 29, 2010

Recent Posts

major major:
The question refers to Liferay 6.06:
I need to create the following: page A in certain locale and page B in other locale
A link in page A leads to page B.
What should I configure in order 2 define locale for a page, including LTR \ RTL etc
Thanksemoticon


I don't think it is possible.
Because we can either store the locale User specific or we can achieve it by creating different sites like for japanese language we can create Japense site and Japenese content inside it or for Hindi we can create Hindi Site and Hindi content inside it.

Thanks & Regards,
Amit Doshi
major major
RE: Set a locale for a page
February 18, 2013 5:28 AM
Answer

major major

Rank: New Member

Posts: 13

Join Date: November 1, 2012

Recent Posts

You can put this in portal_normal.vm and the locale will be changed:
#set ($locale=$localeUtil.fromLanguageId("en_US"))
#set ($abc=$themeDisplay.setLocale($locale))
Hitoshi Ozawa
RE: Set a locale for a page
February 18, 2013 3:05 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

If you have language code included in the url, why not just use the url with language code in the link to go to page B?
major major
RE: Set a locale for a page
February 19, 2013 1:13 AM
Answer

major major

Rank: New Member

Posts: 13

Join Date: November 1, 2012

Recent Posts

if you mean something like:
http://www.mysite.com/en/mypage
I must use http://mysite.com/english/mypage beacuse of SEO reasons.
major major
RE: Set a locale for a page
February 19, 2013 1:53 AM
Answer

major major

Rank: New Member

Posts: 13

Join Date: November 1, 2012

Recent Posts

Amit Doshi:

I don't think it is possible.
Because we can either store the locale User specific or we can achieve it by creating different sites like for japanese language we can create Japense site and Japenese content inside it or for Hindi we can create Hindi Site and Hindi content inside it.

Thanks & Regards,
Amit Doshi


I agree that a site for each language is the best solution.
But, I have a special case in which I should create one community(site) only, which has a few pages in 3 different languages.
These pages share a several of web contents which as result should have a translation for each language.
writing the following in portal-normal.vm result the web content to be displayed in the appropriate language:
#set ($locale=$localeUtil.fromLanguageId("en_US"))
#set ($abc=$themeDisplay.setLocale($locale))