N
Novice
This is basically a variant on the "additional logging questions" thread
I just started but with a focus on i18n.
I'd like all of my classes to be locale-sensitive so that all of the
things they are displaying in GUIs, including text and error messages,
are displayed in the user's language (or, more precisely, the language in
the resource bundle that is the "closest fit" to the language of the
user).
Given that my programs instantiate a variety of classes that themselves
display text or error messages, those classes also need to know what
locale the program is using. Would I be right to pass a reference to the
locale of the main program to each class that it instantiates? Or should
I be doing things differently?
Also, what if a class isn't GUI-related at all? Should I still pass a
locale anyway? Again, I'm thinking of things like Enums. I wouldn't
normally expect an Enum to display text of any kind to a user, at least
directly. (The enum might determine that day number 1 in the week is
Monday and pass Monday to a class that displays that but the enum itself
isn't displaying Monday.) What about a holder class (again, assuming I'm
using that term correctly; I described my guess in the "additional
logging questions" thread): I don't see much need for it to ever display
text to a user (or an error message).
And what about logs? I know that the java.util.logging classes provide
for resource bundles so that the messages in the logs can be in other
languages. How common is it for log messages to be in languages other
than English? I have no experience with that. So much computer-related
stuff seems to be in English first (or English only) that I'm not sure if
a European company, say, would write log messages in English even if it
isn't the main local language (in Germany say) or would they often write
them in the local language?
I just started but with a focus on i18n.
I'd like all of my classes to be locale-sensitive so that all of the
things they are displaying in GUIs, including text and error messages,
are displayed in the user's language (or, more precisely, the language in
the resource bundle that is the "closest fit" to the language of the
user).
Given that my programs instantiate a variety of classes that themselves
display text or error messages, those classes also need to know what
locale the program is using. Would I be right to pass a reference to the
locale of the main program to each class that it instantiates? Or should
I be doing things differently?
Also, what if a class isn't GUI-related at all? Should I still pass a
locale anyway? Again, I'm thinking of things like Enums. I wouldn't
normally expect an Enum to display text of any kind to a user, at least
directly. (The enum might determine that day number 1 in the week is
Monday and pass Monday to a class that displays that but the enum itself
isn't displaying Monday.) What about a holder class (again, assuming I'm
using that term correctly; I described my guess in the "additional
logging questions" thread): I don't see much need for it to ever display
text to a user (or an error message).
And what about logs? I know that the java.util.logging classes provide
for resource bundles so that the messages in the logs can be in other
languages. How common is it for log messages to be in languages other
than English? I have no experience with that. So much computer-related
stuff seems to be in English first (or English only) that I'm not sure if
a European company, say, would write log messages in English even if it
isn't the main local language (in Germany say) or would they often write
them in the local language?