However this does not matches a valid YAML file that would be:
Invalid YAML equivalence:
en:
level1:
level2: Some text
string1: Another text
So, if a key have children, it shouldn't be allowed to create a translation in it. And reverse, if a translation exists and you try to create a children of it, should not be allowed either.
I think it should be a rule to enforce that keys do not define translations if they have "children". We had quite a headache finding this bug.
Term Customizer allows you to set translation keys of this type:
en.level1.level2
=> "Some text"en.level1.level2.string1
=> "Another text"However this does not matches a valid YAML file that would be:
Invalid YAML equivalence:
So, if a key have children, it shouldn't be allowed to create a translation in it. And reverse, if a translation exists and you try to create a children of it, should not be allowed either.
I think it should be a rule to enforce that keys do not define translations if they have "children". We had quite a headache finding this bug.
Another possible solution is to break the loop here in case
current
is already a string: https://github.com/mainio/decidim-module-term_customizer/blob/03e6c98e85a00fe47f8db2726f1a1a98e808efda/lib/decidim/term_customizer/loader.rb#L51ie:
This might be easier to implement but it would allow invalid yamls to be created (maybe is not important though).
I can contribute if you let me know what you prefer