Merge branch 'subtree'
[nikiroo-utils.git] / src / be / nikiroo / utils / resources / TransBundle.java
index 192945feefe1dd9d8a48f65ad897685d5b3658aa..7b2edb1ca919b4bc9f31e85d968ca8ee771d538f 100644 (file)
@@ -138,6 +138,9 @@ public class TransBundle<E extends Enum<E>> extends Bundle<E> {
                        result = "[" + key.toLowerCase() + "]";
                } else if (containsKey(key)) {
                        result = getString(key, null);
+                       if (result == null) {
+                               result = getMetaDef(id.name());
+                       }
                } else {
                        result = null;
                }
@@ -169,8 +172,7 @@ public class TransBundle<E extends Enum<E>> extends Bundle<E> {
        }
 
        /**
-        * Return all the languages known by the program.
-        * 
+        * Return all the languages known by the program for this bundle.
         * 
         * @return the known language codes
         */
@@ -327,7 +329,11 @@ public class TransBundle<E extends Enum<E>> extends Bundle<E> {
                String name = id.name() + "_NOUTF";
                if (containsKey(name)) {
                        String value = getString(name, null);
-                       writeValue(writer, name, value);
+                       if (value == null) {
+                               value = getMetaDef(id.name());
+                       }
+                       boolean set = isSet(id, false);
+                       writeValue(writer, name, value, set);
                }
        }