Adding A Language

Liferay currently supports about 50 languages out-of-the-box. Translation is complete for many of these languages and some are still in the translation process. Each language has its own language properties file containing keys for its language. But there are more than 6000 languages in the world. If you must add an additional language, here’s how.

Adding A New Language

By default, the file specifies all languages available in Liferay. To add a new language that is not specified,

  1. Take note of the ISO 639-1 standard code for your language (e.g. the ISO code for Amharic would be am).

  2. Take note of the ISO 3166-1 alpha-2 two-letter country code for your language. (e.g. the ISO code for Ethiopia would be ET).

  3. Modify and replace the web.xml file found in your Liferay installation: [LIFERAY_HOME]/tomcat<version>/webapps/ROOT/WEB-INF/. Add your new language under the <web-resource-name> section. For example,

  4. Modify and replace the shielded-container-web.xml file found in your Liferay installation: [LIFERAY_HOME]/tomcat<version>/webapps/ROOT/WEB-INF/. Add your new language under the <servlet-mapping> section. For example,

    	<servlet-name>I18n Servlet</servlet-name>
    	<servlet-name>I18n Servlet</servlet-name>
    	<servlet-name>I18n Servlet</servlet-name>
  5. Create your file for your language and use the ISO code in your file name. For example for Amharic:

    create-account=መለያ መፍጠር
    email-address=የ ኢሜል አድራሻ
    forgot-password=መክፈቻ ቁልፉን ረሳኽው
    home=መነሻ ገጽ
    powered-by-x=በ {0} የተጎላበተ
    search=የፍለጋ አሞሌ
    sign-in=ስግን እን
  6. Create a language module with the file you created and deploy the module to your Liferay installation. See Overriding Global Language Translations to see a sample project and specific instructions on creating this module.

  7. Create or modify your file in your installation’s Liferay Home folder. Note, this file overrides the enabled default locales defined in the file. Therefore list all the languages you plan to use in the file. Define both locales and locales.enabled. For example:

  8. Once the module is deployed, navigate to Control PanelInstance SettingsLocalization. Verify and move the new language to the current languages. Click Save.

    Save your new language to the list of current languages.

  9. Change your default language to the new language and click Save. The new language is now used by the Liferay instance.

    Select and use the new language for your Liferay instance.