Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
How to change language for custom portlet? Manikandan S 12 de Outubro de 2011 22:17
RE: How to change language for custom portlet? Hitoshi Ozawa 12 de Outubro de 2011 22:58
RE: How to change language for custom portlet? Manikandan S 12 de Outubro de 2011 23:46
RE: How to change language for custom portlet? Ravi Kumar Gupta 12 de Outubro de 2011 23:53
RE: How to change language for custom portlet? Mayur Patel 12 de Outubro de 2011 23:59
RE: How to change language for custom portlet? Manikandan S 13 de Outubro de 2011 00:10
RE: How to change language for custom portlet? Ravi Kumar Gupta 13 de Outubro de 2011 00:15
RE: How to change language for custom portlet? Manikandan S 13 de Outubro de 2011 02:47
RE: How to change language for custom portlet? Tejas Kanani 13 de Outubro de 2011 03:25
RE: How to change language for custom portlet? Manikandan S 13 de Outubro de 2011 04:40
RE: How to change language for custom portlet? Hitoshi Ozawa 13 de Outubro de 2011 04:51
RE: How to change language for custom portlet? Manikandan S 13 de Outubro de 2011 06:45
RE: How to change language for custom portlet? Ravi Kumar Gupta 13 de Outubro de 2011 07:13
RE: How to change language for custom portlet? Hitoshi Ozawa 14 de Outubro de 2011 04:20
RE: How to change language for custom portlet? Manikandan S 14 de Outubro de 2011 02:46
RE: How to change language for custom portlet? Hitoshi Ozawa 14 de Outubro de 2011 04:22
RE: document attachment feature Manikandan S 17 de Outubro de 2011 02:49
RE: How to change language for custom portlet? Manikandan S 17 de Outubro de 2011 03:33
RE: How to change language for custom portlet? Juhi Kumari 15 de Fevereiro de 2012 22:55
RE: How to change language for custom portlet? Manikandan S 16 de Fevereiro de 2012 00:44
RE: How to change language for custom portlet? Mazhar Alam 16 de Fevereiro de 2012 01:15
RE: How to change language for custom portlet? Manikandan S 16 de Fevereiro de 2012 01:22
RE: How to change language for custom portlet? Mazhar Alam 16 de Fevereiro de 2012 01:58
RE: How to change language for custom portlet? Manikandan S 16 de Fevereiro de 2012 02:35
RE: How to change language for custom portlet? Mazhar Alam 16 de Fevereiro de 2012 03:45
RE: How to change language for custom portlet? Manikandan S 16 de Fevereiro de 2012 04:13
RE: How to change language for custom portlet? Mazhar Alam 16 de Fevereiro de 2012 05:17
RE: How to change language for custom portlet? Manikandan S 16 de Fevereiro de 2012 20:34
RE: How to change language for custom portlet? Mazhar Alam 17 de Fevereiro de 2012 00:13
RE: How to change language for custom portlet? Manikandan S 15 de Fevereiro de 2012 21:17
RE: How to change language for custom portlet? Zeeshan Khan 24 de Abril de 2012 04:27
RE: How to change language for custom portlet? Zeeshan Khan 24 de Abril de 2012 05:41
Manikandan S
How to change language for custom portlet?
12 de Outubro de 2011 22:17
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Hi all,

I have created one custom portlet inside (D:\liferay-portal-6.0.6\tomcat-6.0.29\webapps\ROOT\html\portlet\book\view.jsp). It has the book details.

If I change the language using Language portlet I want to change the language for my custom portlet.

I want change language for arabic language.

My portlet has the following details,

 1
 2          <thead>
 3                 <tr>
 4                    <th style="text-align:center;">Book Name</th>
 5                     <th style="text-align:center;">Author Name</th>
 6                     <th style="text-align:center;">Category Name</th>
 7                 <th style="text-align:center;">SubCategory Name</th>
 8                     <th style="text-align:center;">Delete</th>
 9                      </tr>
10    </thead>


If I change language for this portlet to arabic, then details like Book Name, Author Name etc, should change to arabic language.

any help?
Hitoshi Ozawa
RE: How to change language for custom portlet?
12 de Outubro de 2011 22:58
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7949

Data de entrada: 23 de Março de 2010

Mensagens recentes

Are you having any difficulties with the default Liferay's I18N techniques using the language property files?
Manikandan S
RE: How to change language for custom portlet?
12 de Outubro de 2011 23:46
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

I dont have any idea about that.

I dont know how to do this.

Could you give me any best link to achieve this?
Ravi Kumar Gupta
RE: How to change language for custom portlet?
12 de Outubro de 2011 23:53
Resposta

Ravi Kumar Gupta

Ranking: Liferay Legend

Mensagens: 1303

Data de entrada: 23 de Junho de 2009

Mensagens recentes

Create a Language.properties, and other properties for the locale you want, for your portlet. And then in jsp use
<liferay-ui:message key="key-to-book-name" />
Now whenever whatever language you will select, it should be converted.
Mayur Patel
RE: How to change language for custom portlet?
12 de Outubro de 2011 23:59
Resposta

Mayur Patel

Ranking: Expert

Mensagens: 351

Data de entrada: 17 de Novembro de 2010

Mensagens recentes

its correct , Refer this link for more details
http://www.liferay.com/community/wiki/-/wiki/Main/Languagedisplay+customization
Manikandan S
RE: How to change language for custom portlet?
13 de Outubro de 2011 00:10
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

I tried but no luck. Here i have attached my war.

Pls correct me the error.
Anexos: language-portlet-6.0.1.war (13,1k)
Ravi Kumar Gupta
RE: How to change language for custom portlet?
13 de Outubro de 2011 00:15
Resposta

Ravi Kumar Gupta

Ranking: Liferay Legend

Mensagens: 1303

Data de entrada: 23 de Junho de 2009

Mensagens recentes

use <resource-bundle>content/Language</resource-bundle> in portlet.xml after <supports> </supports> tag

HTH
Manikandan S
RE: How to change language for custom portlet?
13 de Outubro de 2011 02:47
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Not getting output. could u see the war file once again pls.
Anexos: language-portlet-6.0.1.war (12,9k)
Tejas Kanani
RE: How to change language for custom portlet?
13 de Outubro de 2011 03:25
Resposta

Tejas Kanani

Ranking: Liferay Master

Mensagens: 655

Data de entrada: 6 de Janeiro de 2009

Mensagens recentes

Hi,

I've checked your war, somehow Language properties files is not getting copied to classes folder.
All three properties files should be inside classes/content folder.

Somehow its not build properly.

Please use attached war. It should work.
Anexos: language-portlet-6.0.1.war (13,7k)
Manikandan S
RE: How to change language for custom portlet?
13 de Outubro de 2011 04:40
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Thanks Tejas,
Its a valuable reply.

But I got the final problem. I am getting undefined language format.

This is my jsp file,
 1
 2<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
 3<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
 4<portlet:defineObjects />
 5<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 6<liferay-ui:message key="category"/><br>
 7<liferay-ui:message key="authorname"/><br>
 8<liferay-ui:message key="bookname"/><br>
 9<liferay-ui:message key="key-to-book-name"/>


See the attachment file..
Anexo

Anexos: Untitled2.png (149,5k)
Hitoshi Ozawa
RE: How to change language for custom portlet?
13 de Outubro de 2011 04:51
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7949

Data de entrada: 23 de Março de 2010

Mensagens recentes

Try inserting below in your jsp.

<%@ page contentType="text/html;charset=UTF-8" %>
Manikandan S
RE: How to change language for custom portlet?
13 de Outubro de 2011 06:45
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

I included
<%@ page contentType="text/html;charset=UTF-8" %>
but no luck.

could you pls check my war file.
Anexos: language-portlet-6.0.1.war (13,4k)
Ravi Kumar Gupta
RE: How to change language for custom portlet?
13 de Outubro de 2011 07:13
Resposta

Ravi Kumar Gupta

Ranking: Liferay Legend

Mensagens: 1303

Data de entrada: 23 de Junho de 2009

Mensagens recentes

i guess you need to change the language.properties file for arabic properly.

Change it using native2ascii command.
Hitoshi Ozawa
RE: How to change language for custom portlet?
14 de Outubro de 2011 04:20
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7949

Data de entrada: 23 de Março de 2010

Mensagens recentes

Follow Ravi's advice on converting your properties file to ascii. You'll have to modify Liferay otherwise.
Anexo

Anexos: arabic.png (3,1k)
Manikandan S
RE: How to change language for custom portlet?
14 de Outubro de 2011 02:46
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

I tried my best but i cant do it. Could anyone of you correct my war file and attach it here pls?
Hitoshi Ozawa
RE: How to change language for custom portlet?
14 de Outubro de 2011 04:22
Resposta

Hitoshi Ozawa

Ranking: Liferay Legend

Mensagens: 7949

Data de entrada: 23 de Março de 2010

Mensagens recentes

Are you restarting your server after native2ascii your ar_SA properties file? Stop Liferay, delete the temp directory, delete the Language portlet, start Liferay,
deploy Language portlet.
Manikandan S
RE: document attachment feature
17 de Outubro de 2011 02:49
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

You can get here.

Could you create new thread for new post. Already some discussions are going on. Create new one here
Manikandan S
RE: How to change language for custom portlet?
17 de Outubro de 2011 03:33
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Still I am not able to get the solution. May be I couldn't the native2ascii command properly.

Could you pls how to do native2ascii command?

Pls correct my war file.
Anexo

Anexos: Untitledaa.png (8,1k), language-portlet-6.0.1.war (472,5k)
Manikandan S
RE: How to change language for custom portlet?
15 de Fevereiro de 2012 21:17
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Any help?
Juhi Kumari
RE: How to change language for custom portlet?
15 de Fevereiro de 2012 22:55
Resposta

Juhi Kumari

Ranking: Expert

Mensagens: 347

Data de entrada: 12 de Dezembro de 2011

Mensagens recentes

Hi Mani,
You can use this command from command line
1native2ascii -encoding utf8 source-file target-file
.
Use your native file as source.

Regards
Juhi
Manikandan S
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 00:44
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Hmm well thanks Juhi,

There is no place of native2ascii command. I followed the steps in Liferay_User_Interface_Development book(page no.102).

And got the solution
Mazhar Alam
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 01:15
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Hi mani,

Did you resolved your problem.If yes then do tell me wat u did to resolve it.coz i too have the same problem..

Thanks in advance
Manikandan S
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 01:22
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Follow this steps properly,

 1
 21. Open Liferay Plugins SDK console.
 32. Navigate (cd) to portlets folder.
 43. Run the following command to create a sample portlet skeleton:
 5create palmtree-language-sample "Palm-Tree Multiple Language sample portlet"
 64. Navigate (cd) to ${liferay.plugins.sdk}\portlets\palmtree-language-sample-portlet\docroot\WEB-INF folder.
 75. Create a file named liferay-hook.xml to support both English and
 8Brazil Portuguese
 9<?xml version="1.0" encoding="UTF-8"?>
10<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">
11<hook>
12<language-properties>content/Language_en_US.properties</language-properties>
13<language-properties>content/Language_pt_BR.properties</language-properties>
14</hook>
156. Navigate (cd) to ${liferay.plugins.sdk}\portlets\palmtree-language-sample-portlet\docroot\WEB-INF folder.
167. Run the following command:
17mkdir src\content
188. Navigate (cd) to ${liferay.plugins.sdk}\portlets\palmtree-language-sample-portlet\docroot\WEB-INF\src\content folder.
199. Create three language properties files named Language.properties, Language_en_US.properties, and Language_pt_BR.properties.
2010. Open Language.properties file and add the following line:
21palmtree-language-sample-display-text=This is a sample display text in default English
2211. Open Language_en_US.properties file and add the following line:
23palmtree-language-sample-display-text=This is a sample display text in English
2412. Open Language_pt_BR.properties file and add the following line. Please note that the Portuguese text below is from Google Translator.
25palmtree-language-sample-display-text=Este é um texto de exibição de amostra em Português
2613. Open ${liferay.plugins.sdk}\portlets\palmtree-language-sample-portlet\docroot\view.jsp and add the following lines:
27<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
28<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
29<portlet:defineObjects />
30This is the <b>Palm Tree Multiple Language sample portlets</b> portlet.
31<br><br>
32<liferay-ui:message key="palmtree-language-sample-display-text" />
3314. Navigate (cd) to ${liferay.plugins.sdk}\portlets\palmtree-language-sample-portlet folder.
3415. Run command "ant" to build and package the portlet WAR file.
3516. Copy the generated palmtree-language-sample-portlet-<version>.war file from ${liferay.plugins.sdk}\dist folder to your Liferay Portal deploy folder.
3617. Start your Liferay Portal server.
3718. Log in as the Portal Administrator and add the above portlet to your page
Mazhar Alam
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 01:58
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Hi mani,

I followed your steps and was able to view in the desired language.Thanks..
But when i included -Language_ar_SA in my content and then successfully deployed it after that i checked in my page it's not displaying the correct characters..rather it's displaying some boxes..

regards,
Mazhar
Manikandan S
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 02:35
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Try this in your jsp file,
1<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>

or
Its better to attach here your war file?
Mazhar Alam
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 03:45
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Hi mani,

here is the attached war file.
Anexos: samplei18-portlet.war (15,2k)
Manikandan S
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 04:13
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Here I have attached the working war file take it.
Anexo

Anexos: Untitled2.png (5,0k), palmtree-language-sample-portlet-6.0.1.war (16,0k)
Mazhar Alam
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 05:17
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Thanks Mani for your help..

Could you please tell me what changes u' ve made in my war to get the proper output.

regards,
mazhar
Manikandan S
RE: How to change language for custom portlet?
16 de Fevereiro de 2012 20:34
Resposta

Manikandan S

Ranking: Expert

Mensagens: 492

Data de entrada: 15 de Setembro de 2010

Mensagens recentes

Just in replaced the language properties files from liferay source.

It might had some UTF-8 file problem
Mazhar Alam
RE: How to change language for custom portlet?
17 de Fevereiro de 2012 00:13
Resposta

Mazhar Alam

Ranking: Regular Member

Mensagens: 201

Data de entrada: 25 de Novembro de 2011

Mensagens recentes

Hi mani,

Didn't get you,could you please explain more.

Regards
Zeeshan Khan
RE: How to change language for custom portlet?
24 de Abril de 2012 04:27
Resposta

Zeeshan Khan

Ranking: Expert

Mensagens: 349

Data de entrada: 20 de Julho de 2011

Mensagens recentes

Hi Mani !
I am trying to show Hindi Language....its not working in my custom portlet....i am using LR 6.0.6 with tomcat bundle...
Zeeshan Khan
RE: How to change language for custom portlet?
24 de Abril de 2012 05:41
Resposta

Zeeshan Khan

Ranking: Expert

Mensagens: 349

Data de entrada: 20 de Julho de 2011

Mensagens recentes

only key message is appearing not its value...... emoticon