You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@roller.apache.org by Sean Gilligan <se...@msgilligan.com> on 2006/01/11 06:26:16 UTC

Local configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Hello Anil, et. al.

What we'd like to do is just add a property in roller.properties that if 
present overrides the JVM's default locale.  (At a minimum, I'm assuming 
this is easier than making it work based upon the request or the user's 
preference, but I don't know yet.)

 > Also, you could modify the code (essentially one spot) to
 > use a separately configured locale rather than the JVM default.

Where is that "one spot"?

Thanks,

Sean

-------- Original Message --------
From: - Thu Jan  5 08:05:22 2006
X-Account-Key: account3
X-UIDL: 6f4753a2af27facefef3c1c510c92533
X-Mozilla-Status: 1011
X-Mozilla-Status2: 00000000
Received: from mail.apache.org (hermes.apache.org [209.237.227.199])	by 
groundhog.opsystems.com (8.11.6/8.11.6) with SMTP id k05Eogv07126	for 
<se...@msgilligan.com>; Thu, 5 Jan 2006 06:50:43 -0800 (PST)
Received: (qmail 10239 invoked by uid 500); 5 Jan 2006 15:03:07 -0000
Mailing-List: contact roller-user-help@incubator.apache.org; run by ezmlm
Precedence: bulk
List-Help: <ma...@incubator.apache.org>
List-Unsubscribe: <ma...@incubator.apache.org>
List-Post: <ma...@incubator.apache.org>
List-Id: <roller-user.incubator.apache.org>
Reply-To: roller-user@incubator.apache.org
Delivered-To: mailing list roller-user@incubator.apache.org
Received: (qmail 10199 invoked by uid 99); 5 Jan 2006 15:03:07 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) 
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2006 07:03:07 -0800
X-ASF-Spam-Status: No, hits=0.0 required=10.0	tests=
X-Spam-Check-By: apache.org
Received-SPF: pass (asf.osuosl.org: local policy)
Received: from [64.142.80.182] (HELO busybuddha.org) (64.142.80.182) 
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2006 07:03:06 -0800
Received: from [127.0.0.1] (pear.busybuddha.org [64.142.80.182])	by 
busybuddha.org (8.13.1/8.12.11) with ESMTP id k05F9qIe025080	for 
<ro...@incubator.apache.org>; Thu, 5 Jan 2006 07:09:53 -0800
Message-ID: <43...@busybuddha.org>
Date: Thu, 05 Jan 2006 07:03:19 -0800
From: Anil Gangolli <an...@busybuddha.org>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: roller-user@incubator.apache.org
Subject: Re: Multi-language ApplicationResources.properties?
References: <43...@msgilligan.com>
In-Reply-To: <43...@msgilligan.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Checked: Checked by ClamAV on apache.org
X-UIDL: 6f4753a2af27facefef3c1c510c92533

Sean Gilligan wrote:

> Is there a way to have each user of Roller get the Struts UI screens 
> in the language of his/her configured locale?
>
Currently, no, but determining the locale based on either the user's
configured locale or the request headers is an enhancement that I think
we ought to support.

I'm not sure why we don't do this already, and if there are any issues
with it.  This probably deserves some discussion on the roller-dev list.

> Or, if that is not possible, Is there a way to change the 
> ApplicationResources file used without changing the default locale of 
> the Tomcat JVM?

Well, certainly, you should be able to move the desired
ApplicationResources_<localespec>.properties file into the default
position ApplicationResources.properties (no locale), removing all of
the others.  Also, you could modify the code (essentially one spot) to
use a separately configured locale rather than the JVM default.

>
> Thanks,
>
> Sean
>
>




Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Sean Gilligan <se...@msgilligan.com>.
Anil Gangolli wrote:

>> Is this worth submitting as a patch?
> 
> I think it's fine as long as the behavior in the case the property is 
> not set is the same as current behavior.
Right.  So I'd put the new property commented out in roller.properties. 
  The recommended way to activate it would be to uncomment it and set 
the right locale in roller-custom.properties.

> Just file an improvement request with or without a patch diff and let me 
> know the bug # or assign it to me if you can.  I'll get around to it 
> before 2.1 goes out.  It's a pretty small change.
Cool.  We should be able to submit a patch early next week.
> 
>>
>> I'd love to see dynamic locale setting, but can't commit to 
> 
> I'll propose something later.  I don't really know what's involved in 
> doing this right, and I'd have to play around.
We have some experience with this in a Turbine-based app, but not idea 
where to start with Roller,  but we'd really love to see this feature 
and could at least provide good testing and feedback (and maybe a patch 
or two when we find a bug ;)

-- Sean

Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
Sean Gilligan wrote:

> Thanks, Anil.
>
> I agree it's not much more valuable than renaming the files, but it 
> makes configuration management a little easier -- especially if you 
> are updating or creating new localizations.
>
> Is this worth submitting as a patch?

 I think it's fine as long as the behavior in the case the property is 
not set is the same as current behavior.
Just file an improvement request with or without a patch diff and let me 
know the bug # or assign it to me if you can.  I'll get around to it 
before 2.1 goes out.  It's a pretty small change.

>
> I'd love to see dynamic locale setting, but can't commit to 
> implementing it myself.  (I'm already welching on my plans to add the 
> Maven2 ant task to the build...)

I'll propose something later.  I don't really know what's involved in 
doing this right, and I'd have to play around.

>
> -- Sean
>
> Anil Gangolli wrote:
>
>>
>> Sean:
>>
>> To do what you describe, the "one spot" is BasePageModel; I think 
>> that's all that would need to change for your desired thing.  The 
>> bundle is currently initialized in a static initializer using the 
>> default locale (no locale argument supplied).  You'd have to change 
>> that to initialize, say on construction, using a Locale determined by 
>> a property (obtained via RollerConfig.getProperty(...)).
>>
>> I don't think it's that valuable to do this over just renaming the 
>> ApplicationResources.properties files to get the desired effect, but 
>> it shouldn't be very hard to make the changes you want.
>>
>> I think it's worth discussing further why we don't/can't/shouldn't 
>> choose the bundle locale dynamically per request based on what we can 
>> determine from the browser, or using the logged in user's configured 
>> locale.  I don't have a concrete proposal.
>>
>
>


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Sean Gilligan <se...@msgilligan.com>.
Thanks, Anil.

I agree it's not much more valuable than renaming the files, but it 
makes configuration management a little easier -- especially if you are 
updating or creating new localizations.

Is this worth submitting as a patch?

I'd love to see dynamic locale setting, but can't commit to implementing 
it myself.  (I'm already welching on my plans to add the Maven2 ant task 
to the build...)

-- Sean

Anil Gangolli wrote:
> 
> Sean:
> 
> To do what you describe, the "one spot" is BasePageModel; I think that's 
> all that would need to change for your desired thing.  The bundle is 
> currently initialized in a static initializer using the default locale 
> (no locale argument supplied).  You'd have to change that to initialize, 
> say on construction, using a Locale determined by a property (obtained 
> via RollerConfig.getProperty(...)).
> 
> I don't think it's that valuable to do this over just renaming the 
> ApplicationResources.properties files to get the desired effect, but it 
> shouldn't be very hard to make the changes you want.
> 
> I think it's worth discussing further why we don't/can't/shouldn't 
> choose the bundle locale dynamically per request based on what we can 
> determine from the browser, or using the logged in user's configured 
> locale.  I don't have a concrete proposal.
> 


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
I've updated the LocalizationGuide page on the wiki to reflect this.

Thanks again.

--a.

Anil Gangolli wrote:

> Great stuff Allen!  Thanks!
>
> --a.
>
> Allen Gilliland wrote:
>
>> okay, I've just submitted a change that I think fixes this issue, at
>> least for users logged into the editing interface.  I updated the
>> taglibs.jsp file to set the locale for the jstl "fmt" tag based on the
>> locale in a users profile.  if we think that the display should be based
>> on browser locale then that's fairly easy to change.
>>
>> one slight drawback so far is that the locale you select in your profile
>> sometimes doesn't correspond to one of the translations we have for
>> ApplicationResources.  an example is that on the profile page you can
>> select "Japanese" as your language and it sets your locale to "jp", but
>> our japanese resources file is defined as "jp_JP", so it only goes into
>> effect if the locale is "jp_JP".  We should probably just change our
>> ja_JP resources file to just be ja.
>>
>> I tested with the language "Spanish (Spain)" and everything worked
>> correctly for me.
>>
>> -- Allen
>>
>>
>> On Sat, 2006-01-14 at 10:44, Anil Gangolli wrote:
>>  
>>
>>> Allen Gilliland wrote:
>>>
>>>   
>>>
>>>> I understood this thread to be about how to get the Roller editing
>>>> interface (/editor/*, /admin/*) to display in different languages.
>>>>
>>>>
>>>>     
>>>
>>> Right.  That's the goal
>>>
>>>   
>>>
>>>> Setting the default language for the jvm is not a real option if 
>>>> you ask
>>>> me.  On blogs.sun.com we need to support multiple languages at the 
>>>> same
>>>> time, we can't just change the jvm language.  I'll take a look at 
>>>> it and
>>>> see if I can't figure anything out.
>>>>
>>>>
>>>>     
>>>
>>> That's all I know that really works right now, but I now suspect 
>>> it's because we've broken the facility that Jaap put together.  We 
>>> should fix it.  I'm happy to help.  Let us know what you figure 
>>> out.  It's worth documenting better too.
>>>
>>>   
>>>
>>>> My comments about i18n on the rendering side of things were meant 
>>>> to be
>>>> more of a side note.  I realize that is a completely separate issue.
>>>>
>>>> -- Allen
>>>>
>>>>
>>>>     
>>>> On Sat, 2006-01-14 at 01:36, Anil Gangolli wrote:
>>>>
>>>>
>>>>     
>>>>
>>>>> I think you might have misunderstood the thread.
>>>>>
>>>>> I wrote a guide that is on the Wiki about the Roller 
>>>>> internationalization and localization.  Start there for my current 
>>>>> understanding.  Currently the only thing that seems to work to 
>>>>> configure the application locale for the editing/admin interface 
>>>>> seems to be to set the default language/variant, etc as system 
>>>>> properties on the JVM.
>>>>>
>>>>> There is some internationalization/localization code written by 
>>>>> Jaap van der Molen prior to my being on the dev team.  I don't yet 
>>>>> understand how it is meant to work, but it seems to be trying to 
>>>>> support a locale specific to the client.  I think this is a good 
>>>>> goal.  Since finding it, I'm not sure if that code once worked and 
>>>>> has been broken, or never quite was finished, or perhaps it does 
>>>>> work and I don't know how to properly configure things.
>>>>>
>>>>> Sean wanted to at least be able to configure the editing/admin 
>>>>> locale without having to change the default locale properties on 
>>>>> the JVM.  I thought one could do this in one spot in 
>>>>> BasePageModel, but I'm no longer convinced that's possible.  I 
>>>>> think a prerequisite to making any significant progress in this 
>>>>> area is to understand Jaap's code, which I haven't yet had a 
>>>>> chance to really look over carefully enough to comprehend.
>>>>>
>>>>> Any insights would be appreciated.
>>>>> --a.
>>>>>
>>>>> Allen Gilliland wrote:
>>>>>
>>>>>  
>>>>>       
>>>>>
>>>>>> Sorry, I just caught up on this thread and wanted to chime in.
>>>>>>
>>>>>> I'm a little suprised that we weren't already doing this.  To be 
>>>>>> totally honest I actually thought that we were doing this and I 
>>>>>> guess I've just never tried changing my locale settings to test 
>>>>>> it.  What I'm wondering is what are the current translations of 
>>>>>> ApplicationResources being used for if not on the editing interface?
>>>>>>
>>>>>> I *definitely* think the file renaming thing is the wrong 
>>>>>> approach, so lets not go down that road.  I believe all we should 
>>>>>> need to do is set the proper locale using the "fmt" jsp tag.  If 
>>>>>> you look in web/taglibs.jsp it appears that the locale is being 
>>>>>> set there.
>>>>>>
>>>>>> What locale to set is somewhat more complicated.  I think the 
>>>>>> best option is to use the locale set in the users profile, but it 
>>>>>> would also make sense to use the browser locale.  I'm not sure 
>>>>>> which is better.
>>>>>>
>>>>>> I am actually gathering some notes on our overall approach to 
>>>>>> language support and I'm planning to try and make some changes on 
>>>>>> the weblog rendering side of things to make language support 
>>>>>> better.  One of the things that Dave pointed out a little while 
>>>>>> ago is that we cache content in a language sensative manner based 
>>>>>> on brower locales rather than the locales a weblog supports.  
>>>>>> This is a bit silly because there could be 3 copies of a page in 
>>>>>> the cache, one for en, ja, and sp languages even though the blog 
>>>>>> is only available in english.
>>>>>>
>>>>>> Anways, as I dig through the language stuff myself I'll try and 
>>>>>> keep my eyes out for anything that would be relevant to what's 
>>>>>> been discussed in this thread.
>>>>>>
>>>>>> -- Allen
>>>>>>
>>>>>>
>>>>>> On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
>>>>>>
>>>>>>
>>>>>>    
>>>>>>         
>>>>>>
>>>>>>> That's what we've discovered, too.  We're going to look into it 
>>>>>>> further next week.
>>>>>>>
>>>>>>> -- Sean
>>>>>>>
>>>>>>> Anil Gangolli wrote:
>>>>>>>  
>>>>>>>
>>>>>>>      
>>>>>>>           
>>>>>>>
>>>>>>>> I may be mistaken about the "one spot" for configuring the 
>>>>>>>> default locale (rather than using the JVM default).   I'm 
>>>>>>>> looking at and trying to understand a bunch of code written by 
>>>>>>>> Jaap van der Molen that seems to try to do the dynamic locale 
>>>>>>>> selection, but I haven't quite grasped everything.
>>>>>>>>
>>>>>>>> It may be more complex than I originally thought.
>>>>>>>>
>>>>>>>> --a.
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>   
>>>>>>>>        
>>>>>>>>             
>>>>>>>
>>>>>>    
>>>>>>         
>>>>>
>>>>
>>>>
>>>>     
>>>
>>
>>
>>  
>>
>
>


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
Great stuff Allen!  Thanks!

--a.

Allen Gilliland wrote:

>okay, I've just submitted a change that I think fixes this issue, at
>least for users logged into the editing interface.  I updated the
>taglibs.jsp file to set the locale for the jstl "fmt" tag based on the
>locale in a users profile.  if we think that the display should be based
>on browser locale then that's fairly easy to change.
>
>one slight drawback so far is that the locale you select in your profile
>sometimes doesn't correspond to one of the translations we have for
>ApplicationResources.  an example is that on the profile page you can
>select "Japanese" as your language and it sets your locale to "jp", but
>our japanese resources file is defined as "jp_JP", so it only goes into
>effect if the locale is "jp_JP".  We should probably just change our
>ja_JP resources file to just be ja.
>
>I tested with the language "Spanish (Spain)" and everything worked
>correctly for me.
>
>-- Allen
>
>
>On Sat, 2006-01-14 at 10:44, Anil Gangolli wrote:
>  
>
>>Allen Gilliland wrote:
>>
>>    
>>
>>>I understood this thread to be about how to get the Roller editing
>>>interface (/editor/*, /admin/*) to display in different languages.
>>> 
>>>
>>>      
>>>
>>Right.  That's the goal
>>
>>    
>>
>>>Setting the default language for the jvm is not a real option if you ask
>>>me.  On blogs.sun.com we need to support multiple languages at the same
>>>time, we can't just change the jvm language.  I'll take a look at it and
>>>see if I can't figure anything out.
>>> 
>>>
>>>      
>>>
>>That's all I know that really works right now, but I now suspect it's 
>>because we've broken the facility that Jaap put together.  We should fix 
>>it.  I'm happy to help.  Let us know what you figure out.  It's worth 
>>documenting better too.
>>
>>    
>>
>>>My comments about i18n on the rendering side of things were meant to be
>>>more of a side note.  I realize that is a completely separate issue.
>>>
>>>-- Allen
>>> 
>>>
>>>      
>>>
>>>On Sat, 2006-01-14 at 01:36, Anil Gangolli wrote:
>>> 
>>>
>>>      
>>>
>>>>I think you might have misunderstood the thread.
>>>>
>>>>I wrote a guide that is on the Wiki about the Roller 
>>>>internationalization and localization.  Start there for my current 
>>>>understanding.  Currently the only thing that seems to work to configure 
>>>>the application locale for the editing/admin interface seems to be to 
>>>>set the default language/variant, etc as system properties on the JVM.
>>>>
>>>>There is some internationalization/localization code written by Jaap van 
>>>>der Molen prior to my being on the dev team.  I don't yet understand how 
>>>>it is meant to work, but it seems to be trying to support a locale 
>>>>specific to the client.  I think this is a good goal.  Since finding it, 
>>>>I'm not sure if that code once worked and has been broken, or never 
>>>>quite was finished, or perhaps it does work and I don't know how to 
>>>>properly configure things.
>>>>
>>>>Sean wanted to at least be able to configure the editing/admin locale 
>>>>without having to change the default locale properties on the JVM.  I 
>>>>thought one could do this in one spot in BasePageModel, but I'm no 
>>>>longer convinced that's possible.  I think a prerequisite to making any 
>>>>significant progress in this area is to understand Jaap's code, which I 
>>>>haven't yet had a chance to really look over carefully enough to comprehend.
>>>>
>>>>Any insights would be appreciated.
>>>>--a.
>>>>
>>>>Allen Gilliland wrote:
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>Sorry, I just caught up on this thread and wanted to chime in.
>>>>>
>>>>>I'm a little suprised that we weren't already doing this.  To be totally honest I actually thought that we were doing this and I guess I've just never tried changing my locale settings to test it.  What I'm wondering is what are the current translations of ApplicationResources being used for if not on the editing interface?
>>>>>
>>>>>I *definitely* think the file renaming thing is the wrong approach, so lets not go down that road.  I believe all we should need to do is set the proper locale using the "fmt" jsp tag.  If you look in web/taglibs.jsp it appears that the locale is being set there.
>>>>>
>>>>>What locale to set is somewhat more complicated.  I think the best option is to use the locale set in the users profile, but it would also make sense to use the browser locale.  I'm not sure which is better.
>>>>>
>>>>>I am actually gathering some notes on our overall approach to language support and I'm planning to try and make some changes on the weblog rendering side of things to make language support better.  One of the things that Dave pointed out a little while ago is that we cache content in a language sensative manner based on brower locales rather than the locales a weblog supports.  This is a bit silly because there could be 3 copies of a page in the cache, one for en, ja, and sp languages even though the blog is only available in english.
>>>>>
>>>>>Anways, as I dig through the language stuff myself I'll try and keep my eyes out for anything that would be relevant to what's been discussed in this thread.
>>>>>
>>>>>-- Allen
>>>>>
>>>>>
>>>>>On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>>>That's what we've discovered, too.  We're going to look into it further 
>>>>>>next week.
>>>>>>
>>>>>>-- Sean
>>>>>>
>>>>>>Anil Gangolli wrote:
>>>>>>  
>>>>>>
>>>>>>       
>>>>>>
>>>>>>            
>>>>>>
>>>>>>>I may be mistaken about the "one spot" for configuring the default 
>>>>>>>locale (rather than using the JVM default).   I'm looking at and trying 
>>>>>>>to understand a bunch of code written by Jaap van der Molen that seems 
>>>>>>>to try to do the dynamic locale selection, but I haven't quite grasped 
>>>>>>>everything.
>>>>>>>
>>>>>>>It may be more complex than I originally thought.
>>>>>>>
>>>>>>>--a.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>    
>>>>>>>
>>>>>>>         
>>>>>>>
>>>>>>>              
>>>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>> 
>>>
>>>      
>>>
>
>
>  
>


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Sean Gilligan <se...@msgilligan.com>.
Allen Gilliland wrote:
> okay, I've just submitted a change that I think fixes this issue, at
> least for users logged into the editing interface.
Thanks!  Looking forward to checking it out...

Another issue with language/locale is that it can be difficult to set 
your language if the default locale is Japanese, you have to be able to 
know that 英語 is English to set your preferences correctly.  Perhaps a 
better solution would be to have the default be to use the "accept" 
language from the browser until set otherwise.

-- Sean



Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Allen Gilliland <Al...@Sun.COM>.
okay, I've just submitted a change that I think fixes this issue, at
least for users logged into the editing interface.  I updated the
taglibs.jsp file to set the locale for the jstl "fmt" tag based on the
locale in a users profile.  if we think that the display should be based
on browser locale then that's fairly easy to change.

one slight drawback so far is that the locale you select in your profile
sometimes doesn't correspond to one of the translations we have for
ApplicationResources.  an example is that on the profile page you can
select "Japanese" as your language and it sets your locale to "jp", but
our japanese resources file is defined as "jp_JP", so it only goes into
effect if the locale is "jp_JP".  We should probably just change our
ja_JP resources file to just be ja.

I tested with the language "Spanish (Spain)" and everything worked
correctly for me.

-- Allen


On Sat, 2006-01-14 at 10:44, Anil Gangolli wrote:
> Allen Gilliland wrote:
> 
> >I understood this thread to be about how to get the Roller editing
> >interface (/editor/*, /admin/*) to display in different languages.
> >  
> >
> Right.  That's the goal
> 
> >Setting the default language for the jvm is not a real option if you ask
> >me.  On blogs.sun.com we need to support multiple languages at the same
> >time, we can't just change the jvm language.  I'll take a look at it and
> >see if I can't figure anything out.
> >  
> >
> That's all I know that really works right now, but I now suspect it's 
> because we've broken the facility that Jaap put together.  We should fix 
> it.  I'm happy to help.  Let us know what you figure out.  It's worth 
> documenting better too.
> 
> >My comments about i18n on the rendering side of things were meant to be
> >more of a side note.  I realize that is a completely separate issue.
> >
> >-- Allen
> >  
> >
> 
> >
> >On Sat, 2006-01-14 at 01:36, Anil Gangolli wrote:
> >  
> >
> >>I think you might have misunderstood the thread.
> >>
> >>I wrote a guide that is on the Wiki about the Roller 
> >>internationalization and localization.  Start there for my current 
> >>understanding.  Currently the only thing that seems to work to configure 
> >>the application locale for the editing/admin interface seems to be to 
> >>set the default language/variant, etc as system properties on the JVM.
> >>
> >>There is some internationalization/localization code written by Jaap van 
> >>der Molen prior to my being on the dev team.  I don't yet understand how 
> >>it is meant to work, but it seems to be trying to support a locale 
> >>specific to the client.  I think this is a good goal.  Since finding it, 
> >>I'm not sure if that code once worked and has been broken, or never 
> >>quite was finished, or perhaps it does work and I don't know how to 
> >>properly configure things.
> >>
> >>Sean wanted to at least be able to configure the editing/admin locale 
> >>without having to change the default locale properties on the JVM.  I 
> >>thought one could do this in one spot in BasePageModel, but I'm no 
> >>longer convinced that's possible.  I think a prerequisite to making any 
> >>significant progress in this area is to understand Jaap's code, which I 
> >>haven't yet had a chance to really look over carefully enough to comprehend.
> >>
> >>Any insights would be appreciated.
> >>--a.
> >>
> >>Allen Gilliland wrote:
> >>
> >>    
> >>
> >>>Sorry, I just caught up on this thread and wanted to chime in.
> >>>
> >>>I'm a little suprised that we weren't already doing this.  To be totally honest I actually thought that we were doing this and I guess I've just never tried changing my locale settings to test it.  What I'm wondering is what are the current translations of ApplicationResources being used for if not on the editing interface?
> >>>
> >>>I *definitely* think the file renaming thing is the wrong approach, so lets not go down that road.  I believe all we should need to do is set the proper locale using the "fmt" jsp tag.  If you look in web/taglibs.jsp it appears that the locale is being set there.
> >>>
> >>>What locale to set is somewhat more complicated.  I think the best option is to use the locale set in the users profile, but it would also make sense to use the browser locale.  I'm not sure which is better.
> >>>
> >>>I am actually gathering some notes on our overall approach to language support and I'm planning to try and make some changes on the weblog rendering side of things to make language support better.  One of the things that Dave pointed out a little while ago is that we cache content in a language sensative manner based on brower locales rather than the locales a weblog supports.  This is a bit silly because there could be 3 copies of a page in the cache, one for en, ja, and sp languages even though the blog is only available in english.
> >>>
> >>>Anways, as I dig through the language stuff myself I'll try and keep my eyes out for anything that would be relevant to what's been discussed in this thread.
> >>>
> >>>-- Allen
> >>>
> >>>
> >>>On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
> >>> 
> >>>
> >>>      
> >>>
> >>>>That's what we've discovered, too.  We're going to look into it further 
> >>>>next week.
> >>>>
> >>>>-- Sean
> >>>>
> >>>>Anil Gangolli wrote:
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>>>I may be mistaken about the "one spot" for configuring the default 
> >>>>>locale (rather than using the JVM default).   I'm looking at and trying 
> >>>>>to understand a bunch of code written by Jaap van der Molen that seems 
> >>>>>to try to do the dynamic locale selection, but I haven't quite grasped 
> >>>>>everything.
> >>>>>
> >>>>>It may be more complex than I originally thought.
> >>>>>
> >>>>>--a.
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>>     
> >>>>>
> >>>>>          
> >>>>>
> >>> 
> >>>
> >>>      
> >>>
> >
> >
> >  
> >
> 


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.

Allen Gilliland wrote:

>I understood this thread to be about how to get the Roller editing
>interface (/editor/*, /admin/*) to display in different languages.
>  
>
Right.  That's the goal

>Setting the default language for the jvm is not a real option if you ask
>me.  On blogs.sun.com we need to support multiple languages at the same
>time, we can't just change the jvm language.  I'll take a look at it and
>see if I can't figure anything out.
>  
>
That's all I know that really works right now, but I now suspect it's 
because we've broken the facility that Jaap put together.  We should fix 
it.  I'm happy to help.  Let us know what you figure out.  It's worth 
documenting better too.

>My comments about i18n on the rendering side of things were meant to be
>more of a side note.  I realize that is a completely separate issue.
>
>-- Allen
>  
>

>
>On Sat, 2006-01-14 at 01:36, Anil Gangolli wrote:
>  
>
>>I think you might have misunderstood the thread.
>>
>>I wrote a guide that is on the Wiki about the Roller 
>>internationalization and localization.  Start there for my current 
>>understanding.  Currently the only thing that seems to work to configure 
>>the application locale for the editing/admin interface seems to be to 
>>set the default language/variant, etc as system properties on the JVM.
>>
>>There is some internationalization/localization code written by Jaap van 
>>der Molen prior to my being on the dev team.  I don't yet understand how 
>>it is meant to work, but it seems to be trying to support a locale 
>>specific to the client.  I think this is a good goal.  Since finding it, 
>>I'm not sure if that code once worked and has been broken, or never 
>>quite was finished, or perhaps it does work and I don't know how to 
>>properly configure things.
>>
>>Sean wanted to at least be able to configure the editing/admin locale 
>>without having to change the default locale properties on the JVM.  I 
>>thought one could do this in one spot in BasePageModel, but I'm no 
>>longer convinced that's possible.  I think a prerequisite to making any 
>>significant progress in this area is to understand Jaap's code, which I 
>>haven't yet had a chance to really look over carefully enough to comprehend.
>>
>>Any insights would be appreciated.
>>--a.
>>
>>Allen Gilliland wrote:
>>
>>    
>>
>>>Sorry, I just caught up on this thread and wanted to chime in.
>>>
>>>I'm a little suprised that we weren't already doing this.  To be totally honest I actually thought that we were doing this and I guess I've just never tried changing my locale settings to test it.  What I'm wondering is what are the current translations of ApplicationResources being used for if not on the editing interface?
>>>
>>>I *definitely* think the file renaming thing is the wrong approach, so lets not go down that road.  I believe all we should need to do is set the proper locale using the "fmt" jsp tag.  If you look in web/taglibs.jsp it appears that the locale is being set there.
>>>
>>>What locale to set is somewhat more complicated.  I think the best option is to use the locale set in the users profile, but it would also make sense to use the browser locale.  I'm not sure which is better.
>>>
>>>I am actually gathering some notes on our overall approach to language support and I'm planning to try and make some changes on the weblog rendering side of things to make language support better.  One of the things that Dave pointed out a little while ago is that we cache content in a language sensative manner based on brower locales rather than the locales a weblog supports.  This is a bit silly because there could be 3 copies of a page in the cache, one for en, ja, and sp languages even though the blog is only available in english.
>>>
>>>Anways, as I dig through the language stuff myself I'll try and keep my eyes out for anything that would be relevant to what's been discussed in this thread.
>>>
>>>-- Allen
>>>
>>>
>>>On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
>>> 
>>>
>>>      
>>>
>>>>That's what we've discovered, too.  We're going to look into it further 
>>>>next week.
>>>>
>>>>-- Sean
>>>>
>>>>Anil Gangolli wrote:
>>>>   
>>>>
>>>>        
>>>>
>>>>>I may be mistaken about the "one spot" for configuring the default 
>>>>>locale (rather than using the JVM default).   I'm looking at and trying 
>>>>>to understand a bunch of code written by Jaap van der Molen that seems 
>>>>>to try to do the dynamic locale selection, but I haven't quite grasped 
>>>>>everything.
>>>>>
>>>>>It may be more complex than I originally thought.
>>>>>
>>>>>--a.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>> 
>>>
>>>      
>>>
>
>
>  
>


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Allen Gilliland <Al...@Sun.COM>.
I understood this thread to be about how to get the Roller editing
interface (/editor/*, /admin/*) to display in different languages.

Setting the default language for the jvm is not a real option if you ask
me.  On blogs.sun.com we need to support multiple languages at the same
time, we can't just change the jvm language.  I'll take a look at it and
see if I can't figure anything out.

My comments about i18n on the rendering side of things were meant to be
more of a side note.  I realize that is a completely separate issue.

-- Allen


On Sat, 2006-01-14 at 01:36, Anil Gangolli wrote:
> I think you might have misunderstood the thread.
> 
> I wrote a guide that is on the Wiki about the Roller 
> internationalization and localization.  Start there for my current 
> understanding.  Currently the only thing that seems to work to configure 
> the application locale for the editing/admin interface seems to be to 
> set the default language/variant, etc as system properties on the JVM.
> 
> There is some internationalization/localization code written by Jaap van 
> der Molen prior to my being on the dev team.  I don't yet understand how 
> it is meant to work, but it seems to be trying to support a locale 
> specific to the client.  I think this is a good goal.  Since finding it, 
> I'm not sure if that code once worked and has been broken, or never 
> quite was finished, or perhaps it does work and I don't know how to 
> properly configure things.
> 
> Sean wanted to at least be able to configure the editing/admin locale 
> without having to change the default locale properties on the JVM.  I 
> thought one could do this in one spot in BasePageModel, but I'm no 
> longer convinced that's possible.  I think a prerequisite to making any 
> significant progress in this area is to understand Jaap's code, which I 
> haven't yet had a chance to really look over carefully enough to comprehend.
> 
> Any insights would be appreciated.
> --a.
> 
> Allen Gilliland wrote:
> 
> >Sorry, I just caught up on this thread and wanted to chime in.
> >
> >I'm a little suprised that we weren't already doing this.  To be totally honest I actually thought that we were doing this and I guess I've just never tried changing my locale settings to test it.  What I'm wondering is what are the current translations of ApplicationResources being used for if not on the editing interface?
> >
> >I *definitely* think the file renaming thing is the wrong approach, so lets not go down that road.  I believe all we should need to do is set the proper locale using the "fmt" jsp tag.  If you look in web/taglibs.jsp it appears that the locale is being set there.
> >
> >What locale to set is somewhat more complicated.  I think the best option is to use the locale set in the users profile, but it would also make sense to use the browser locale.  I'm not sure which is better.
> >
> >I am actually gathering some notes on our overall approach to language support and I'm planning to try and make some changes on the weblog rendering side of things to make language support better.  One of the things that Dave pointed out a little while ago is that we cache content in a language sensative manner based on brower locales rather than the locales a weblog supports.  This is a bit silly because there could be 3 copies of a page in the cache, one for en, ja, and sp languages even though the blog is only available in english.
> >
> >Anways, as I dig through the language stuff myself I'll try and keep my eyes out for anything that would be relevant to what's been discussed in this thread.
> >
> >-- Allen
> >
> >
> >On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
> >  
> >
> >>That's what we've discovered, too.  We're going to look into it further 
> >>next week.
> >>
> >>-- Sean
> >>
> >>Anil Gangolli wrote:
> >>    
> >>
> >>>I may be mistaken about the "one spot" for configuring the default 
> >>>locale (rather than using the JVM default).   I'm looking at and trying 
> >>>to understand a bunch of code written by Jaap van der Molen that seems 
> >>>to try to do the dynamic locale selection, but I haven't quite grasped 
> >>>everything.
> >>>
> >>>It may be more complex than I originally thought.
> >>>
> >>>--a.
> >>>
> >>>
> >>>
> >>>
> >>>      
> >>>
> >
> >
> >  
> >
> 


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
I think you might have misunderstood the thread.

I wrote a guide that is on the Wiki about the Roller 
internationalization and localization.  Start there for my current 
understanding.  Currently the only thing that seems to work to configure 
the application locale for the editing/admin interface seems to be to 
set the default language/variant, etc as system properties on the JVM.

There is some internationalization/localization code written by Jaap van 
der Molen prior to my being on the dev team.  I don't yet understand how 
it is meant to work, but it seems to be trying to support a locale 
specific to the client.  I think this is a good goal.  Since finding it, 
I'm not sure if that code once worked and has been broken, or never 
quite was finished, or perhaps it does work and I don't know how to 
properly configure things.

Sean wanted to at least be able to configure the editing/admin locale 
without having to change the default locale properties on the JVM.  I 
thought one could do this in one spot in BasePageModel, but I'm no 
longer convinced that's possible.  I think a prerequisite to making any 
significant progress in this area is to understand Jaap's code, which I 
haven't yet had a chance to really look over carefully enough to comprehend.

Any insights would be appreciated.
--a.

Allen Gilliland wrote:

>Sorry, I just caught up on this thread and wanted to chime in.
>
>I'm a little suprised that we weren't already doing this.  To be totally honest I actually thought that we were doing this and I guess I've just never tried changing my locale settings to test it.  What I'm wondering is what are the current translations of ApplicationResources being used for if not on the editing interface?
>
>I *definitely* think the file renaming thing is the wrong approach, so lets not go down that road.  I believe all we should need to do is set the proper locale using the "fmt" jsp tag.  If you look in web/taglibs.jsp it appears that the locale is being set there.
>
>What locale to set is somewhat more complicated.  I think the best option is to use the locale set in the users profile, but it would also make sense to use the browser locale.  I'm not sure which is better.
>
>I am actually gathering some notes on our overall approach to language support and I'm planning to try and make some changes on the weblog rendering side of things to make language support better.  One of the things that Dave pointed out a little while ago is that we cache content in a language sensative manner based on brower locales rather than the locales a weblog supports.  This is a bit silly because there could be 3 copies of a page in the cache, one for en, ja, and sp languages even though the blog is only available in english.
>
>Anways, as I dig through the language stuff myself I'll try and keep my eyes out for anything that would be relevant to what's been discussed in this thread.
>
>-- Allen
>
>
>On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
>  
>
>>That's what we've discovered, too.  We're going to look into it further 
>>next week.
>>
>>-- Sean
>>
>>Anil Gangolli wrote:
>>    
>>
>>>I may be mistaken about the "one spot" for configuring the default 
>>>locale (rather than using the JVM default).   I'm looking at and trying 
>>>to understand a bunch of code written by Jaap van der Molen that seems 
>>>to try to do the dynamic locale selection, but I haven't quite grasped 
>>>everything.
>>>
>>>It may be more complex than I originally thought.
>>>
>>>--a.
>>>
>>>
>>>
>>>
>>>      
>>>
>
>
>  
>


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Allen Gilliland <Al...@Sun.COM>.
Sorry, I just caught up on this thread and wanted to chime in.

I'm a little suprised that we weren't already doing this.  To be totally honest I actually thought that we were doing this and I guess I've just never tried changing my locale settings to test it.  What I'm wondering is what are the current translations of ApplicationResources being used for if not on the editing interface?

I *definitely* think the file renaming thing is the wrong approach, so lets not go down that road.  I believe all we should need to do is set the proper locale using the "fmt" jsp tag.  If you look in web/taglibs.jsp it appears that the locale is being set there.

What locale to set is somewhat more complicated.  I think the best option is to use the locale set in the users profile, but it would also make sense to use the browser locale.  I'm not sure which is better.

I am actually gathering some notes on our overall approach to language support and I'm planning to try and make some changes on the weblog rendering side of things to make language support better.  One of the things that Dave pointed out a little while ago is that we cache content in a language sensative manner based on brower locales rather than the locales a weblog supports.  This is a bit silly because there could be 3 copies of a page in the cache, one for en, ja, and sp languages even though the blog is only available in english.

Anways, as I dig through the language stuff myself I'll try and keep my eyes out for anything that would be relevant to what's been discussed in this thread.

-- Allen


On Fri, 2006-01-13 at 07:28, Sean Gilligan wrote:
> That's what we've discovered, too.  We're going to look into it further 
> next week.
> 
> -- Sean
> 
> Anil Gangolli wrote:
> > 
> > I may be mistaken about the "one spot" for configuring the default 
> > locale (rather than using the JVM default).   I'm looking at and trying 
> > to understand a bunch of code written by Jaap van der Molen that seems 
> > to try to do the dynamic locale selection, but I haven't quite grasped 
> > everything.
> > 
> > It may be more complex than I originally thought.
> > 
> > --a.
> > 
> > 
> > 
> > 
> 


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Sean Gilligan <se...@msgilligan.com>.
That's what we've discovered, too.  We're going to look into it further 
next week.

-- Sean

Anil Gangolli wrote:
> 
> I may be mistaken about the "one spot" for configuring the default 
> locale (rather than using the JVM default).   I'm looking at and trying 
> to understand a bunch of code written by Jaap van der Molen that seems 
> to try to do the dynamic locale selection, but I haven't quite grasped 
> everything.
> 
> It may be more complex than I originally thought.
> 
> --a.
> 
> 
> 
> 


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
I may be mistaken about the "one spot" for configuring the default 
locale (rather than using the JVM default).   I'm looking at and trying 
to understand a bunch of code written by Jaap van der Molen that seems 
to try to do the dynamic locale selection, but I haven't quite grasped 
everything.

It may be more complex than I originally thought.

--a.



Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
Point taken.  As I said, I'll put in the improvement.  Please file a 
JIRA request and I'll get to it soon.

Sean Gilligan wrote:

> Anil Gangolli wrote:
>
>> I don't think it's that valuable to do this over just renaming the 
>> ApplicationResources.properties files to get the desired effect, but 
>> it shouldn't be very hard to make the changes you want.
>
>
> Actually, it is more valuable than you might think.  Renaming 
> ApplicationResources_ja_JP.properties to 
> ApplicationResources.properties results in a "missing property" error 
> message, because ApplicationResources_ja_JP.properties does not 
> contain all the properties and can't fall back to English because of 
> the rename.
>
> -- Sean
>
>


Re: Locale configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Sean Gilligan <se...@msgilligan.com>.
Anil Gangolli wrote:

> I don't think it's that valuable to do this over just renaming the 
> ApplicationResources.properties files to get the desired effect, but it 
> shouldn't be very hard to make the changes you want.

Actually, it is more valuable than you might think.  Renaming 
ApplicationResources_ja_JP.properties to ApplicationResources.properties 
results in a "missing property" error message, because 
ApplicationResources_ja_JP.properties does not contain all the 
properties and can't fall back to English because of the rename.

-- Sean

Re: Local configuration [Fwd: Re: Multi-language ApplicationResources.properties?]

Posted by Anil Gangolli <an...@busybuddha.org>.
Sean:

To do what you describe, the "one spot" is BasePageModel; I think that's 
all that would need to change for your desired thing.  The bundle is 
currently initialized in a static initializer using the default locale 
(no locale argument supplied).  You'd have to change that to initialize, 
say on construction, using a Locale determined by a property (obtained 
via RollerConfig.getProperty(...)).

I don't think it's that valuable to do this over just renaming the 
ApplicationResources.properties files to get the desired effect, but it 
shouldn't be very hard to make the changes you want.

I think it's worth discussing further why we don't/can't/shouldn't 
choose the bundle locale dynamically per request based on what we can 
determine from the browser, or using the logged in user's configured 
locale.  I don't have a concrete proposal.

--a.


Sean Gilligan wrote:

> Hello Anil, et. al.
>
> What we'd like to do is just add a property in roller.properties that 
> if present overrides the JVM's default locale.  (At a minimum, I'm 
> assuming this is easier than making it work based upon the request or 
> the user's preference, but I don't know yet.)
>
> > Also, you could modify the code (essentially one spot) to
> > use a separately configured locale rather than the JVM default.
>
> Where is that "one spot"?
>
> Thanks,
>
> Sean
>
> -------- Original Message --------
> From: - Thu Jan  5 08:05:22 2006
> X-Account-Key: account3
> X-UIDL: 6f4753a2af27facefef3c1c510c92533
> X-Mozilla-Status: 1011
> X-Mozilla-Status2: 00000000
> Received: from mail.apache.org (hermes.apache.org 
> [209.237.227.199])    by groundhog.opsystems.com (8.11.6/8.11.6) with 
> SMTP id k05Eogv07126    for <se...@msgilligan.com>; Thu, 5 Jan 
> 2006 06:50:43 -0800 (PST)
> Received: (qmail 10239 invoked by uid 500); 5 Jan 2006 15:03:07 -0000
> Mailing-List: contact roller-user-help@incubator.apache.org; run by ezmlm
> Precedence: bulk
> List-Help: <ma...@incubator.apache.org>
> List-Unsubscribe: <ma...@incubator.apache.org>
> List-Post: <ma...@incubator.apache.org>
> List-Id: <roller-user.incubator.apache.org>
> Reply-To: roller-user@incubator.apache.org
> Delivered-To: mailing list roller-user@incubator.apache.org
> Received: (qmail 10199 invoked by uid 99); 5 Jan 2006 15:03:07 -0000
> Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) 
> by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2006 07:03:07 -0800
> X-ASF-Spam-Status: No, hits=0.0 required=10.0    tests=
> X-Spam-Check-By: apache.org
> Received-SPF: pass (asf.osuosl.org: local policy)
> Received: from [64.142.80.182] (HELO busybuddha.org) (64.142.80.182) 
> by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2006 07:03:06 -0800
> Received: from [127.0.0.1] (pear.busybuddha.org [64.142.80.182])    by 
> busybuddha.org (8.13.1/8.12.11) with ESMTP id k05F9qIe025080    for 
> <ro...@incubator.apache.org>; Thu, 5 Jan 2006 07:09:53 -0800
> Message-ID: <43...@busybuddha.org>
> Date: Thu, 05 Jan 2006 07:03:19 -0800
> From: Anil Gangolli <an...@busybuddha.org>
> User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
> X-Accept-Language: en-us, en
> MIME-Version: 1.0
> To: roller-user@incubator.apache.org
> Subject: Re: Multi-language ApplicationResources.properties?
> References: <43...@msgilligan.com>
> In-Reply-To: <43...@msgilligan.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> Content-Transfer-Encoding: 7bit
> X-Virus-Checked: Checked by ClamAV on apache.org
> X-UIDL: 6f4753a2af27facefef3c1c510c92533
>
> Sean Gilligan wrote:
>
>> Is there a way to have each user of Roller get the Struts UI screens 
>> in the language of his/her configured locale?
>>
> Currently, no, but determining the locale based on either the user's
> configured locale or the request headers is an enhancement that I think
> we ought to support.
>
> I'm not sure why we don't do this already, and if there are any issues
> with it.  This probably deserves some discussion on the roller-dev list.
>
>> Or, if that is not possible, Is there a way to change the 
>> ApplicationResources file used without changing the default locale of 
>> the Tomcat JVM?
>
>
> Well, certainly, you should be able to move the desired
> ApplicationResources_<localespec>.properties file into the default
> position ApplicationResources.properties (no locale), removing all of
> the others.  Also, you could modify the code (essentially one spot) to
> use a separately configured locale rather than the JVM default.
>
>>
>> Thanks,
>>
>> Sean
>>
>>
>
>
>
>