Hello, I have an englishStrings.json file and when I make new edits/ additions to it, I need to copy the new changes to all the other language string.json files.
Before making any changes to englishStrings, the englishStrings and otherLanguageStrings have the same keys and same number of lines but values differ.
I am trying to do something like this:
git diff -U0 —-word-diff-regex=. —-word-diff=porcelain englishStrings.json > changes.diff
patch frenchStrings.json < changes.diff
But it does not work for edits. The reason I want to apply character differences for when I insert a comma at the end of the key, value pair of an englishString and need to transfer it to another language strings file.
Examples: EnglishString.json
{
"a": "one",
"b": "two",
"test": "test",
"c": "three",
"edit": "edit"
}
FrenchString.json
{
“a”: “un”,
“b”: “deux”,
“c”: “trois”
}
git diff -U0 —-word-diff-regex=. —-word-diff=porcelain EnglishString.json > changes.diff
@@ -4 +4,3 @@
"
+test": "test",
~
+ "
c": "three"
+,
~
+ "edit": "edit"
~
Expecting after patch:
{
"a": "un",
"b": "deux",
"test": "test",
"c": "trois",
"edit": "edit"
}
But patch is currently telling me that the patch file is malformed. Patch probably wont be able to help since line length can differ between English and French Strings but I would be open to recommendations to change up my solution