Saturday 8 October 2016

How to Override the Language Properties file in Liferay 7 DXP

How to Override the Language Properties file in Liferay 7 DXP?
In this tutorial we are going to see how we can Override and change the Language Properties in Liferay 7. In the previous tutorials we had seen how we can write a portlet filter and how we can use model listeners in liferay.
In this tutorial we are going to Override the Sign In text to Please Sign In
To Override and change the Language Properties in Liferay 7 follow the following steps -:
The Language.Properties file resides in the poratl-impl.jar and also it can be found at the following location in the source code liferay-portal/portal-impl/src/content/Language.properties


In the first step copy the Language.properties file from liferay portal source or the portal-impl.jar file and paste it into the src/main/resources/content of any custom module.


Something like this




Once done with this we will have to create a new Component class.
               @Component(property = {
                            "language.id=en_US"
                                   }, service = ResourceBundle.class)


This class should extend java.util.ResourceBundle.  The complete implementation of the class can be as follows.





Now update the Language.properties file.
sign-in=Please Sign In


BEFORE LANGUAGE.PROPERTIES UPDATE



AFTER LANGUAGE.PROPERTIES UPDATE






For more information on the above topic you can visit my youtube channel



 

Copyright @ 2016 LiferayRevisited.