Foren

Drop down language flags in the navigation item

thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
HI All,
I am a liferay6.0 portal learner.
Our Present client requirement is put a drop down language flags,just like present in the http://www. liferay.com., just above the navigation item(not in dockbar) .
I used $theme.language() for putting the language portlet in the navigation menu.
But i cannot customize the language portlet into drop down language flag exactly present in the liferay.com.
Please help me.

Thanks in Advance.
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
You can google to get your answer to this one.

Example of page when I google is the one below but there's several more pages too on this topic.
http://www.liferay.com/community/forums/-/message_boards/message/2157430
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Hitoshi Ozawa:
You can google to get your answer to this one.

Example of page when I google is the one below but there's several more pages too on this topic.
http://www.liferay.com/community/forums/-/message_boards/message/2157430



Thank You Hitoshi Ozawa,

i changed the display style and add a line in portal-ext.properties
locales=ar_SA,en_US,en_GB. to come three flag in drop down manner.
But i canot make it like the drop down present in the lifray.com.I am trying.
Unfortunately i got another strange problem.when i changed the portalext.properties
to add a another flag.It does not change .it remains the same.Evenif i removed the
line from the portal-ext.properties it remains the same. it sounds strange but
it happens to me.
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
That's probably because you're accessing the cache. Go to Control Panel -> Server Administration -> Clear content cached across the cluster
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Thank You Hitoshi Ozawa,
I have clear content the cached across the cluster.But still It happens.
Is there any other reason do u think?
Please Keep in touch with me
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Hi all
Can you tell me how i customize the pages.jsp of language portlet like the language option of the liferay.com.
Please reply me quickly
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Can you got to Control Panel - Server Administration - Properties to see the value you've changed is being set as you've set them in portal-ext.properties?
thumbnail
Manali Lalaji, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Expert Beiträge: 362 Beitrittsdatum: 09.03.10 Neueste Beiträge
Hi Bikash,

If you want to customize page.jsp for language portlet, you need to create a language hook. In portal-ext.properties you have already added locales e.g
locales=en_US,es_ES,pt_PT.
You need to customize following code of page.jsp:
Locale[] locales = (Locale[])request.getAttribute("liferay-ui:language:locales");

And add following code to read from property file:
String getLocaleString = (String)PropsUtil.get(Locales); // Locales of property file
String getLanguage[] = getLocaleString.split(",");
Locale[] locales = new Locale[getLanguage.length];
for(int i=0;i<getLanguage.length;i++)
{
String localeData[] = getLanguage.split("_");
locales=new Locale(localeData[0],localeData[1]);
}
Also, you can include the code in theme to load language portlet:
$velocityPortletPreferences.setValue("portlet-setup-show-borders", "false")
$theme.runtime("82", "", $velocityPortletPreferences.toString())
$velocityPortletPreferences.reset()

HTH..

Regards,
Manali
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Hi Hitoshi Ozawa,
I have got to Control Panel - Server Administration - Properties .the value is same as portal-ext.properties .
Thank You
Bikash Ghibila
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Bikash Ghibila:
Hi Hitoshi Ozawa,
I have got to Control Panel - Server Administration - Properties .the value is same as portal-ext.properties .
Thank You
Bikash Ghibila



Hi,
I am to solve the problem of customizing the flag from display setting.
Can You tell me ,if i want to use the jquery for language portlet where hould i place the jquery.
Thank You
Bikash Ghibila
thumbnail
Mayur Patel, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Expert Beiträge: 358 Beitrittsdatum: 17.11.10 Neueste Beiträge
Hello All,

I implemented language-hook as manali speficied that in post but we have requirement like

we are having different language files for different client like abc n xyz n others...

so how can we make entry in liferat-hook.xml like this??...
content/abc/laguage_en_US.properties
content/xyz/laguage_en_US.properties

Do we have to make folder for those diff client
But How that Page.jsp will know which one it will call means How will it diffrentiate for abc n xyz ???..
after we will get values from portal-ext.properties en _US ...

Please give me idea on this...Appreciate your feedback on this..

Regards,
Mayur Patel
thumbnail
Kamesh Sampath, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Regular Member Beiträge: 158 Beitrittsdatum: 27.05.10 Neueste Beiträge
In your case you need to load the resource bundle manually using the <fmt>, personally i feel that you nee to separate common organization wide properties and organization specific properties , inside your page.jsp grab the handle to $themeDisplay, get the organization from it and now make a folder or file path using the content+"/"+themeDisplay.getOrgnization()+"/"+filename.properties.

Be sure to check for groupId or companyId fields from themeDisplay to get the organization. and the method i have mentioned in the above para is just a mock method meaning to say what you need to fetch.

Thjs ideally works for cases your have necessary organizations created e.g accenture, wipro etc.,

Not sure it answered your question completely, let me know if you want further discuss on this
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Hi All,
I have successfully implemented the language portlet with proper designing.But when i change the language to arbic only some portlet name ,sign in name and some
dockbar name changes.But no other translation possible like (page name,custom portlet name) remain as english.Any suggestion is appreciated.
Thanks in Advance
thumbnail
Raja Nagendra Kumar, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Expert Beiträge: 484 Beitrittsdatum: 02.03.06 Neueste Beiträge
>(page name,custom portlet name) remain as english

I understand all these are displaying the english versions based on what you have provided

Did you add the respective arabic values for all these, as per the details

http://www.liferay.com/community/wiki/-/wiki/Main/Languagedisplay+customization

Regards,
Nagendra
thumbnail
Bikash Ghibila, geändert vor 12 Jahren.

RE: Drop down language flags in the navigation item

Junior Member Beiträge: 60 Beitrittsdatum: 31.03.11 Neueste Beiträge
Raja Nagendra Kumar:
>(page name,custom portlet name) remain as english

I understand all these are displaying the english versions based on what you have provided

Did you add the respective arabic values for all these, as per the details

http://www.liferay.com/community/wiki/-/wiki/Main/Languagedisplay+customization

Regards,
Nagendra



Hi rajesh,
Thanks for your suggestion.
But i couldn't get the exact thing from this link.
Could u please elaborate?
Thank You
Bikash Chandra Ghibila