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.