If the dot format and the nested format are mixed, a translation key in dot format is ignored if there is a nested block with a prefix of the translation key.
swallows all "i18n.fruits" translations. Only the key "i18n.fruits.cherry" is translated.
Expected behavior
If the dot format and the nested format are combined, the translation keys should be merged.
How do you think that we should fix this?
In the getValue method of the TranslateDefaultParser the target variable is set to the nested object whose key is a prefix of the translation key. Thus the keys of the previous target (initially the complete json file) are ignored. One option here would be to merge the matching keys of the previous target.
Current behavior
If the dot format and the nested format are mixed, a translation key in dot format is ignored if there is a nested block with a prefix of the translation key.
In this example
the nested block
swallows all
"i18n.fruits"
translations. Only the key"i18n.fruits.cherry"
is translated.Expected behavior
If the dot format and the nested format are combined, the translation keys should be merged.
How do you think that we should fix this?
In the
getValue
method of theTranslateDefaultParser
the target variable is set to the nested object whose key is a prefix of the translation key. Thus the keys of the previous target (initially the complete json file) are ignored. One option here would be to merge the matching keys of the previous target.Here is a suggestion for the complete adapted
getValue
method (v15.0.0):