simplified v traditional chinese characters

2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
We have a website supporting localization in multiple languages. Of course, we can switch the website to desired language by choosing it in language dropdown control. We had individual domains available for all of the languages of our website.
Example:
http://www.mywebsite.org (Main website, developed in Liferay5.2.2 and localized in bunch of languages).
Domains owned by us are,
http://www.mywebsite.fr (French)
http://www.mywebsite.es (Spanish)

Requirements:

1) The redirection from French domain to our website should open French version. Similarly, redirection from Spanish domain should directly open main website in Spanish version.
2) Is it possible to keep just language name and hide the Country name in language drop down?

I appreciate if someone could guide me accomplishing my requirements. If this is not possible, please suggest other alternatives.
thumbnail
4753419, modified 15 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Do you mean to select language page depending on http referrer?
Some user web browser may be set not to revel their referrer so it may be better to use modify Liferay's jsp code to redirect to language specific page using http header's Accept-Language.
Countries in the drop down list are in the "country" table in the database. You can use database table editor to edit their names.
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Hitoshi Ozawa:
Do you mean to select language page depending on http referrer?
Some user web browser may be set not to revel their referrer so it may be better to use modify Liferay's jsp code to redirect to language specific page using http header's Accept-Language.
Countries in the drop down list are in the "country" table in the database. You can use database table editor to edit their names.


Thank you for your response. Yes. Language specific page should be opened based on http referrer.
You mean to say, Liferay expects referrer to set language preference in http-header? Instead, does liferay provide a unique URL for each language listed in dropdown so that referrer can directly use it as redirection URL? (This is something like what Liferay does on their website, www.liferay.com).

If above is not possible, can I read http-header properties in custom theme and handle the requests accordingly? If cannot be done in theme, which jsp page in lifery code needs to be customized? Can you please point me to some code samples?
2235661, modified 15 Years ago. Liferay Master Posts: 894 Join Date: 2/18/09 Recent Posts
Hi Venkat,

as a quick solution to your requirement you can set the "doAsUserLanguageId" url parameter to the language in which you want to display the page.

HTH Oli
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Oliver Bayer:
Hi Venkat,

as a quick solution to your requirement you can set the "doAsUserLanguageId" url parameter to the language in which you want to display the page.

HTH Oli


Thank you Oliver.
Is it customization in Liferay code? Could you please elaborate more?
Thanks again.
2235661, modified 15 Years ago. Liferay Master Posts: 894 Join Date: 2/18/09 Recent Posts
Hi Venkat,

as you don't use Liferay v6 you can't use the i18n servlet which allows urls like "liferay.com/en/community" or "liferay.com/de/community". That's the reason why I've suggested you to use the url parameter "doAsUserLanguageId".

Example: http://localhost:8080/web/guest/home?doAsUserLanguageId=de_DE.

The drawback is that this parameter is appended to all links the user clicks. If you want the parameter to "disappear" you can modify the "ServicePreAction" class (override the method servicePre).

HTH Oli
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Thank you Oliver.

The solution you suggested also worked excellent. As you said, the query string is appended to every page. It is great that now we have two solutions available. Once again thank you for your help.
thumbnail
1339768, modified 15 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Make www.mywebsite.es redirect to www.mywebsite.org/es

See the example on liferay.com: The language you see the UI in (from the supported languages) is in the URL, e.g. for me this forum lives on www.liferay.com/de/community/forums
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Olaf Kock:
Make www.mywebsite.es redirect to www.mywebsite.org/es

See the example on liferay.com: The language you see the UI in (from the supported languages) is in the URL, e.g. for me this forum lives on www.liferay.com/de/community/forums


I am getting page not found error if I try http://www.mywebstie.org/es (or http://www.mywebstie.org/fr)
Each language on liferay's website has its own URL. Do anyone know how Liferay has implemented localization on their website (www.liferay.com)?
thumbnail
1339768, modified 15 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Can you go to www.mywebsite.com/fr/home or .../fr/web/guest/home ?
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Olaf Kock:
Can you go to www.mywebsite.com/fr/home or .../fr/web/guest/home ?


No Olaf. It didn't work either. As I said, we are using v5.2.2 with Tomcat6.x. Is it not supported by the version we are using?
thumbnail
4753419, modified 15 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
I think Olaf's solution would be the best if you can change the URL of the referring pages.
IF you look at the URL of this forum, you'll see they are different for each language.
e.g.
www.liferay.com/ja/

Please try adding the following settings in the portal-ext.properties

#
# Set this to true if unauthenticated users get their preferred language
# from the Accept-Language header. Set this to false if unauthenticated
# users get their preferred language from their company.
#
locale.default.request=true

#
# Set this to 0 if the locale is not automatically prepended to a URL. This
# means that each URL could potentially point to many different languages.
# For example, the URL http://localhost:8080/web/guest/home could then be
# viewed by users in many different languages.
#
# Set this to 1 if the locale is automatically prepended to a URL when the
# requested locale is not the default locale. This means that each URL
# points to just one language. For example, the URL
# http://localhost:8080/web/guest/home would point to the default language.
# The URL http://localhost:8080/zh/web/guest/home and
# http://localhost:8080/zh_CN/web/guest/home would both point to the Chinese
# language.
#
# In cases where the prepended locale is "zh" and not complete locale
# "zh_CN", then the full locale returned will be based on the order in which
# the locales appear in the property "locales". If "zh_CN" appears before
# "zh_TW", then "zh" will be a short hand for "zh_TW".
#
# The default language is set in system.properties with the properties
# "user.country" and "user.language".
#
# Set this to 2 if the locale is automatically prepended to every URL. This
# means that each URL points to just one language.
#
# Note that each language requires an entry in the property "locales" and a
# servlet mapping in web.xml for the I18n Servlet.
#
locale.prepend.friendly.url.style=1
thumbnail
1339768, modified 15 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Thanks for that clarification. My memory served me wrong - I thought that these settings have been on by default.

That said, it might even be enough to just get the language setting from the accept-header (see the properties mentioned) - after all this is the best guess on the personal preferences of the person browsing the site.

Also, I now remember a bug in an old version (might even be 5.2.2, you should update...) on pages that started with recognized language codes - e.g. a page named "demo" was mistaken as the signal to show the page in german ("de") but the actual page (mo) could not be found. Or similar...
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Thanks a lot to both you and Olaf for your valuable postings. But no luck yet.

I have set the two suggested properties in portal-ext.properties file. Apparently the second property "locale.prepend.friendly.url.style" is not supported (or unavailable) in v5.2.2. I confirmed it by looking at the available list at Control Panel -> Server Administrator -> Portal Properties tab. Is this a similar bug which Olaf talking about?

So, I still have the same issue and getting 'Page not found' error when tried following. I think language code (highlighted below) is treated as folder in 'Manage Pages' page tree.
http://www.mywebsite.org/fr/homepage or http://www.mywebsite.org/es/homepage

However, it worked when I appended following query string to the base URL
http://www.mywebsite.org/homepage?p_p_id=82&p_p_lifecycle=1&p_p_state=normal&p_p_mode=view&p_p_col_count=1&_82_struts_action=%2Flanguage%2Fview&languageId=fr_FR. I have yet to try if this works when used as redirection URL from www.mywebsite.fr. But, it would be nice if it works as in www.liferay.com website. Is there any alternate solution to make it work in v5.2.2?

Olaf,

Where should I read 'accept-language' header? How do I open language specific page after reading 'language' property from the headers? Thanks in advance for your help.
thumbnail
4753419, modified 15 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Sorry, I've been testing on Liferay 6.0.5 at home. The properties may not be supported in 5.2.2.
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Hitoshi Ozawa:
Sorry, I've been testing on Liferay 6.0.5 at home. The properties may not be supported in 5.2.2.


Not a problem Hitoshi. Your earlier solution has been very helpful and I can live with query string as mentioned in my previous post.

I have another follow up question relevant to same thread.

French page is opened via redirection URL from http://www.mywebsite.fr (which I have yet to test after I get access to that box). Now I see http://www.mywebsite.org/homepage in address bar with French content on page which is expected.

I am wondering if it is possible to mask the URL as http://www.mywebsite.fr/homepage to give a feeling to the user that the site is hosted on other domain (www.mywebsite.fr). Similarly, user should see http://www.mywebsite.es/homepage if got redirected from Spanish domain. Any ideas?
thumbnail
1339768, modified 15 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts
Of course - my recommendation is to have an apache in front of your appserver. Apache can handle the initial redirection (e.g. just on "/") and forward the rest to liferay (e.g. through mod_jk).

To be complete: In case you have different content - e.g. in communities or organizations, separated by language, you could utilize liferay virtualhosts, but from what I understand this is not an option for you.
2422165, modified 15 Years ago. Junior Member Posts: 49 Join Date: 3/9/09 Recent Posts
Thank you Olaf.

I will check with our admin regarding masking of URLs.

Yes. Virtual hosts is not an option for us as each one has to be mapped with either community or organization. In our case, we have single community but needs to be available on multiple (virtual) domains.

You and Hitoshi are phenomenal and once again thank you very much.
7763398, modified 15 Years ago. New Member Posts: 8 Join Date: 3/4/11 Recent Posts
We are having trouble getting simplified chinese (instead of traditional chinese) to appear in our navigation. I have checked the the portal-ext.properties file in liferay and found you had put the language override in there, that last line is:
locales=zh_CN,en_US

I have checked to be sure the browser settings were selected for simplified chinese ....but the characters continue to appear as traditional chinese.

Any ideas how we might fix this?

Thanks!
7577674, modified 15 Years ago. Regular Member Posts: 179 Join Date: 2/17/11 Recent Posts
Hi sperry ,

In my case i want to display english & chinese fonts on same Web Content.so that how
we can figure out for it.
locales=zh_CN,en_US change into portal-ext.properties file is work fine ??
if anyone know ?


Thanks in advanced
7763398, modified 15 Years ago. New Member Posts: 8 Join Date: 3/4/11 Recent Posts
We ended up figuring this out. It was an edit under the Manage Pages (when not in "your community") and then select 'localize language' and we had to edit the "name" of the page to reflect the correct Chinese characters.

We also setup the site to show both English and Chinese characters but we do this by logging in as admin and then on the content page click on 'edit web content', click on language, and then create the content in the language you need (our case chinese). Now, when the user has their browser setting on the 'chinese' the chinese version of the website appears.
thumbnail
4753419, modified 15 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
In my case i want to display english & chinese fonts on same Web Content.so that how


Liferay's setting is just for languages used in Liferay's menus and messages. You can just mix different languages inside a Web Content - just select the correct font for the language. As an example, I can mix Japanese (日本語) here with English.
7577674, modified 15 Years ago. Regular Member Posts: 179 Join Date: 2/17/11 Recent Posts
Thank for the reply !
thumbnail
4753419, modified 15 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Glad to be of help.