Posts

Showing posts with the label i18n

UTF-8 encoding for Resource Bundle

Image
  Resource Bundle UTF-8 How to configure UTF-8 encoding for Resource Bundle Files in IDEA for Liferay Problem Sometimes you may see weird symbols in the User Interface, like these: This is usually caused by wrong character encoding, different from UTF-8. Solution If your labels are defined in the Resource Bundle (Language_XXX.properties files), which typically should be the case, you need to check the encoding configuration for properties files. Open the IDEA Settings and and navigate to Editor > File Encodings menu. Choose "UTF-8" for "Default encoding for properties files": Save the configuration, and redeploy module(s) with Resource Bundle. Now the labels from Resource Bundle properties files should display correctly. Enjoy 😏

Liferay 7: Global Resource Bundle

Image
   Global Resource Bundle for Liferay 7 Overview Liferay Resource Bundle is used for messages translation on the portal. Each module may have it’s own Resource Bundle. This article explains how to create a “global” one, with translations available for any other module, including the Liferay core modules. Implementation 1. Create a module with the following structure: 2. Define dependencies in build.grade : dependencies {     compileOnly group : "com.liferay.portal" , name : "com.liferay.portal.kernel"     compileOnly group : "com.liferay.portal" , name : "com.liferay.util.taglib"     compileOnly group : "javax.portlet" , name : "portlet-api"     compileOnly group : "javax.servlet" , name : "javax.servlet-api"     compileOnly group : "jstl" , name : "jstl"     compileOnly group : "org.osgi" , name : "osgi.cmpn" } 3. Create a bundle descriptor bnd.bdn : Bundle-Name : Li...