In the previous tutorial Localization (l10n) in liferay we change the portlet content on the basis of locale.But what if we want to change the title of portlet.In this tutorial we localize title of portlet.We can achieve this by two ways:-
Put a key (ex-portlet_title) in your Language_xxx.properties file and get the key using default locale and than set in setTitle() method:-
Demo.java
First Method
Put a key (ex-portlet_title) in your Language_xxx.properties file and get the key using default locale and than set in setTitle() method:-
Demo.java
Second Method
This is pretty simple just put the key as javax.portlet.title and that's it. No need to do anything in Controller. Ex:-
javax.portlet.title = MyCustomTitleAgain
Output:-
Output:-
You can also check out the video for this:-
Hope this will Help....
You can Download Source code from Localize portlet title in Liferay.
Related Post:-
You can Download Source code from Localize portlet title in Liferay.
Related Post:-
No comments:
Post a Comment