Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
maryam maryam masoudy
how to configure simple portlet for this portlet support 2 languages ?
March 10, 2012 10:51 PM
Answer

maryam maryam masoudy

Rank: Regular Member

Posts: 149

Join Date: October 30, 2011

Recent Posts

hi
how to configure simple portlet for this portlet support 2 languages ?
Hitoshi Ozawa
RE: how to configure simple portlet for this portlet support 2 languages ?
March 11, 2012 4:23 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

how to configure simple portlet for this portlet support 2 languages ?


Which portlet?

If you're trying to internationalize your own portlet, following page may help you.
http://www.liferay.com/web/mahipal/blog/-/blogs/how-to-do-internationalization-i18n-and-localization-l10n-in-liferay
maryam maryam masoudy
RE: how to configure simple portlet for this portlet support 2 languages ?
March 11, 2012 5:14 AM
Answer

maryam maryam masoudy

Rank: Regular Member

Posts: 149

Join Date: October 30, 2011

Recent Posts

thanks Hitoshi
but this link is not safe and useful
yes i want if my languegs of liferay is en all text in my own portlet shows english languegs or if my languegs of liferay is fr all test shows France
Javier Lora Peribáñez
RE: how to configure simple portlet for this portlet support 2 languages ?
March 11, 2012 11:41 AM
Answer

Javier Lora Peribáñez

Rank: New Member

Posts: 6

Join Date: January 27, 2010

Recent Posts

Hello,
if you want to internationalize your portlet. Set up your portlet.xml by adding;
<supported-locale> fr </ supported-locale>
<resource-bundle> content.Language </ resource-bundle>.
In the jsp uses "<liferay -ui:message key='label' />" and in your classes java
ResourceBundle rb = ResourceBundle.getBundle("content.Language", request.getLocale());
rb.getString ("label").

Javier Lora Peribáñez.
B2B2000
maryam maryam masoudy
RE: how to configure simple portlet for this portlet support 2 languages ?
March 11, 2012 10:16 PM
Answer

maryam maryam masoudy

Rank: Regular Member

Posts: 149

Join Date: October 30, 2011

Recent Posts

thanks Javier ur guide was very goood
maryam maryam masoudy
RE: how to configure simple portlet for this portlet support 2 languages ?
March 14, 2012 1:41 AM
Answer

maryam maryam masoudy

Rank: Regular Member

Posts: 149

Join Date: October 30, 2011

Recent Posts

hi Javier
i configure portlet.xml
and add language file into web-inf
but i can not sucessfull and my portlet donot deploy
in my consul shows this message:
invalid content was found starting with element `support-local`......
why? what do i do?

must i use special lib?
or do i use other file ?

name of file languge: Language-ext_fa_IR.properties , Language-ext_fr_FA.properties , Language-ext.properties



portlet.xml:
 1<?xml version="1.0"?>
 2
 3<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
 4             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 5             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd">
 6    <portlet>
 7        <portlet-name>1</portlet-name>
 8        <display-name>Sample DAO</display-name>
 9        <portlet-class>com.liferay.sampledao.portlet.DAOPortlet</portlet-class>
10        <expiration-cache>0</expiration-cache>
11        <supports>
12            <mime-type>text/html</mime-type>
13        </supports>
14
15        <portlet-info>
16            <title>Sample DAO</title>
17            <short-title>Sample DAO</short-title>
18            <keywords>Sample DAO</keywords>
19        </portlet-info>
20        <security-role-ref>
21            <role-name>administrator</role-name>
22        </security-role-ref>
23        <security-role-ref>
24            <role-name>guest</role-name>
25        </security-role-ref>
26        <security-role-ref>
27            <role-name>power-user</role-name>
28        </security-role-ref>
29        <security-role-ref>
30            <role-name>user</role-name>
31        </security-role-ref>
32[b]   [color=#f90505]    <supported-locale>fr_FR</supported-locale>
33        <supported-locale>fa_IR</supported-locale>
34        <resource-bundle>content.Language-ext</resource-bundle>[/color][/b]
35    </portlet>
36</portlet-app>
Mani kandan
RE: how to configure simple portlet for this portlet support 2 languages ?
March 14, 2012 1:54 AM
Answer

Mani kandan

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Here your answer...
Attachments: palmtree-language-sample-portlet-6.0.1.war (16.0k)
maryam maryam masoudy
RE: how to configure simple portlet for this portlet support 2 languages ?
March 14, 2012 2:44 AM
Answer

maryam maryam masoudy

Rank: Regular Member

Posts: 149

Join Date: October 30, 2011

Recent Posts

Mani
this portlet donot deploy i work with liferay 5 is this important?
Mani kandan
RE: how to configure simple portlet for this portlet support 2 languages ?
March 14, 2012 3:29 AM
Answer

Mani kandan

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

In that war file you can change the version from 6.0.0 to 5.0.0 of these files liferay-display.xml, liferay-hook.xml, liferay-portlet.xml
maryam maryam masoudy
RE: how to configure simple portlet for this portlet support 2 languages ?
March 14, 2012 5:13 AM
Answer

maryam maryam masoudy

Rank: Regular Member

Posts: 149

Join Date: October 30, 2011

Recent Posts

hi
i successful finally
thanks a lot all
emoticon emoticon
thanks Mani thanks ur help was userful emoticonemoticon
Mani kandan
RE: how to configure simple portlet for this portlet support 2 languages ?
March 18, 2012 9:37 PM
Answer

Mani kandan

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Great to hear got it workemoticon