Re: Design Questions about static factory classes
On Fri, 21 May 2010, Rhino wrote:
I'm very familiar with resource bundles at a detail; I use them quite
frequently. I'm not quite clear on the "big picture" though. I lack any
significant real-world experience with how "multilingual" systems are
written with Java. For instance, if I were a developer whose native
language was French would I typically install a French-language JVM,
read the Java API in French, and write my system so that it never chose
or changed Locales? Would my classes simply make use of the Resource
Bundles I had written in French and would I leave it up to foreign
purchasers of my system to simply translate the ResourceBundles for
their own languages?
If you were French, you might.
But in general, i don't think there's any correlation between the
languages of the system and of its developers. A French developer might
well have his machine's locale set to fr_FR, and he might well read
documentation in french (if there is such a thing - i've seen some Sun
documentation translated into japanese, but rarely into European languages
other than english), but he ought to have his JVM set to run in one of the
languages the system is being built for, and he ought to routinely test it
in other such languages.
For instance, i'm currently on a project which will roll out to 23
countries in the first wave. They're all European and North Amererican,
and in a slightly weird twist, to begin with we're only supporting
english, french, and german as languages. So, if you're a native of the
UK, the US, Canada, France, Switzerland, Luxembourg or a few other places,
you have your own language, but if you live in Hungary or the Netherlands,
you'll have to be able to read english, or in some cases in eastern
Europe, german. In the second wave, Korea will be added, and for that,
there will be korean. I assume that in later waves, there will be proper
localisation into national languages, but i haven't heard about that. By
that point, such localisation would not require programmer input (or at
least only a tiny bit) - the client's content management team will be able
to add new locales and their corresponding translations to the system
themselves. We're keeping translations in a database rather than resource
bundle files, so they can do this to a running system without having to
modify the codebase.
Anyway, we're British, the client's programmers are American (well,
they're in America, and are either American or Indian), the contractors we
had involved a while ago were Indian (a mix of hindi, telugu and malayalam
speakers), and the client's HQ, including their infrastructure guys and
the virtual machines where we all work, is in Denmark. We all work in
english. I think the JVM default locale is en_US throughout.
So, a daily feature of our project is an Indian programmer in an office in
the US using a machine in Denmark to look at content in german which will
be shown to customers in the Czech Republic.
I have no idea if any of this answers your question.
Also, is there much need for systems in which the user can switch
languages on the fly? In other words, let's say I'm working in a system
that uses French language ResourceBundles but am finding that the French
is not to my liking - maybe it's Quebecois instead of Parisian - and I
realize that I will understand better in my second language, English,
which I learned by watching MTV. Would a system typically have the
capability of letting the user invoke a switch to another language via
setLocale()? Or would I install an English-language JVM and run my
system on that?
I wouldn't expect to have to install a second JVM. I also wouldn't expect
to be able to change locale on the fly - i might try it, but i wouldn't be
surprised if it didn't work. I would expect that i'd be able to get what i
wanted by killing the system and restarting with the following parameters
added to the java command line (assuming a Sun java):
-Duser.language=en -Duser.country=GB
Hold on, that doesn't quite make sense. I don't recall any language
selection option any time I've installed Java. The language of the JVM
comes from a system property which I can presumably change. Hmm, I
wonder if I should take a minute and switch my language to see what kind
of output I get from core Java classes. Will the message that comes with
my Exception be in the newly-chosen language?.... I should answer this
question for myself with a bit of experimentation....
Experimentation is often a very good thing to do.
tom
--
They entered the Vortex and the dreams became reality