I correctly internationalized a javascript file from wp theme folder.
Now I would like to know if Wordpress team plans to propose a CLI to update json without losing existing translation.
It seems that developers are currently talking about the add of "update-json" command CLI. But isn't there already one or more command cli that can read a file (.json), compare its content with existing content of other .json file with the same extension and instantiation, copy the difference and duplicate it in another file or rewrite in existing file ?
Obviously I'm thinking of several dozen strings to be translated,adding ten lines can be done manually without any problem.
In the same way as updating the .po
file (cli = update-po).
Perhaps using this command : diff, cp, and others ?
{md5}
with the id of the script (in my case "main-action"). So I have that :{text-domain}-{lang_country}{main-action}.json
I use this command to format/display the code with indentation (pretty-print )wp i18n make-json en_GB.po --pretty-print
from the "languages" folder. 1/2{text-domain}-{lang_country}-{id-script}.json
is also recognised bywp i18n
and always translates the javascript content correctly. So I suggest deleting this file so that only{text-domain}-{lang_country}-{md5}.json
remains.