资源包我有四个属性文件加载多个区域特定的属性文件在Java
- Application.properties
- Application_fr_FR.properties
- Database.properties
- Database_fr_FR.properties
所以现在我需要多个程序国际化,所以现在我需要加载多个属性文件并从特定于语言环境的属性文件中获取值 - 键值对。为此我有一个ResourceBundleService.java
public class ResourceBundleService {
private static String language;
private static String country;
private static Locale currentLocale;
static ResourceBundle labels;
static {
labels = ResourceBundle
.getBundle("uday.properties.Application");
labels = append(Database.properties");
//** how to append existing resource bundle with new properties file?
}
public static String getLabel(String resourceIndex, Locale locale) {
return labels.getString(resourceIndex);
//How to get locale specific messages??
}
}
希望这个问题很清楚。
噢谢谢你有关内部缓存的信息,但是我怎样调用多个属性文件?????? –
噢谢谢你有关内部缓存的信息,但是我如何调用多个属性文件?????? –
我怀疑这是比试图在应用程序中首先找到的更好的解决方案,如果在数据库中找不到,请参阅更新 –