掲示板

How to change "Language.properties" of a portlet

11年前 に Luca kk によって更新されました。

How to change "Language.properties" of a portlet

Expert 投稿: 284 参加年月日: 10/12/07 最新の投稿
Hi all,
I try to change the "Language.properties" file in "WEB-INF/src/content"
of a portlet but I can't see the update when i restart tomcat (deleting work and temp directory).

Anybody knows why?
How can I do?

Thanks in advance.
thumbnail
11年前 に Apoorva Prakash によって更新されました。

RE: How to change "Language.properties" of a portlet

Liferay Master 投稿: 658 参加年月日: 10/06/15 最新の投稿
Hey Luca,

You need to create a hook for this purpose.

This link may help you in regard.

Hope this will help,

Thanks and Regards,
Apoorva Prakash
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: How to change "Language.properties" of a portlet

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
Have you specified any particular locale (<supported-locale>) in portlet.xml ?
11年前 に Luca kk によって更新されました。

RE: How to change "Language.properties" of a portlet

Expert 投稿: 284 参加年月日: 10/12/07 最新の投稿
I explain better.
In accessibility portlet, with default language EN, i have "Language.properties" file:

##
##	Portlet Infos
##
javax.portlet.title=Accessibility
javax.portlet.short-title=Accessibility
javax.portlet.keywords=This portlet provides theme display personalization for unauthenticated users.

##
##	Portlet Accessibility
##

accessibility.portlet-title=Accessibility settings

accessibility.back-to-normal=Back to normal
accessibility.background-color=Background color
accessibility.choose-a-color=Choose a color :
accessibility.field.navigation-under-content=Set navigation under content
accessibility.font-color=Font color
accessibility.font-size=Font size
accessibility.more-colors=More colors...
accessibility.preview=Preview
accessibility.selectable-color-is-x=This color is rgb-coded as: {0}

help.please-enter-comma-separated-portletids=Please enter a comma-separated list of portlet ids
help.please-enter-comma-separated-templateids=Please enter a comma-separated list of web content template ids
help.please-enter-comma-separated-webcontentids=Please enter a comma-separated list of web content ids

portlets-to-filter=Portlets to filter
web-content-templates-to-filter=Web content templates to filter
web-contents-to-filter=Web contents to filter


and Language_en_US.properties file:

##
##	Portlet Infos
##
javax.portlet.title=Accessibility
javax.portlet.short-title=Accessibility
javax.portlet.keywords=This portlet provides theme display personalization for unauthenticated users.

##
##	Portlet Accessibility
##

accessibility.portlet-title=Accessibility settings

accessibility.back-to-normal=Back to normal
accessibility.background-color=Background color
accessibility.choose-a-color=Choose a color :
accessibility.field.navigation-under-content=Set navigation under content
accessibility.font-color=Font color
accessibility.font-size=Font size
accessibility.more-colors=More colors...
accessibility.preview=Preview
accessibility.selectable-color-is-x=This color is rgb-coded as: {0}

help.please-enter-comma-separated-portletids=Please enter a comma-separated list of portlet ids
help.please-enter-comma-separated-templateids=Please enter a comma-separated list of web content template ids
help.please-enter-comma-separated-webcontentids=Please enter a comma-separated list of web content ids

portlets-to-filter=Portlets to filter
web-content-templates-to-filter=Web content templates to filter
web-contents-to-filter=Web contents to filter


I want to change the strings fron english to italian, for example:

accessibility.portlet-title=[b]Impostazione di accessibilità[/b]
accessibility.background-color=[b]Colore di sfondo[/b]
.....etc


How have I do?
11年前 に Luca kk によって更新されました。

RE: How to change "Language.properties" of a portlet

Expert 投稿: 284 参加年月日: 10/12/07 最新の投稿
Hi Apporva,
thanks for reply.
I never did a hook before but can I do a hook to only change
a properties file?

if yes, how?

Luca
thumbnail
11年前 に Apoorva Prakash によって更新されました。

RE: How to change "Language.properties" of a portlet

Liferay Master 投稿: 658 参加年月日: 10/06/15 最新の投稿
Yea Luca, you can... Use the link that I've provided you in my previous post... Its very clear.

Thanks,
Apoorva Prakash
11年前 に Luca kk によって更新されました。

RE: How to change "Language.properties" of a portlet

Expert 投稿: 284 参加年月日: 10/12/07 最新の投稿
Hi Apporva,
I read your link but it isn't so clear.
Do I have to create an XML file?
And then, where do I have to put this file?
I develop with netbeans.

Thanks
thumbnail
11年前 に Apoorva Prakash によって更新されました。

RE: How to change "Language.properties" of a portlet

Liferay Master 投稿: 658 参加年月日: 10/06/15 最新の投稿
Luca,

First of all, you have to create a new hook, and then you'll get XML file inside it. Make the necessary entry in it, and place the properties file in correct location.

Further, deploy it, and now you are done. Use the property. That's all.

Thanks and Regards,
Apoorva Prakash
11年前 に Luca kk によって更新されました。

RE: How to change "Language.properties" of a portlet

Expert 投稿: 284 参加年月日: 10/12/07 最新の投稿
Ok Apoorva,
now it's more clear.
But, how do I link the hook with accessibility portlet above said?
11年前 に Luca kk によって更新されました。

RE: How to change "Language.properties" of a portlet

Expert 投稿: 284 参加年月日: 10/12/07 最新の投稿
In the "WEB-INF" directory of accessibility portlet there is a
"liferay-hook.xml" contains:

<!--?xml version="1.0" encoding="UTF-8"?-->


-<hook> <portal-properties>portal.properties</portal-properties> </hook>


Do I have to create a <language-properties> element in this file?
thumbnail
11年前 に Tejas Kanani によって更新されました。

RE: How to change "Language.properties" of a portlet

Liferay Master 投稿: 654 参加年月日: 09/01/06 最新の投稿
For overriding language properties file using hook you'll have to add below lines in xml file with the Language file needs to overridden.
i.e.
<language-properties>content/Language_es.properties</language-properties>


For more details,
http://www.liferay.com/documentation/liferay-portal/6.1/development/-/ai/overriding-a-%3Cem%3Elanguage-properties%3C-em%3E-fi-1

Regards,
Tejas
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: How to change "Language.properties" of a portlet

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Before going any further, are you trying to change messages in YOUR portlet or messages in liferay?
If it's your portlet, you don't need to create a hook.
10年前 に richard naoufal によって更新されました。

RE: How to change "Language.properties" of a portlet

Junior Member 投稿: 34 参加年月日: 13/04/04 最新の投稿
Hello,

How to change the language in one portlet ?

Thank you !
thumbnail
8年前 に Maheswar Sahu によって更新されました。

RE: How to change "Language.properties" of a portlet

New Member 投稿: 6 参加年月日: 13/04/29 最新の投稿
Hi,

Can you please suggest how to create language property file for module wise,
suppose there are 3 modules in the project than property file may like

Language_en_module1.properties
Language_en_module2.properties
Language_en_module3.properties

Language_es_module1.properties
Language_es_module2.properties
Language_es_module3.properties

So i can pass the local variable with module name and the property key to get value.