You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Shervin Asgari <sh...@linpro.no> on 2006/05/29 17:13:31 UTC

ReadMorePlugin

Hello. Why haven't anybody considered making the Read More plug in text 
into a properties file so that we can change the language easily without 
messing around in the source code?

I am in the process of doing this, but I cannot find where to change the 
value so that it can read from the ApplicationResources.properties file 
instead. Can somebody that knows this please guide me to the correct 
files I can take a look at? I will submit my work back to the community.

-- 
Shervin Asgari - System Consultant
@: shervin@linpro.no
Linpro AS - Leading on Linux	Tel: +47 21 54 41 00/02
Vitaminveien 1A        Fax: +47 21 54 41 01
PB 4 Grefsen, 0409 Oslo    WWW: http://www.linpro.no/


Re: ReadMorePlugin

Posted by Shervin Asgari <sh...@linpro.no>.
Looks like our contractor wanted this fix anyways so I made a small 
change on the ReadMorePlugin to  get the text from a properties file. I 
also edited the url a bit.

Do you guys want me to submit this back to you? Or since this will be 
deprecated anyways, there is no need? Just let me know, and I will 
submit it back.

Shervin Asgari - System Consultant
M: +47 918 64 148, @: shervin@linpro.no
Linpro AS - Leading on Linux	Tel: +47 21 54 41 00/02
Vitaminveien 1A        Fax: +47 21 54 41 01
PB 4 Grefsen, 0409 Oslo    WWW: http://www.linpro.no/



Anil Gangolli wrote:
>
> Some caveats regarding the use of the ReadMore plugin:  the plugin's 
> logic for content/tag separation and truncation has always been a bit 
> shaky, and it is error-prone.  Roller 2.3 provides an explicit summary 
> field; this field provides short forms of the entry for feeds and 
> multi-entry displayed pages.  We plan to deprecate the plugin.
>
> That said, if you are just trying to replace the "Read More ..." 
> string with an internationalized string, here is how.  Plugins aren't 
> passed a reference to the bundle, so you have to fetch it yourself 
> (ResourceBundle caches, and this should just hit the cache).  The 
> simplest code fragment would be something like:
>
> ...
> ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
> String localizedReadMoreString = 
> bundle.getString("readMorePlugin.readMoreString");
> ...
>
> You would have to add a key-value pair with key 
> "readMorePlugin.readMoreString" to the default 
> ApplicationResources.properties as well as the Norwegian one.
>
> --a.
>
>
>
>
>
> ----- Original Message ----- From: "Shervin Asgari" <sh...@linpro.no>
> To: <ro...@incubator.apache.org>
> Sent: Monday, May 29, 2006 8:13 AM
> Subject: ReadMorePlugin
>
>
>> Hello. Why haven't anybody considered making the Read More plug in 
>> text into a properties file so that we can change the language easily 
>> without messing around in the source code?
>>
>> I am in the process of doing this, but I cannot find where to change 
>> the value so that it can read from the 
>> ApplicationResources.properties file instead. Can somebody that knows 
>> this please guide me to the correct files I can take a look at? I 
>> will submit my work back to the community.
>>
>> -- 
>> Shervin Asgari - System Consultant
>> @: shervin@linpro.no
>> Linpro AS - Leading on Linux Tel: +47 21 54 41 00/02
>> Vitaminveien 1A        Fax: +47 21 54 41 01
>> PB 4 Grefsen, 0409 Oslo    WWW: http://www.linpro.no/
>>
>

Re: ReadMorePlugin

Posted by Shervin Asgari <sh...@linpro.no>.
Thank you for your reply. So basically it is kinda useless for me to do 
this if we are planning to migrate to Roller 2.3 when this is shipped? I 
can edit the text and let it stay like that until Roller 2.3 comes.

Shervin Asgari - System Consultant
M: +47 918 64 148, @: shervin@linpro.no
Linpro AS - Leading on Linux	Tel: +47 21 54 41 00/02
Vitaminveien 1A        Fax: +47 21 54 41 01
PB 4 Grefsen, 0409 Oslo    WWW: http://www.linpro.no/



Anil Gangolli wrote:
>
> Some caveats regarding the use of the ReadMore plugin:  the plugin's 
> logic for content/tag separation and truncation has always been a bit 
> shaky, and it is error-prone.  Roller 2.3 provides an explicit summary 
> field; this field provides short forms of the entry for feeds and 
> multi-entry displayed pages.  We plan to deprecate the plugin.
>
> That said, if you are just trying to replace the "Read More ..." 
> string with an internationalized string, here is how.  Plugins aren't 
> passed a reference to the bundle, so you have to fetch it yourself 
> (ResourceBundle caches, and this should just hit the cache).  The 
> simplest code fragment would be something like:
>
> ...
> ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
> String localizedReadMoreString = 
> bundle.getString("readMorePlugin.readMoreString");
> ...
>
> You would have to add a key-value pair with key 
> "readMorePlugin.readMoreString" to the default 
> ApplicationResources.properties as well as the Norwegian one.
>
> --a.
>
>
>
>
>
> ----- Original Message ----- From: "Shervin Asgari" <sh...@linpro.no>
> To: <ro...@incubator.apache.org>
> Sent: Monday, May 29, 2006 8:13 AM
> Subject: ReadMorePlugin
>
>
>> Hello. Why haven't anybody considered making the Read More plug in 
>> text into a properties file so that we can change the language easily 
>> without messing around in the source code?
>>
>> I am in the process of doing this, but I cannot find where to change 
>> the value so that it can read from the 
>> ApplicationResources.properties file instead. Can somebody that knows 
>> this please guide me to the correct files I can take a look at? I 
>> will submit my work back to the community.
>>
>> -- 
>> Shervin Asgari - System Consultant
>> @: shervin@linpro.no
>> Linpro AS - Leading on Linux Tel: +47 21 54 41 00/02
>> Vitaminveien 1A        Fax: +47 21 54 41 01
>> PB 4 Grefsen, 0409 Oslo    WWW: http://www.linpro.no/
>>
>

Re: ReadMorePlugin

Posted by Anil Gangolli <an...@busybuddha.org>.
Some caveats regarding the use of the ReadMore plugin:  the plugin's logic 
for content/tag separation and truncation has always been a bit shaky, and 
it is error-prone.  Roller 2.3 provides an explicit summary field; this 
field provides short forms of the entry for feeds and multi-entry displayed 
pages.  We plan to deprecate the plugin.

That said, if you are just trying to replace the "Read More ..." string with 
an internationalized string, here is how.  Plugins aren't passed a reference 
to the bundle, so you have to fetch it yourself (ResourceBundle caches, and 
this should just hit the cache).  The simplest code fragment would be 
something like:

...
ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
String localizedReadMoreString = 
bundle.getString("readMorePlugin.readMoreString");
...

You would have to add a key-value pair with key 
"readMorePlugin.readMoreString" to the default 
ApplicationResources.properties as well as the Norwegian one.

--a.





----- Original Message ----- 
From: "Shervin Asgari" <sh...@linpro.no>
To: <ro...@incubator.apache.org>
Sent: Monday, May 29, 2006 8:13 AM
Subject: ReadMorePlugin


> Hello. Why haven't anybody considered making the Read More plug in text 
> into a properties file so that we can change the language easily without 
> messing around in the source code?
>
> I am in the process of doing this, but I cannot find where to change the 
> value so that it can read from the ApplicationResources.properties file 
> instead. Can somebody that knows this please guide me to the correct files 
> I can take a look at? I will submit my work back to the community.
>
> -- 
> Shervin Asgari - System Consultant
> @: shervin@linpro.no
> Linpro AS - Leading on Linux Tel: +47 21 54 41 00/02
> Vitaminveien 1A        Fax: +47 21 54 41 01
> PB 4 Grefsen, 0409 Oslo    WWW: http://www.linpro.no/
>