Thursday, July 05, 2012

Liferay Hook Advance 3

LIFERAY HOOKS

Advance-III

Hook to override language.properties
Liferay has more than 43 languages available.
Using Hook we can add new language messages or even can modify existing one.

Steps :

Modify liferay-hook.xml :

<hook>

<portal-properties>portal.properties

</portal-properties>

<language-properties>

content/Language_en.properties

</language-properties>

<language-properties>

content/Language_hi_IN.properties

</language-properties>

</hook>

Create folder within hooks\myfirsthook-hook\docroot\WEB-INF\src\content

Create file Language_en_US.properties and Language_hi_IN.properties .

Language_en.properties
what-is-your-lucky-number=What is ur Lucky Number ?
what-is-ur-girl-friend-name=What is ur girl friend Name?

Language_hi_IN.properties:
what-is-your-lucky-number=आपका पहला Lucky नंबर क्या था?
what-is-ur-girl-friend-name=आपके पहले girlfirnd का नाम क्या था?

Portal.properties.

locales=hi_IN,en_US
users.reminder.queries.questions= what-is-your-lucky- number,what-is-ur-girl-friend-name

Deploy Hook.

So new messages get display :



Summary :

Override portal-properties file.

Override language-properties file.

Deploying hook
Modifieing remainder query and language locales.

--------------------------------------------------------------------

Hook to Override JSP


Hooks to Override Portal Properties File


Hooks to override language Properties Files


Hooks to override user Login and Landing Page-PerLogin and Postlogin


Hooks To override Struts Actions


Hooks to override dockbar Portlet




------------------------------------------------------------------------  

No comments:

Junit 5 Architecture

Modules in JUnit 5 : •         junit-jupiter-api: This module defines the API that you need to write your tests. •         ...