On 22-05-2010 15:05, Rhino wrote:
Arne Vajh?j<a...@vajhoej.dk> wrote in
I think it depends a lot of the context you develop software in.
Global or local development?
global => do development in English
local => pick English or local language as you prefer
Are you developing single-customer project-style software or
multi-customer product-style software?
product => internationalize, have English and then add to
supported languages as customers require them (note that
customers can want 3 things A) English version, B) local
version C) Choice of English for local for end users
project => whatever the customer wants
And then we have not even talked about interesting countries
like Belgium and Switzerland with multiple official languages
(Canada is easier because one of the languages is English).
That is not a clear answer, but it is a complex question!
It certainly is. I'm trying to write code that will be easily usable by
non-English speakers. But my code isn't actually being written for a
specific customer at this time, other than me. At the moment, I'm trying
to put together a sort of code portfolio. I'm hoping it will show
prospective employers or clients that I am culturally sensitive enough to
write code that will work in multiple languages and knowledgeable on how
to do it. In other words, I don't just want to claim that I am culturally
sensitive but then have no code to back that up. When they challenge me
to prove that I can write code that works for customers in various
locales, I want to be able to point them to some decent examples where I
have done that. I'm just trying to figure out the best way to do that
right now.....
Do you just want to support western languages?
Or do you also want to solve the difficult problems?
That problem is not so important. You would not want to display
Java exception text to end-users anyway.
Really? I find that a surprising thing to say. Maybe we're not talking
about the same thing.
I'm thinking of a situation like completing a form in a GUI. The customer
has to enter his date of birth. Let's say that I can't use a JSpinner for
some reason; it can't do everything I need it to do. The customer is
given a simple JTextField for entering a date. Clearly, the customer
would have many opportunities to enter bad data. He could type in 1985-
15-31 when he meant to type 1985-05-01; the first value is obviously a
bad date since there are only 12 months in the year, not 15. My practice
is to write edits that check for that kind of mistake and generate an
exception, typically IllegalArgumentException, with a clear error message
that reminds the user that there is no such month as '15'. Naturally, the
customer might not be an English speaker so I put all such messages in
ResourceBundles so that other bundles can easily be added for any
languages that I support.
How would you handle such a situation?
Catch the exception but display something else that the exception text.
Exceptions texts are for log files to be handed over to developers.
For user input I don't even think that you should throw an
exception. Maybe just test and tell the user to correct.
Bad user input is not really exceptional enough to justify an
exception.
a "user error" message....