Forums

Home » Liferay Portal » English » 2. Using Liferay » General

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
language.properties override using hook plugin.... Rojalin Patri August 26, 2011 4:35 AM
RE: language.properties override using hook plugin.... Ronak Patel August 26, 2011 12:23 PM
RE: language.properties override using hook plugin.... Rojalin Patri August 28, 2011 8:52 PM
RE: language.properties override using hook plugin.... Jay Patel August 28, 2011 10:50 PM
RE: language.properties override using hook plugin.... Rojalin Patri August 28, 2011 11:16 PM
RE: language.properties override using hook plugin.... Pugalendhi Radhakrishnan April 8, 2014 11:27 PM
RE: language.properties override using hook plugin.... Victor Chirita July 30, 2014 2:26 AM
RE: language.properties override using hook plugin.... Javier Solana September 10, 2014 10:16 AM
RE: language.properties override using hook plugin.... Sagar A Vyas August 28, 2011 11:00 PM
RE: language.properties override using hook plugin.... Rojalin Patri August 29, 2011 1:16 AM
RE: language.properties override using hook plugin.... Manikandan S August 29, 2011 4:17 AM
RE: language.properties override using hook plugin.... Rojalin Patri August 29, 2011 10:16 PM
RE: language.properties override using hook plugin.... Jay Patel August 30, 2011 12:05 AM
RE: language.properties override using hook plugin.... Rojalin Patri August 30, 2011 12:47 AM
RE: language.properties override using hook plugin.... Manikandan S August 30, 2011 2:10 AM
RE: language.properties override using hook plugin.... Jay Patel August 30, 2011 11:42 PM
RE: language.properties override using hook plugin.... Yi Chen Chen May 24, 2012 9:30 PM
RE: language.properties override using hook plugin.... Hitoshi Ozawa May 24, 2012 10:08 PM
Rojalin Patri
language.properties override using hook plugin....
August 26, 2011 4:35 AM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Hi all,
i am trying to create a hook to override the language.properties file.I have created the hook and i have placed my customized language.properties in side my-hook/doc root/WEB-INF/classes/content/Language.properties and i have added the following line in liferay-hook.xml
<hook>
<language-properties>content/Language_en.properties</language-properties>

</hook>
but it's not recognizing..no effect after restarting my Tomcat.
Where i am going wrongemoticon??????????
i have gone through the liferay Developers Guide...but i didn't get what should be the directory structure in the hook.
any suggestions on this.........................
Ronak Patel
RE: language.properties override using hook plugin....
August 26, 2011 12:23 PM
Answer

Ronak Patel

Rank: New Member

Posts: 19

Join Date: January 20, 2010

Recent Posts

I have not used this but we generally provide the location value starts with /.

Provide the value like
<hook>
<language-properties>/content/Language_en.properties</language-properties>
</hook>

Thanks,
Ronak
Rojalin Patri
RE: language.properties override using hook plugin....
August 28, 2011 8:52 PM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Ronak Patel:

<hook>
<language-properties>/content/Language_en.properties</language-properties>
</hook>

Hi Ronak,
i know that we have to give the above path inside the liferay-hook.xml.but i am confused what would be the folder structure of the hook.Let me make it clear...
After creating a hook you will be getting "docroot" and "build.xml" inside it.Inside docroot by default WEB-INF folder will be there and inside WEB-INF an "lib" folder, "liferay-hook.xml" and "liferay-plugin-package.properties" are there.So my doubt is whether to place language-xxx.properties inside WEB-INF/lib or i have to create a folder named "src" there and inside src a "content" folder,then keeping the language file there.....????????????
i have already created the src/content/language-xxx.properties...but it's not working......emoticon
Can anyone guide me please??????????????
Thanks
Rojalin
Jay Patel
RE: language.properties override using hook plugin....
August 28, 2011 10:50 PM
Answer

Jay Patel

Rank: Regular Member

Posts: 119

Join Date: February 23, 2010

Recent Posts

Rojalin Patri:
Ronak Patel:

<hook>
<language-properties>/content/Language_en.properties</language-properties>
</hook>

Hi Ronak,
i know that we have to give the above path inside the liferay-hook.xml.but i am confused what would be the folder structure of the hook.Let me make it clear...
After creating a hook you will be getting "docroot" and "build.xml" inside it.Inside docroot by default WEB-INF folder will be there and inside WEB-INF an "lib" folder, "liferay-hook.xml" and "liferay-plugin-package.properties" are there.So my doubt is whether to place language-xxx.properties inside WEB-INF/lib or i have to create a folder named "src" there and inside src a "content" folder,then keeping the language file there.....????????????
i have already created the src/content/language-xxx.properties...but it's not working......emoticon
Can anyone guide me please??????????????
Thanks
Rojalin


Hi,

This language file should definitely go inside "src/content/" directory of hook.
but still if you don't see your changes try renaming the property file from "language-en.properties" to "language-en_US.properties", if you are using default Locale.

Best Regards,
Jay.
Sagar A Vyas
RE: language.properties override using hook plugin....
August 28, 2011 11:00 PM
Answer

Sagar A Vyas

Rank: Liferay Master

Posts: 658

Join Date: April 17, 2009

Recent Posts

Hi Rojalin,

Step 1) Put this things in liferay-hook.xml as it is descriptor
<hook>
<language-properties>
content/Language.properties
</language-properties>
</hook>

Step 2) Put your Language.properties file in following path

docroot/WEBINF/
src/content/Language.properties


It Should Work emoticon

Thanks,
Sagar Vyas
Rojalin Patri
RE: language.properties override using hook plugin....
August 28, 2011 11:16 PM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Jay Patel:
Rojalin Patri:
Ronak Patel:

<hook>
<language-properties>/content/Language_en.properties</language-properties>
</hook>


This language file should definitely go inside "src/content/" directory of hook.
but still if you don't see your changes try renaming the property file from "language-en.properties" to "language-en_US.properties", if you are using default Locale.

Hi Jay,
still no luck......it's not reflecting........can you plase give me the detail procedure for this so this overriding method so that i can cross verify and point out where i have gone wrong.................
any other ideas from any body is greatly appreciated.....
please help.............
Thanks
Rojalin
Rojalin Patri
RE: language.properties override using hook plugin....
August 29, 2011 1:16 AM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Sagar A Vyas:
Hi Rojalin,

Step 1) Put this things in liferay-hook.xml as it is descriptor
<hook>
<language-properties>
content/Language.properties
</language-properties>
</hook>

Step 2) Put your Language.properties file in following path

docroot/WEBINF/
src/content/Language.properties


It Should Work emoticon

Hi Sagar,
i have done the same.i want to override Language_en.properties.So i have kept my Language_en.properties in src/content and i have added
<hook>
<language-properties>
content/Language_en.properties
</language-properties>
</hook> in liferay-hook.xml.
Then i created the war and hot deployed it.after restarting the server it's creating my-hook folder inside webapps but doesn't override the text i want to.
i am still puzzled where i am going wrong......
Manikandan S
RE: language.properties override using hook plugin....
August 29, 2011 4:17 AM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Hi Rojalin,
It should work you may check this trunk
Username : guest
Password : no password give empty

For reference check this thread
Rojalin Patri
RE: language.properties override using hook plugin....
August 29, 2011 10:16 PM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Mani kandan:
Hi Rojalin,
It should work you may check this trunk
Username : guest
Password : no password give empty

For reference check this thread

Hi Mani,
i tried as per the steps given in above links.still no effect......i wonder whether implementation of hooks for overriding language properties is possible in this way or not....i am attaching my hook here.please have a look and point out what is going wrong here...emoticon
Attachments: my-hook.war (2.0k)
Jay Patel
RE: language.properties override using hook plugin....
August 30, 2011 12:05 AM
Answer

Jay Patel

Rank: Regular Member

Posts: 119

Join Date: February 23, 2010

Recent Posts

Rojalin Patri:
Mani kandan:
Hi Rojalin,
It should work you may check this trunk
Username : guest
Password : no password give empty

For reference check this thread

Hi Mani,
i tried as per the steps given in above links.still no effect......i wonder whether implementation of hooks for overriding language properties is possible in this way or not....i am attaching my hook here.please have a look and point out what is going wrong here...emoticon


Hi Rojalin,
I have attached my hook war with this post corresponding to my version & it is working completely fine.
I have made following changes in your war file:

1. Added "src\content" folders under WEB-INF
2. Renamed language property file from "Language_en.properties" to "Language_en_US.properties" (This I had suggested to you in earlier post)
3. Changed path in liferay-hook.xml from "<language-properties>content/Language_en.properties</language-properties>" to "<language-properties>content/Language_en_US.properties</language-properties>"
4. Sample message which I have overridden using this file is "your-request-processed-successfully=successfully."

So now whenever you perform some action successfully after deploying this hook, it will show you message "successfully." rather than original message of Liferay which is "Your request processed successfully."

Cheers,
Jay.
Attachments: my-hook-5.2.8.1.war (1.6k)
Rojalin Patri
RE: language.properties override using hook plugin....
August 30, 2011 12:47 AM
Answer

Rojalin Patri

Rank: Expert

Posts: 287

Join Date: March 22, 2011

Recent Posts

Thanks a lot Jay,this is working fine in my bundle too.
but one thing i wonder,i don't have Language_en_US.properties in my portal-impl.jar.Then how is it overriding the same through hook???????????? previously i had tried overriding the same through EXT and Language-ext_en.properties and it was overriding the same successfully.So that means it was fetching the text values from the Language_en.properties.But here,when i tried to override the same using hook,then it's overriding a strange file which is not present in the bundle........
Could you please clarify my doubt.......
Thanks
Rojalin
Manikandan S
RE: language.properties override using hook plugin....
August 30, 2011 2:10 AM
Answer

Manikandan S

Rank: Expert

Posts: 492

Join Date: September 15, 2010

Recent Posts

Hi,
The procedure that Jay mentioned above was correct.
For your doubts you can check this wiki and an example
Jay Patel
RE: language.properties override using hook plugin....
August 30, 2011 11:42 PM
Answer

Jay Patel

Rank: Regular Member

Posts: 119

Join Date: February 23, 2010

Recent Posts

Mani kandan:
Hi,
The procedure that Jay mentioned above was correct.
For your doubts you can check this wiki and an example



Thanks Mani for clearing Rojalin's doubts...

Cheers,
Jay.
Yi Chen Chen
RE: language.properties override using hook plugin....
May 24, 2012 9:30 PM
Answer

Yi Chen Chen

Rank: New Member

Posts: 7

Join Date: February 9, 2012

Recent Posts

Dear Sir,

There are three issues needing to consult with you.

First, the Language_zh_TW.properties files extracted from "http://translate.liferay.com/pootle/zh_TW/portal/", "https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/content/Language_zh_TW.properties", and "http://subversion.assembla.com/svn/liferay/portal-impl/src/content/Language_zh_TW.properties.native" are different. I have no idea why the aforementioned three Language_zh_TW.properties files are different. Which one is the official Language_zh_TW.properties?

Second, the Language_zh_TW.properties files extracted from "http://translate.liferay.com/pootle/zh_TW/portal/" can be used for Liferay Portal Community Edition 6.0.5, right?

Third, I'm using Liferay Portal Community Edition 6.0.5 Bundled with GlassFish Server Open Source Edition 3.0.1. I have got a problem with my languages hook: changes are always not applied. I have no idea why my liferay_zh_TW_lang_hook.war language hook is not work.

Please help me to clarify the aforementioned issues I have encountered, thank you very much!

Best Regards and Have a Nice Day

Yi Chen, Chen
Attachments: liferay_zh_TW_lang_hook.war (171.3k)
Hitoshi Ozawa
RE: language.properties override using hook plugin....
May 24, 2012 10:08 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Yi, thank you for you post but please create a new thread because you question if different from the subject of this thread. It getting confusing determining if the question has been answered when there are several different question in a thread.
Pugalendhi Radhakrishnan
RE: language.properties override using hook plugin....
April 8, 2014 11:27 PM
Answer

Pugalendhi Radhakrishnan

Rank: New Member

Posts: 11

Join Date: November 18, 2013

Recent Posts

hi jay,
thanks for that thread link..
Victor Chirita
RE: language.properties override using hook plugin....
July 30, 2014 2:26 AM
Answer

Victor Chirita

Rank: New Member

Posts: 3

Join Date: February 13, 2012

Recent Posts

Thanks guys!

The hook method is working!
Javier Solana
RE: language.properties override using hook plugin....
September 10, 2014 10:16 AM
Answer

Javier Solana

Rank: Junior Member

Posts: 41

Join Date: June 26, 2014

Recent Posts

Yeah man! under the src folder is the place. Thanks!