« Back

New language support in Liferay DXP

About this Blog :

If your portal needs a language which is not given out of the box in Liferay DXP then you can add new one or more based on your needs. You can follow below content which gives you a way to add a language which is not given out of the box in Liferay DXP e.g. Gujarati.

Adding new language to Liferay :

  • To add a new language in Liferay, it requires a servlet mapping entry in web.xml (which resides in “LIFERAY HOME\tomcat\webapps\ROOT\WEB-INF” directory ) and a locale entry in portal-ext.properties.
  • For desired language, we can make servlet mapping entry directly in web.xml or use ext plugin which will add servlet mapping.

    Here, we have used ext plugin to add servlet mapping entry.

Please note that "Ext plugins are deprecated for Liferay Portal CE 7.0 and should only be used if absolutely necessary."

  • As we are modifying Liferay Portal’s web.xml file, it's necessary to use Ext plugin.

>> gujarati-language-support-ext\docroot\WEB-INF\ext-web\docroot\WEB-INF\web.xml<<

	<servlet-name>I18n Servlet</servlet-name>

>> gujarati-language-support-ext/docroot/WEB-INF/ext-impl/src/main/resource/content/Language_gu.properties <<

  • Deploy the ext plugin.

Once servlet mapping entry is configured, required locale entries needs to be configured as well.

  • We can specify required locale entries in portal-ext.properties using "locales" property.





Gujarati language uses "gu" language id. Refer to following link for more language ids : https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

  • After deploying the ext plugin and adding locale entries in portal-ext.properties, just restart Liferay and then the Gujarati language should appear in available locales.

  • To override the liferay's language keys, it requires module with class that extends ResourceBundle along with language key file.

	immediate = true,
	property = {
	service = ResourceBundle.class
public class extends ResourceBundle {
	public Enumeration<String> getKeys() {
		return _resourceBundle.getKeys();

	protected Object handleGetObject(String key) {
		return _resourceBundle.getObject(key);

	private final ResourceBundle _resourceBundle = ResourceBundle.getBundle(
		"content.Language", UTF8Control.INSTANCE);

  • Add the keys that you need to modify in Language.properties and deploy the module.

No comments yet. Be the first.

Get In Touch

Contact Us


Get in touch

Headquarter : 302, Landmark, Nr. Titanium City Center, Prahlad Nagar Road, Ahmedabad, India - 380015.

Showing 1 - 5 of 20 results.
of 4
contact-us Request a callback