Liferay 6.2 languages switching - liferay

In my portal all authenticated users have as default language English. In pages' theme there is a language selector using $taglibLiferay.language("fm", null, "languageId", 3) which gets all languages that I have selected inside portal-ext.properties(locales=en_GB,fr_FR,de_DE).
All these languages are displayed normally in selector, but when a logged-in user tries to switch a language in selector, the selected option remains always the user's language. e.g. A user with English language cannot switch to French. Although, the language changes in selector, the page is reloaded in English with selector's option turned to English.
Does anyone has a workaround on this?
Note: The mappings in web.xml are correct.

Use this:
$taglibLiferay.language("fm", null, "_82_languageId", 3)
or
$theme.language("fm", null, "_82_languageId", 3)

Related

JSF change locale for a sub-section of a page

I need to display most of the page in the users selected locale but display a section of the page in another locale. Basically a some point in the .xhtml, I want to set a new local for that part of the page and then at a later point switch back to the users locale. I've tried the following hacks:
Nesting <f:view locale="subsectionlocale">
Resetting the session dynamically in a getter at the start of the section (I said it was a hack).
Neither of these do what I'm hoping (as might be expected). Any ideas on a proper solution or working hack?

Liferay - Translate

I am using Liferay 6.1.0 GA1.
I added Documents and Media portlet. When I change language in Add menu, it is still named Documents and Media display.
Where I can change that?
Edit: I have hook for translations I just don't know what to write to make it work.
As excepcted for rookie, problem was trivial.
In portlet.xml name wasn't documents-and-media. It was some number.
So then just javax.portlet.title.1= fixed it.
If You don't have a hook, look there -
https://www.liferay.com/community/wiki/-/wiki/Main/Portal+Hook+Plugins
https://www.liferay.com/community/forums/-/message_boards/message/5368654

Liferay - Adding Page

I am using Liferay 6.1.0 GA1.
When You go to Add -> Page there is a popup list which show you type of new site and it is ugly.
Where I can hide it? I want to remain only accept button.
Edit: I want to hide only if it is really hard to remove it.
you could use an custom theme on your page and use CSS to hide it.
You're mixing up a few terms. I'm assuming that you mean the list of page templates, e.g. when you create a new top level page, you see the page templates "Blog", "Forum" or similar (I can barely remember them from 6.1 times). These are PageTemplates. You can remove all PageTemplates (implying that you won't be able to use them any more) and they won't be offered any more.
Other than that I agree with dube - IMHO it's enough to just hide it with CSS. Only the administrator, who is able to create a new top level page (and when they create a new top level page) will see them anyway. So it's not the regular usecase and just hiding them in CSS does not impose any security issue.

Liferay Language switch issue

I am trying to implement multiple language support in my liferay Project. For this i added below code in portal_normal.vmfile of theme.
#set( $availLanguage = $stringUtil.split("hi_IN,en_US"))
<span id="language">$taglibLiferay.language("fm", null, "languageId", $toto, 0)</span>
which will add support for two language Hindi,English (United States).
and created hook for multiple language properties files.
<hook>
<language-properties>content/Language_hi.properties</language-properties>
<language-properties>content/Language_en.properties</language-properties>
</hook>
but whenever i switch my language its not changing.It always shows values from Language_en.properties file
so to check whats happening i tried printing below values in theme
$theme_display.getLanguageId()
$locale
but it always shows en_US even thought i changed language to hi_IN.
Looking for help to figure out whats going wrong.
Environment: Liferay 6.1.1 CE GA2
I think you need to add hi_IN language as Available Languages in Portal Settings if it is already not there.
To add this/or verify go to Control Panel --> Portal Settings --> Display Settings
here you will find a input box Available Languages which shows all available locales (comma seperated), make sure you have entry for hi_IN in this input box.

How to change the Language of portlet's title?

I am trying to change the language of portlet title, but didn't succeed!
I went through the various link from liferay's forum, but unable to achieve my task.
Example:1
Example:2
Details:
I am using following locales fr_FR and zh_CN,with the following values in the concerned properties file
javax.portlet.title.1_WAR_microblogsportlet=News
javax.portlet.title.1_WAR_microblogsportlet=nouvelles(for fr_FR)
javax.portlet.title.1_WAR_microblogsportlet=新聞(for zh_CN)
resource bundle is set in portlet.xml as given:
<portlet-name>1</portlet-name>
<display-name>Microblogs</display-name>
<portlet-class>com.liferay.microblogs.microblogs.portlet.MicroblogsPortlet</por‌​tlet-class>
<resource-bundle>content.Language</resource-bundle>
You just need to have property with key as "javax.portlet.title", no need to put your portlet ID as part of key.
Name the localized properties files and put property value as below.
Language.properties
javax.portlet.title=News
Language_fr.properties
javax.portlet.title=nouvelles
Language_zh.properties
javax.portlet.title=新聞
Then liferay displays portlet in corresponding language depending on user's locale.
You may test in one of below ways.
For User -
In current user profile -> Display Settings, Select language as French and then visit the page having your portlet. It should display title in french instead of english.
Change in URL
You may also specify locale in page URL as described in liferay 6.1 documentation
http://localhost:8080/fr/<your page url>
Using Language portlet
Add Language portlet on your page and clicking on French flag changes locale to french and the page should display portlet title in French.

Resources