li.strolch.agent.I18nAgent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agent Show documentation
Show all versions of agent Show documentation
Strolch Agent which is the runtime for Strolch
The newest version!
package li.strolch.agent;
import java.util.Locale;
import java.util.ResourceBundle;
public class I18nAgent {
private static final String BUNDLE = "strolch-agent";
public static final ResourceBundle i18nAgent = ResourceBundle.getBundle(BUNDLE);
public static ResourceBundle getBundle(Locale locale) {
return ResourceBundle.getBundle(BUNDLE, locale);
}
public static String i18n(Locale locale, String key) {
ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE, locale);
if (bundle.containsKey(key))
return bundle.getString(key);
return key;
}
}