Skip to content

Commit 6e6ca33

Browse files
committed
Refining scripts/update_locale.sh
1 parent 2cf087c commit 6e6ca33

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/scripts/update_locale.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ cp build/docs/locale_changes_po.txt build/docs/locale_changes_po_pot.txt
3636
perl -ne '/\/en\// && print' build/docs/locale_changes_po.txt | \
3737
perl -pe 's/(.*)en\/LC_MESSAGES(.*)/$1pot$2t/' >> build/docs/locale_changes_po_pot.txt # .pot files
3838

39+
# Do not create empty translation files
40+
git status locale/es --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
41+
git status locale/ja --porcelain | awk 'match($1, "?"){print $2}' | xargs -r rm -rf
42+
3943
# Remove obsolete entries #~ from .po files
4044
bash .github/scripts/remove_obsolete_entries.sh
4145

42-
while read -r f; do git add "$f"; done < build/docs/locale_changes_po_pot.txt
46+
cat build/docs/locale_changes_po_pot.txt | xargs -I {} sh -c "(ls {} >> /dev/null 2>&1 && git add {} )"
4347

4448
popd > /dev/null || exit 1

0 commit comments

Comments
 (0)