Manager writes 'undefined' to empty files
btxtiger opened this issue · 4 comments
If I create an empty translation file, and open the manager, and not immediately add a translation for this language, but modify another, and press save, undefined
is written to this empty unused file.
I think it would be better to either write nothing, oder an empty object { }
Hey @btxtiger, indeed I'll fix that for the next version
Thanks for the issue!
Additionally, when adding an Item via "Add item" (keyboard shortcut would be really nice), empty properties like MY_KEY: ""
were added, which causes, that the fallback language would not take effect. The value should be null
or the key removed instead.
However I am not sure how it can be handled, if the intention is to have an empty string. But in my opinion, this should never be the case.
Maybe to force an empty string, one can insert a placeholder like <!--force-empty-string-->
Shortcuts are planned to the v3.1 (currently I'm developing the v3.0)
The reason to put empty strings instead of null is for compatibility to the file outputs, that an empty string is more compatible than null is some cases. Regarding that, the possible outputs are for now .json
, .yaml
and .arb
.
Hi @btxtiger, the v3.0 was released!