Search code examples
liferayliferay-7liferay-theme

How to localize ADTs Liferay 7


We are using ADTs for our Liferay 7 project. The ADTs have to support at least two languages. We created our own portlet and I discovered that you can use <@liferay_ui["message"] key="…" />. However, that utilizes the global language file in Liferay.

My question is, how do I achieve looking into my portlet's language file? Do I have to use JSPs for that?


Solution

  • The most advisable thing is to create for example, a "core-hook" where you have all the available languages with their respective files and their translations. It is more organized than having languages at the portlet level.

    I've given you an example with gradle that in the end is the same using the technology you use

    Example: https://github.com/liferay/liferay-blade-samples/tree/master/gradle/overrides/resource-bundle-override

    ${languageUtil.get(locale, "add-blog-entry", "Add Blog")}