test jq to merge locale files

This commit is contained in:
Moriz Wahl 2022-10-11 18:59:52 +02:00
parent 07cd6ab7e8
commit 111b1da00d
4 changed files with 41 additions and 0 deletions

View File

@ -15,6 +15,9 @@ COPY branding/constants/ constants/
COPY branding/locales/ locales/
COPY branding/assets/styles/imports/ assets/styles/imports/
## Something like (bash, jq must be installed)
# for locale in `ls locales/*.json`; do jq -s '.[0] * .[1]' source/$locale $locale; done;
##################################################################################
# BUILD ##########################################################################
##################################################################################

12
tools/test/file1.json Normal file
View File

@ -0,0 +1,12 @@
{
"a-key": "A",
"b-key": {
"a-subkey": "A",
"b-subkey": "B",
"c-subkey": {
"a-subsubkey": "A",
"b-subsubkey": "B"
}
},
"c-key": "C"
}

11
tools/test/file2.json Normal file
View File

@ -0,0 +1,11 @@
{
"a-key": "AA",
"b-key": {
"b-subkey": "BB",
"c-subkey": {
"b-subsubkey": "BB",
"c-subsubkey": "C"
}
},
"d-key": "D"
}

15
tools/test/result.json Normal file
View File

@ -0,0 +1,15 @@
{
"a-key": "AA",
"b-key": {
"a-subkey": "A",
"b-subkey": "BB",
"c-subkey": {
"a-subsubkey": "A",
"b-subsubkey": "BB",
"c-subsubkey": "C"
}
},
"c-key": "C",
"d-key": "D"
}