easy-i18n
easy-i18n copied to clipboard
Adding translations with "nested" keys unexpectedly removes parent keys
For example, if I create a translation like "key1=value" and then create another one like "key1.key2=value". The first translation gets deleted without notice.
https://user-images.githubusercontent.com/47906325/191158897-48b7dc0f-f718-454a-b554-77dc5738e4b7.mp4
I think this behavior comes from this line: https://github.com/marhali/easy-i18n/blob/624a29b123d2cc7a9ddea16aaddde193316b3dc2/src/main/java/de/marhali/easyi18n/model/TranslationNode.java#L80 Which clears the node value when a child translation is added.
If this is intended I think it should give a warning if the cleared node had a value beforehand.
Yes, this behavior is intentional, as some file implementations might have a nested file structure (e.g. json). Adding a warning could be a good solution here.