do not override data by locale iteration
This commit is contained in:
parent
70747bf90a
commit
d0aff2f816
@ -88,16 +88,18 @@ public class ModularizedJsonIOStrategy implements IOStrategy {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
TranslationNode moduleNode = new TranslationNode(state.isSortKeys()
|
String moduleName = module.getNameWithoutExtension();
|
||||||
? new TreeMap<>()
|
|
||||||
: new LinkedHashMap<>());
|
TranslationNode moduleNode = data.getNode(moduleName) != null
|
||||||
|
? data.getNode(moduleName)
|
||||||
|
: new TranslationNode(state.isSortKeys() ? new TreeMap<>() : new LinkedHashMap<>());
|
||||||
|
|
||||||
JsonObject tree = GSON.fromJson(new InputStreamReader(module.getInputStream(),
|
JsonObject tree = GSON.fromJson(new InputStreamReader(module.getInputStream(),
|
||||||
module.getCharset()), JsonObject.class);
|
module.getCharset()), JsonObject.class);
|
||||||
|
|
||||||
JsonMapper.read(locale, tree, moduleNode);
|
JsonMapper.read(locale, tree, moduleNode);
|
||||||
|
|
||||||
data.getRootNode().setChildren(module.getNameWithoutExtension(), moduleNode);
|
data.getRootNode().setChildren(moduleName, moduleNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user