Sample Header Ad - 728x90

Force Patch character differences to a file

0 votes
1 answer
49 views
---------- 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
@@ -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
Asked by Freezer Fridge (3 rep)
Sep 3, 2023, 02:49 PM
Last activity: Sep 3, 2023, 04:50 PM