We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e59d53 commit bf6d471Copy full SHA for bf6d471
scripts/refresh-i18n.sh
@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+# "Refresh" all i18n language files by merging missing keys in lang files
4
+# from a base language file. In addition, sort all files by keys.
5
6
+BASE_DIR=$(dirname "$0")"/../i18n" # Exclude the trailing slash.
7
+BASE_FILE="en.json"
8
9
+# Iterate through all i18n files and merge them into the base file,
10
+# filling in missing keys.
11
+for fpath in "$BASE_DIR/"*.json; do
12
+ echo $(basename -- $fpath)
13
+ echo "$( jq -s '.[0] * .[1]' -S --indent 4 "$BASE_DIR/$BASE_FILE" $fpath )" > $fpath
14
+done
0 commit comments