Skip to content

Commit 0f8f084

Browse files
committed
Add scan for missing strings
1 parent f6e5e9d commit 0f8f084

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

web/locale/hst_scan_i18n.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,17 @@ echo "[ * ] Remove old hestiacp.pot and generate new one"
1212
rm hestiacp.pot
1313
echo "" > hestiacp.pot
1414
find ../.. \( -name '*.php' -o -name '*.html' -o -name '*.sh' \) | xgettext --output=hestiacp.pot --language=PHP --join-existing -f -
15+
OLDIFS=$IFS
16+
IFS=$'\n'
17+
for string in $(awk -F'SYSTEM=' '/data=".+ SYSTEM=[^"]/ {print $2}' $HESTIA/bin/v-list-sys-services | cut -d\' -f2); do
18+
if [ -z "$(grep "$string" hestiacp.pot)" ]; then
19+
echo -e "\n#: ../../bin/v-list-sys-services:"$(grep -n "$string" $HESTIA/bin/v-list-sys-services | cut -d: -f1)"\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
20+
fi
21+
done
22+
IFS=$OLDIFS
1523

1624
echo "[ * ] Scan language folders"
17-
languages=$(ls -d $HESTIA/web/locale/*/ |awk -F'/' '{print $(NF-1)}');
25+
languages=$(ls -d $HESTIA/web/locale/*/ | awk -F'/' '{print $(NF-1)}');
1826
echo "[ * ] Update hestiacp.pot with new files"
1927
for lang in $languages; do
2028
if [ -e "$HESTIA/web/locale/$lang/LC_MESSAGES/hestiacp.po" ]; then

0 commit comments

Comments
 (0)