-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internationalizing Carcassonne.jar #10
base: master
Are you sure you want to change the base?
Conversation
I would agree with you that error and exception messages should probably stay in English. public class Messages {
private static final String BUNDLE_NAME = Messages.class.getPackageName() + ".messages"; //$NON-NLS-1$
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
private Messages() {
}
public static String getString(String key) {
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
return '!' + key + '!';
}
}
}
For the keys, more descriptive names are better. |
Actually, this is my first time writing Java code. Looking at your code, I am acutely aware of how little I know about the Java language, Java packages, or object-oriented programming. |
No worries, we are not in a hurry, since this is just a hobby project. Maybe I will find time to do the foundation for internationalization. I will keep you posted. |
#9
For now, I have decided to forego internationalizing error messages and thrown strings, which are rarely encountered by typical application users.
I thought the error message should be made known to developers and contributors, and it would be better if it remained as the original string.
So I'm internationalizing the menus, major dialog boxes, and tooltip strings and adding Japanese locales in addition to English.
Please let me know if you have any undesirable coding or better ideas.