Foren

How to translate whole portlet content by language customization

thumbnail
Juhi Kumari, geändert vor 12 Jahren.

How to translate whole portlet content by language customization

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi
According to requirement I have to display my website only in two languages, English and Arabic.
For this I customize the language_ar.properties file using hooks in liferay606.
But when I select the Arabic language then body content is not getting translated into Arabic.
I have to display everything in arabic.
If any idea plz help!

Regards
Juhi
J Singh, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

New Member Beiträge: 10 Beitrittsdatum: 05.12.11 Neueste Beiträge
By body content you means what user is writing on portal ?

With Language.properties we customize the text which is shown standard by liferay for example , Button text , Success message to user
thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Its not translating the Buttons caption also.
How to add new variables in Language_ar.properties file to translate any text in Arabic.
Regards
Juhi
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
Are you talking about the web content portlet?

Have you created English and Arabic versions of the web content?
http://www.liferay.com/community/wiki/-/wiki/Main/Content+Localization

There may be some hardcoded messages left. Please attach a screen shot so we'll know exactly where it is.
thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi
Its a plugins portlet where I am adding a book in database.
With one label 'Add Book :' abd two buttons 'Submit' and 'Cancel'. Now I want that 'Add Book', 'Submit' and 'Cancel' should also display in arabic if I select Arabic language.
Hope you got the point.

Regards
Juhi
J Singh, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

New Member Beiträge: 10 Beitrittsdatum: 05.12.11 Neueste Beiträge
Following would be useful for you

Define language file
In portlet xml

<resource-bundle>content.Language</resource-bundle>

The file Language.properties in src folder (src/content/Language.properties) must be having english translations

e.g

book=Book
book-saved-successfully=Book Saved Successfully
bookDeleted=The Book has been deleted


Translating messages to multiple languages

Import following tag in ant build file after import

<target name="build-lang">
<antcall target="build-lang-cmd">
<param name="lang.dir" value="docroot/WEB-INF/src/content" />
<param name="lang.file" value="Language" />
</antcall>
</target>

Save the file and run

ant build-lang
thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
J Singh:
Following would be useful for you

Define language file
In portlet xml

<resource-bundle>content.Language</resource-bundle>

The file Language.properties in src folder (src/content/Language.properties) must be having english translations

e.g

book=Book
book-saved-successfully=Book Saved Successfully
bookDeleted=The Book has been deleted


Translating messages to multiple languages

Import following tag in ant build file after import

<target name="build-lang">
<antcall target="build-lang-cmd">
<param name="lang.dir" value="docroot/WEB-INF/src/content" />
<param name="lang.file" value="Language" />
</antcall>
</target>

Save the file and run

ant build-lang



No use. It didn't work for me
thumbnail
Juhi Kumari, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

Expert Beiträge: 347 Beitrittsdatum: 12.12.11 Neueste Beiträge
Hi
I got the answer. For translating all contents first I put that variable in Language_ar.properties file and then in jsp put this line
<%= LanguageUtil.format(pageContext, "submit", "Submit") %>.
Now it is working fine.

Regards
Juhi
Camilo Macias, geändert vor 12 Jahren.

RE: How to translate whole portlet content by language customization

New Member Beiträge: 2 Beitrittsdatum: 03.02.12 Neueste Beiträge
Hello everyone:

I'm a newbe using Liferay, and I'm having exactly this same problem.

I need to translate the web content we create for a "Web Content View" portlet.

But I don't understand what do I have to modify and how.

Can anyone helpe me?

Thanks in advance.