* resource file)
*/
public String getString(E id) {
- return getStringX(id, "");
+ return getStringX(id, null);
}
/**
*/
public String getStringX(E id, String suffix) {
String key = id.name()
- + ((suffix == null || suffix.isEmpty()) ? "" : "_"
- + suffix.toUpperCase());
+ + (suffix == null ? "" : "_" + suffix.toUpperCase());
if (containsKey(key)) {
return getString(key).trim();
}
/**
- * Create/update the .properties file. Will use the most likely candidate as
- * base if the file does not already exists and this resource is
- * translatable (for instance, "en_US" will use "en" as a base if the
- * resource is a translation file).
+ * Create/update the .properties file.
+ * <p>
+ * Will use the most likely candidate as base if the file does not already
+ * exists and this resource is translatable (for instance, "en_US" will use
+ * "en" as a base if the resource is a translation file).
*
* @param path
* the path where the .properties files are
writer.close();
}
+ /**
+ * Reload the {@link Bundle} data files.
+ */
+ public void reload() {
+ setBundle(name, null);
+ }
+
/**
* Check if the internal map contains the given key.
*
value = "";
}
- String[] lines = value.replaceAll("\\\t", "\\\\\\t").split("\n");
+ String[] lines = value.replaceAll("\t", "\\t").split("\n");
for (int i = 0; i < lines.length; i++) {
writer.write(lines[i]);
if (i < lines.length - 1) {