Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Friends Team
How to implemente Language Internationalization in liferay 6.1
June 10, 2013 10:44 PM

Friends Team

Rank: Junior Member

Posts: 97

Join Date: September 3, 2012

Recent Posts

How to implemente Language Internationalization in liferay 6.1 ?
Bart Simpson
RE: How to implemente Internationalization in liferay 6.1
June 10, 2013 2:50 AM

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

What do you mean by "Internationalization in liferay 6.1" ? language ? or what?
If you are asking for custom portlets languages, you can add language key-values and use <resource-bundle> in portlet.xml
Friends Team
RE: How to implemente Internationalization in liferay 6.1
June 10, 2013 10:42 PM

Friends Team

Rank: Junior Member

Posts: 97

Join Date: September 3, 2012

Recent Posts

yes Internationalization in Language.......
Amit Doshi
RE: How to implemente Language Internationalization in liferay 6.1
June 11, 2013 12:28 AM

Amit Doshi

Rank: Liferay Master

Posts: 549

Join Date: December 29, 2010

Recent Posts

Hi Friends,

Check the Language Portlet that Liferay provides in order to change the language for OOB portlets.

But If you want to change some of the translation that you think not compatible then with the help of hook. you can change the existing one.

And for the Custom portlets you can add the below lines in the portlet.xml

3        <supported-locale>es</supported-locale>
4        <resource-bundle>content.Language</resource-bundle>

And add your files like, in the src/main/resources/content folder.

Change the language using language portlet.

Your work will get done !!

Amit Doshi
asif aftab
RE: How to implemente Language Internationalization in liferay 6.1
December 22, 2013 6:23 AM

asif aftab

Rank: Junior Member

Posts: 95

Join Date: September 2, 2013

Recent Posts

Internationalization(i18n) in liferay 6.1
Complete working program

My project name is AUIproj.

In which labels or the data we want to translate then we have to write inside this file. Suppose in my AUIproj I just want to change the name of my labels and my title only so we have to follow these steps:
Step 1:
First create a folder inside docroot/WEB-INF/src by the name of content, inside content folder, create a file

Step 2:
copy this content to
javax.portlet.title=AUI Portlet
product-name=Product Name
product-serial=Product Serial

Step 3:
right click on project then build language lots of supported language files will create inside your content folder automatically and all files contain the same contents that present in your files.

Step 4:
Now we have to just write that specific labels name on that specific file and change the contents on that place.
Use google translator and paste them suppose for hindi I just wrote in hindi file like
product-name=उत्पाद नाम
product-serial=उत्पाद धारावाहिक
The name of hindi Language file is

In init.jsp I declared lots of taglib, lots of java classes by import statements.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<%@ taglib uri="" prefix="aui" %>
<%@ taglib uri="" prefix="liferay-portlet" %>
<%@ taglib uri="" prefix="liferay-security" %>
<%@ taglib uri="" prefix="liferay-theme" %>
<%@ taglib uri="" prefix="liferay-ui" %>
<%@ taglib uri="" prefix="liferay-util" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.Calendar" %>
<%@ page import="java.util.Collections" %>
<%@ page import="com.liferay.portal.kernel.util.HtmlUtil" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@ page import="com.liferay.portal.kernel.util.CalendarFactoryUtil" %>
<%@ page import="" %>
<%@ page import="" %>
<%@ page import="com.liferay.portal.kernel.exception.SystemException" %>
<%@ page import="com.liferay.portal.kernel.util.WebKeys" %>
<%@ page import="" %>
<%@ page import="com.liferay.portal.kernel.util.ListUtil" %>
<%@ page import="com.liferay.portal.service.permission.PortalPermissionUtil" %>
<%@ page import="com.liferay.portal.service.permission.PortletPermissionUtil" %>
<%@ page import="javax.portlet.PortletURL" %>
<liferay-theme:defineObjects />

In view.jsp just imported init.jsp
<%@ taglib uri="" prefix="portlet" %>
<%@ include file="init.jsp" %>
<portlet:defineObjects />

This is the <b>AUI Portlet</b> portlet in View mode.

<portlet:actionURL name="addProduct" var="addProductURL" />
<aui:form action="<%= addProductURL.toString() %>" method="post">
<aui:input name="productName" />
<aui:input name="productSerial" />
<aui:button type="submit" />

<?xml version="1.0"?>
<!DOCTYPE project>

<project name="AUIproj-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
<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" />
Paste this line just in portlet.xml just after <supports> tag

Finally at first time build language and if you change any data on properties files then build language else no need to build language again and again. But some time it is showing some warnings like in future … file will modified so to again build language and this time the contents of hindi properties file will not change.
Finally go to control panel of liferay -> Test test -> my account -> miscellaneous-> display settings -> Language select hindi and you can see the the title and our labels will change into Hindi language. If you face any problem then please share with me
Thanks and regards
asif aftab