M
Marco
Hi all,
I am struggling with the Java interfaces about resource bundles. I've
written a simple class that works like this:
public class i18n
{
private static final String BUNDLE_NAME = "user_messages";
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle ( BUNDLE_NAME );
/** Gets the message pattern corresponding to the key and apply it to
the other arguments. */
public static String msg ( String key, Object... args )
}
I've put a test file "user_message.properties" in the same jar where
this class is, let's say it is i18n.jar. As long as I am using the
same jar, all works fine. Now, I want to use the class above in
another jar, let's say app.jar (by passing both to java's -cp option),
where there is another copy of user_messages.properties, that should
be used in place of the original one.
Well, that doesn't happen at all, only the messages in the original
i18n.jar are recognized. Is there any way to load a bundle that is in
one jar, with code that is in another jar? For the moment I am just
removing any user_messages.properties from i18n.jar, but I'd rather
not to do it and I'd like to understand more about the issue.
Thanks in advance for any help.
Marco.
I am struggling with the Java interfaces about resource bundles. I've
written a simple class that works like this:
public class i18n
{
private static final String BUNDLE_NAME = "user_messages";
private static final ResourceBundle RESOURCE_BUNDLE =
ResourceBundle.getBundle ( BUNDLE_NAME );
/** Gets the message pattern corresponding to the key and apply it to
the other arguments. */
public static String msg ( String key, Object... args )
}
I've put a test file "user_message.properties" in the same jar where
this class is, let's say it is i18n.jar. As long as I am using the
same jar, all works fine. Now, I want to use the class above in
another jar, let's say app.jar (by passing both to java's -cp option),
where there is another copy of user_messages.properties, that should
be used in place of the original one.
Well, that doesn't happen at all, only the messages in the original
i18n.jar are recognized. Is there any way to load a bundle that is in
one jar, with code that is in another jar? For the moment I am just
removing any user_messages.properties from i18n.jar, but I'd rather
not to do it and I'd like to understand more about the issue.
Thanks in advance for any help.
Marco.