Foren

How to change "Language.properties" of a portlet

Luca kk, geändert vor 11 Jahren.

How to change "Language.properties" of a portlet

Expert Beiträge: 284 Beitrittsdatum: 07.12.10 Neueste Beiträge
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
Apoorva Prakash, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 658 Beitrittsdatum: 15.06.10 Neueste Beiträge
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
Tejas Kanani, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
Have you specified any particular locale (<supported-locale>) in portlet.xml ?
Luca kk, geändert vor 11 Jahren.

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

Expert Beiträge: 284 Beitrittsdatum: 07.12.10 Neueste Beiträge
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?
Luca kk, geändert vor 11 Jahren.

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

Expert Beiträge: 284 Beitrittsdatum: 07.12.10 Neueste Beiträge
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
Apoorva Prakash, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 658 Beitrittsdatum: 15.06.10 Neueste Beiträge
Yea Luca, you can... Use the link that I've provided you in my previous post... Its very clear.

Thanks,
Apoorva Prakash
Luca kk, geändert vor 11 Jahren.

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

Expert Beiträge: 284 Beitrittsdatum: 07.12.10 Neueste Beiträge
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
Apoorva Prakash, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 658 Beitrittsdatum: 15.06.10 Neueste Beiträge
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
Luca kk, geändert vor 11 Jahren.

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

Expert Beiträge: 284 Beitrittsdatum: 07.12.10 Neueste Beiträge
Ok Apoorva,
now it's more clear.
But, how do I link the hook with accessibility portlet above said?
Luca kk, geändert vor 11 Jahren.

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

Expert Beiträge: 284 Beitrittsdatum: 07.12.10 Neueste Beiträge
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
Tejas Kanani, geändert vor 11 Jahren.

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

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
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
Hitoshi Ozawa, geändert vor 11 Jahren.

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

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
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.
richard naoufal, geändert vor 10 Jahren.

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

Junior Member Beiträge: 34 Beitrittsdatum: 04.04.13 Neueste Beiträge
Hello,

How to change the language in one portlet ?

Thank you !
thumbnail
Maheswar Sahu, geändert vor 8 Jahren.

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

New Member Beiträge: 6 Beitrittsdatum: 29.04.13 Neueste Beiträge
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.