Foren

language.properties override using hook plugin....

thumbnail
Rojalin Patri, geändert vor 12 Jahren.

language.properties override using hook plugin....

Expert Beiträge: 287 Beitrittsdatum: 22.03.11 Neueste Beiträge
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.........................
thumbnail
Ronak Patel, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

New Member Beiträge: 19 Beitrittsdatum: 20.01.10 Neueste Beiträge
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
thumbnail
Rojalin Patri, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 287 Beitrittsdatum: 22.03.11 Neueste Beiträge
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
thumbnail
Jay Patel, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Regular Member Beiträge: 118 Beitrittsdatum: 24.02.10 Neueste Beiträge
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.
thumbnail
Rojalin Patri, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 287 Beitrittsdatum: 22.03.11 Neueste Beiträge
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
thumbnail
Pugalendhi Radhakrishnan, geändert vor 10 Jahren.

RE: language.properties override using hook plugin....

New Member Beiträge: 14 Beitrittsdatum: 18.11.13 Neueste Beiträge
hi jay,
thanks for that thread link..
Victor Chirita, geändert vor 9 Jahren.

RE: language.properties override using hook plugin....

New Member Beiträge: 3 Beitrittsdatum: 13.02.12 Neueste Beiträge
Thanks guys!

The hook method is working!
thumbnail
Javier Solana, geändert vor 9 Jahren.

RE: language.properties override using hook plugin....

Junior Member Beiträge: 59 Beitrittsdatum: 26.06.14 Neueste Beiträge
Yeah man! under the src folder is the place. Thanks!
thumbnail
Sagar A Vyas, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Liferay Master Beiträge: 679 Beitrittsdatum: 17.04.09 Neueste Beiträge
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
thumbnail
Rojalin Patri, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 287 Beitrittsdatum: 22.03.11 Neueste Beiträge
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......
thumbnail
Mani kandan, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 492 Beitrittsdatum: 15.09.10 Neueste Beiträge
Hi Rojalin,
It should work you may check this trunk
Username : guest
Password : no password give empty

For reference check this thread
thumbnail
Rojalin Patri, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 287 Beitrittsdatum: 22.03.11 Neueste Beiträge
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
thumbnail
Jay Patel, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Regular Member Beiträge: 118 Beitrittsdatum: 24.02.10 Neueste Beiträge
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.
thumbnail
Rojalin Patri, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 287 Beitrittsdatum: 22.03.11 Neueste Beiträge
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
thumbnail
Mani kandan, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Expert Beiträge: 492 Beitrittsdatum: 15.09.10 Neueste Beiträge
Hi,
The procedure that Jay mentioned above was correct.
For your doubts you can check this wiki and an example
thumbnail
Jay Patel, geändert vor 12 Jahren.

RE: language.properties override using hook plugin....

Regular Member Beiträge: 118 Beitrittsdatum: 24.02.10 Neueste Beiträge
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, geändert vor 11 Jahren.

RE: language.properties override using hook plugin....

New Member Beiträge: 7 Beitrittsdatum: 10.02.12 Neueste Beiträge
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
thumbnail
Hitoshi Ozawa, geändert vor 11 Jahren.

RE: language.properties override using hook plugin....

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
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.