You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@roller.apache.org by Oscar Puga <os...@yahoo.es> on 2007/02/15 19:10:10 UTC

Roller 3.0 locale support works wrong in velocity templates

I have a unique weblog in my Roller 3.0 system configured to support
multiples languages:

Internationalization Settings/
I publish my weblog in multiple languages ... checked

And I had created 2 entries in 2 different languages: english and spanish.

But the velocity templates retrieving messages from
ApplicationResources_XX.properties, are showing randomly localized messages!

For example, the message for the key "weblogEntriesPager.single.home" shows
the value from ApplicationResources.properties. At the same time, the entry
"comments.disabled" shows the value for ApplicationResources_es.properties!

This happens both in entries created with locale english and in entries
created with locale spanish (es).

And if I type the locale as part of the url as in
"...mywebloghandle/en/entry/XXXX", that locale is totally ignored, the
entries still show the wrong behavior I just related before.

The guide http://rollerweblogger.org/wiki/Wiki.jsp?page=LocalizationGuide
only says that:
"... the locale used to display Roller application pages (editing and
administration) is determined by the user's profile locale setting."

¿How is the locale retrieved from the velocity templates when they do a
$text.get("key") ?¿how can I fix this to make the velocity templates use the
locale when specified in the url?

My config is: Roller 3.0 (from binaries), Fedora Core 5, Java 1.5.0_9 and
Tomcat 5.5.

Thanks in advance

-- 
View this message in context: http://www.nabble.com/Roller-3.0-locale-support-works-wrong-in-velocity-templates-tf3235252s12275.html#a8990661
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Roller 3.0 locale support works wrong in velocity templates

Posted by Oscar Puga <os...@yahoo.es>.
Thanks for the soon reply, Alex.
I will check the roller-dev mailing list in search for some more info.
The option "Show my weblog entries from all languages on my home page" when
unchecked is working well on my system, i.e. showing the entries in one
locale, but *ONLY* if the locale is added to url (ant that's fine for me).
But the location of the messages is still a rare mix, even when the keys are
present in all the ApplicationResources for the locales I'm using. Exact
like your system, the calendar of the blog localizes very well. It seems
that Roller is looking for localizated messages in a different manner in
each subsystem: Calendar, admin pages and velocity templates.
The fact of using Struts+JSP's for some presentation tasks, and Velocity for
others is doing a very hard job to find the source of this problem.



Alex D wrote:
> 
> Oooops sorry... I posted my topic in the roller-dev mailing list....
> 
> For your information, here is the first anwsers I got for my questions...
> You may join the roller-dev mailing list if you want to watch this topic.
> 
> Sincerely
> 
> Alex
> 
> =================================================================
> 
> 
> Hi Allen,
> 
> First of all, thanks for this useful piece of information.
> 
> I confirm that with my version 3.0 (downloaded on November 21st) has the
> following problem:
> 
> * If I leave "Show my weblog entries from all languages on my home page"
> unchecked, in the frontpage (accessed without passing any language id in
> the
> URI) I still have all my posts, even those defined with a locale different
> of the main blog.
> -> I'm gonna re-install v3.0 and test v3.1 to see if it can solve anything
> 
> Concerning the second point, I set the weblog with the locale "Spanish"
> (es)
> and created a post with locale spanish.
> I'm using the $text.get(" macro.weblog.postedby") to get the text in my
> template.
> In any case, it displays "Posted by". I checked in WEB-INF/classes and
> ApplicationResources_es.properties (for spanish, coming with the default
> install of Roller 3.0) and the macro.weblog.postedby exists and is set to
> "Enviado por"
> 
> So you say:
>> So to fix this should just be a matter of making sure the bundles are
>> properly updated and synchronized with their translations.
> Does it mean that the bundle ApplicationResources_es.properties, coming
> with
> the default install of Roller 3.0, is corrupted ?
> Did I do any mistake ?
> 
> Thanks in advance for your precious help,
> 
> Alex
> 
> On 2/16/07, Allen Gilliland <al...@sun.com> wrote:
>>
>>
>>
>> Alex D wrote:
>> > Dear all,
>> >
>> > I'm testing the latest version of Roller 3.0 . I'm on Red Hat 4, with
>> Java
>> > 1.5 and tomcat 5.5.9.
>> >
>> > I see in "What's new for Roller 3.0" that it has a "Better support for
>> > multi-language weblogs"
>> >
>> > But I can't get how it works...
>> >
>> > I did the following:
>> >
>> > * created one weblog with locale set to english
>> > * I checked "Publish weblog in multiple languages"
>> > * I unchecked "Show my weblog entries from all languages on my home
>> page"
>> >
>> > Then I have created 3 entries:
>> > * in english (with locale set to english)
>> > * in spanish (with locale set to spanish)
>> > * in german (with locale set to german)
>> >
>> > Then when I go to my weblog http://localhost:8080/roller3/localeen/ I
>> can
>> > see all my entries (english, german and spanish)
>> > BUT "Show my weblog entries from all languages on my homepage" is
>> > unchecked,
>> > So why all entries are displayed ? (normally I guess only the entries
>> with
>> > the locale set to the same locale of the blog should be displayed,
>> meaning
>> > "en" entries")
>>
>> Hmmm.  That would be a bug, but I know that feature is working in 3.0 so
>> I'm not sure what you may have done wrong.  You are correct that if your
>> weblog locale is english and you unchecked the "show entries from all
>> languages" button then you should only see english entries on your blog.
>>
>>
>> >
>> > Also, if I go http://localhost:8080/roller3/localeen/es/ I can see all
>> my
>> > entries in spanish and also those in spanish.
>> > That's ok for me
>> > The calendar is in spanish BUT other text, for instance "posted by" are
>> in
>> > english. In the template, I'm using $text.get("
>> macro.weblog.postedby"),
>> > So having a mix between spanish and english is disapointing.
>> > How is is supposed to work ? Is the text supposed to be in the locale
>> of
>>
>> > the
>> > weblog (english) or in the locale of the entry (spanish) or in the
>> language
>> > of the language id passed in URL (here "es" for spanish) ?
>> > Why can't the text "macro.weblog.postedby " be in spanish, while it is
>> > available in spanish in the ApplicationRessources_es.properties file.
>>
>> The problem with the text is just a problem with the resource bundles I
>> believe.  My guess is that the default bundle, which is in english, has
>> a number of entries which aren't properly reflected in the other bundles
>> because we don't have much in the way of i18n resources for the project.
>>   Any time you are trying to get a string from the bundles which doesn't
>> exist in your desired language then you will get the default, which is
>> english.
>>
>> So to fix this should just be a matter of making sure the bundles are
>> properly updated and synchronized with their translations.
>>
>> -- Allen
>>
>>
>> >
>> > Finally, I have created a second blog (localees), with locale set to
>> > spanish
>> > (es).
>> > Then when I go to my weblog http://localhost:8080/roller3/localees/ the
>> > calendar is in spanish (es)
>> > but dynamic text generated by $text.get("...") are still in english
>> > (despite
>> > the fact they are set in ApplicationRessources_es.properties)
>> > Is it normal ?
>> > Is it a bug ?
>> > How can we use the $text.get to get the texts set in the
>> > ApplicationRessources_xx.properties and what is the locale taken in
>> > consideration to display the text with $text.get (the one set for the
>> blog,
>> > the one set for an entry, the one passed in the URI or the one set for
>> Java
>> > ?
>> >
>> > Thanks in advance for your help,
>> >
>> > Best regards,
>> >
>> > Alexandre
>> >
> 
> 

-- 
View this message in context: http://www.nabble.com/Roller-3.0-locale-support-works-wrong-in-velocity-templates-tf3235252s12275.html#a9039833
Sent from the Roller - User mailing list archive at Nabble.com.


Re: Roller 3.0 locale support works wrong in velocity templates

Posted by Alex D <zi...@free.fr>.
Oooops sorry... I posted my topic in the roller-dev mailing list....

For your information, here is the first anwsers I got for my questions...
You may join the roller-dev mailing list if you want to watch this topic.

Sincerely

Alex

=================================================================


Hi Allen,

First of all, thanks for this useful piece of information.

I confirm that with my version 3.0 (downloaded on November 21st) has the
following problem:

* If I leave "Show my weblog entries from all languages on my home page"
unchecked, in the frontpage (accessed without passing any language id in the
URI) I still have all my posts, even those defined with a locale different
of the main blog.
-> I'm gonna re-install v3.0 and test v3.1 to see if it can solve anything

Concerning the second point, I set the weblog with the locale "Spanish" (es)
and created a post with locale spanish.
I'm using the $text.get(" macro.weblog.postedby") to get the text in my
template.
In any case, it displays "Posted by". I checked in WEB-INF/classes and
ApplicationResources_es.properties (for spanish, coming with the default
install of Roller 3.0) and the macro.weblog.postedby exists and is set to
"Enviado por"

So you say:
> So to fix this should just be a matter of making sure the bundles are
> properly updated and synchronized with their translations.
Does it mean that the bundle ApplicationResources_es.properties, coming with
the default install of Roller 3.0, is corrupted ?
Did I do any mistake ?

Thanks in advance for your precious help,

Alex

On 2/16/07, Allen Gilliland <al...@sun.com> wrote:
>
>
>
> Alex D wrote:
> > Dear all,
> >
> > I'm testing the latest version of Roller 3.0 . I'm on Red Hat 4, with
> Java
> > 1.5 and tomcat 5.5.9.
> >
> > I see in "What's new for Roller 3.0" that it has a "Better support for
> > multi-language weblogs"
> >
> > But I can't get how it works...
> >
> > I did the following:
> >
> > * created one weblog with locale set to english
> > * I checked "Publish weblog in multiple languages"
> > * I unchecked "Show my weblog entries from all languages on my home
> page"
> >
> > Then I have created 3 entries:
> > * in english (with locale set to english)
> > * in spanish (with locale set to spanish)
> > * in german (with locale set to german)
> >
> > Then when I go to my weblog http://localhost:8080/roller3/localeen/ I
> can
> > see all my entries (english, german and spanish)
> > BUT "Show my weblog entries from all languages on my homepage" is
> > unchecked,
> > So why all entries are displayed ? (normally I guess only the entries
> with
> > the locale set to the same locale of the blog should be displayed,
> meaning
> > "en" entries")
>
> Hmmm.  That would be a bug, but I know that feature is working in 3.0 so
> I'm not sure what you may have done wrong.  You are correct that if your
> weblog locale is english and you unchecked the "show entries from all
> languages" button then you should only see english entries on your blog.
>
>
> >
> > Also, if I go http://localhost:8080/roller3/localeen/es/ I can see all
> my
> > entries in spanish and also those in spanish.
> > That's ok for me
> > The calendar is in spanish BUT other text, for instance "posted by" are
> in
> > english. In the template, I'm using $text.get(" macro.weblog.postedby"),
> > So having a mix between spanish and english is disapointing.
> > How is is supposed to work ? Is the text supposed to be in the locale of
>
> > the
> > weblog (english) or in the locale of the entry (spanish) or in the
> language
> > of the language id passed in URL (here "es" for spanish) ?
> > Why can't the text "macro.weblog.postedby " be in spanish, while it is
> > available in spanish in the ApplicationRessources_es.properties file.
>
> The problem with the text is just a problem with the resource bundles I
> believe.  My guess is that the default bundle, which is in english, has
> a number of entries which aren't properly reflected in the other bundles
> because we don't have much in the way of i18n resources for the project.
>   Any time you are trying to get a string from the bundles which doesn't
> exist in your desired language then you will get the default, which is
> english.
>
> So to fix this should just be a matter of making sure the bundles are
> properly updated and synchronized with their translations.
>
> -- Allen
>
>
> >
> > Finally, I have created a second blog (localees), with locale set to
> > spanish
> > (es).
> > Then when I go to my weblog http://localhost:8080/roller3/localees/ the
> > calendar is in spanish (es)
> > but dynamic text generated by $text.get("...") are still in english
> > (despite
> > the fact they are set in ApplicationRessources_es.properties)
> > Is it normal ?
> > Is it a bug ?
> > How can we use the $text.get to get the texts set in the
> > ApplicationRessources_xx.properties and what is the locale taken in
> > consideration to display the text with $text.get (the one set for the
> blog,
> > the one set for an entry, the one passed in the URI or the one set for
> Java
> > ?
> >
> > Thanks in advance for your help,
> >
> > Best regards,
> >
> > Alexandre
> >

Re: Roller 3.0 locale support works wrong in velocity templates

Posted by Alex D <zi...@free.fr>.
Hi Oscar, interesting topic.

I'm facing the exatcly same problems (you can see my request "Multi-language
weblogs with Roller") + other

Best regards,

Alex

On 2/15/07, Oscar Puga < oscarpuga@yahoo.es> wrote:
>
>
> I have a unique weblog in my Roller 3.0 system configured to support
> multiples languages:
>
> Internationalization Settings/
> I publish my weblog in multiple languages ... checked
>
> And I had created 2 entries in 2 different languages: english and spanish.
>
> But the velocity templates retrieving messages from
> ApplicationResources_XX.properties, are showing randomly localized
> messages!
>
> For example, the message for the key "weblogEntriesPager.single.home"
> shows
> the value from ApplicationResources.properties . At the same time, the
> entry
> "comments.disabled" shows the value for
> ApplicationResources_es.properties!
>
> This happens both in entries created with locale english and in entries
> created with locale spanish (es).
>
> And if I type the locale as part of the url as in
> "...mywebloghandle/en/entry/XXXX", that locale is totally ignored, the
> entries still show the wrong behavior I just related before.
>
> The guide http://rollerweblogger.org/wiki/Wiki.jsp?page=LocalizationGuide
> only says that:
> "... the locale used to display Roller application pages (editing and
> administration) is determined by the user's profile locale setting."
>
> ¿How is the locale retrieved from the velocity templates when they do a
> $text.get("key") ?¿how can I fix this to make the velocity templates use
> the
> locale when specified in the url?
>
> My config is: Roller 3.0 (from binaries), Fedora Core 5, Java 1.5.0_9 and
> Tomcat 5.5.
>
> Thanks in advance
>
> --
> View this message in context:
> http://www.nabble.com/Roller-3.0-locale-support-works-wrong-in-velocity-templates-tf3235252s12275.html#a8990661
> Sent from the Roller - User mailing list archive at Nabble.com.
>
>