Skip to content

Commit 01fe5f4

Browse files
authored
Fix several translation issues (hestiacp#3742)
1 parent 4600b81 commit 01fe5f4

File tree

10 files changed

+27
-28
lines changed

10 files changed

+27
-28
lines changed

.github/workflows/crowdin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Build hestiacp.pot
2020
if: github.repository == 'hestiacp/hestiacp'
2121
run: |
22-
sudo apt install gettext -y
22+
sudo apt-get -qq install gettext
2323
cd ./web/locale
2424
bash ./hst_scan_i18n.sh
2525
- name: Commit new .pot file

web/locale/hst_scan_i18n.sh

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
11
#!/bin/bash
2-
if [ ! -e /usr/bin/xgettext ]; then
2+
3+
if [ ! -x /usr/bin/xgettext ]; then
34
echo " **********************************************************"
45
echo " * Unable to find xgettext please install gettext package *"
56
echo " **********************************************************"
67
exit 3
78
fi
89

9-
echo "[ * ] Move hestiacp.pot to Move hestiacp.pot.old"
10+
echo "[ * ] Move hestiacp.pot to hestiacp.pot.old"
1011
mv hestiacp.pot hestiacp.pot.old
11-
echo "" > hestiacp.pot
12+
true > hestiacp.pot
1213

1314
echo "[ * ] Search *.php *.html and *.sh for php based gettext functions"
1415
find ../.. \( -name '*.php' -o -name '*.html' -o -name '*.sh' \) | xgettext --output=hestiacp.pot --language=PHP --join-existing -f -
15-
OLDIFS=$IFS
16-
IFS=$'\n'
16+
1717
# Scan the description string for list updates page
18-
for string in $(awk -F'DESCR=' '/data=".+ DESCR=[^"]/ {print $2}' ../../bin/v-list-sys-hestia-updates | cut -d\' -f2); do
19-
if [ -z "$(grep "\"$string\"" hestiacp.pot)" ]; then
20-
echo -e "\n#: ../../bin/v-list-sys-hestia-updates:"$(grep -n "$string" ../../bin/v-list-sys-hestia-updates | cut -d: -f1)"\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
18+
while IFS= read -r string; do
19+
if ! grep -q "\"$string\"" hestiacp.pot; then
20+
echo -e "\n#: ../../bin/v-list-sys-hestia-updates:$(grep -n "$string" ../../bin/v-list-sys-hestia-updates | cut -d: -f1)\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
2121
fi
22-
done
22+
done < <(awk -F'DESCR=' '/data=".+ DESCR=[^"]/ {print $2}' ../../bin/v-list-sys-hestia-updates | cut -d\' -f2)
23+
2324
# Scan the description string for list server page
24-
for string in $(awk -F'SYSTEM=' '/data=".+ SYSTEM=[^"]/ {print $2}' ../../bin/v-list-sys-services | cut -d\' -f2); do
25-
if [ -z "$(grep "\"$string\"" hestiacp.pot)" ]; then
26-
echo -e "\n#: ../../bin/v-list-sys-services:"$(grep -n "$string" ../../bin/v-list-sys-services | cut -d: -f1)"\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
25+
while IFS= read -r string; do
26+
if ! grep -q "\"$string\"" hestiacp.pot; then
27+
echo -e "\n#: ../../bin/v-list-sys-services:$(grep -n "$string" ../../bin/v-list-sys-services | cut -d: -f1)\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
2728
fi
28-
done
29-
IFS=$OLDIFS
29+
done < <(awk -F'SYSTEM=' '/data=".+ SYSTEM=[^"]/ {print $2}' ../../bin/v-list-sys-services | cut -d\' -f2)
3030

3131
# Prevent only date change become a commit
32-
if [ $(diff hestiacp.pot hestiacp.pot.old | wc -l) != 2 ]; then
33-
rm hestiacp.pot
34-
mv hestiacp.pot.old hestiacp.pot
35-
else
32+
if [ "$(diff hestiacp.pot hestiacp.pot.old | wc -l)" -gt 4 ]; then
3633
rm hestiacp.pot.old
34+
else
35+
mv -f hestiacp.pot.old hestiacp.pot
3736
fi

web/templates/pages/list_backup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
<div class="container">
3838

39-
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backup Details") ?></h1>
39+
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backups") ?></h1>
4040

4141
<div class="units-table js-units-container">
4242
<div class="units-table-header">

web/templates/pages/list_backup_detail.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
<div class="container">
3535

36-
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backups") ?></h1>
36+
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backup Details") ?></h1>
3737

3838
<div class="units-table js-units-container">
3939
<div class="units-table-header">

web/templates/pages/list_firewall_banlist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<div class="container">
2929

30-
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Banned IPs") ?></h1>
30+
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Banned IP Addresses") ?></h1>
3131

3232
<div class="units-table js-units-container">
3333
<div class="units-table-header">

web/templates/pages/list_firewall_ipset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<div class="container">
2929

30-
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("IP Lists") ?></h1>
30+
<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("IPset IP Lists") ?></h1>
3131

3232
<div class="units-table js-units-container">
3333
<div class="units-table-header">

web/templates/pages/list_ip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
4242
<select class="form-select" name="action">
4343
<option value=""><?= _("Apply to selected") ?></option>
44-
<option value="reread IP"><?= _("Verify IP Address") ?></option>
44+
<option value="reread IP"><?= _("Refresh IP Addresses") ?></option>
4545
<option value="delete"><?= _("Delete") ?></option>
4646
</select>
4747
<button type="submit" class="toolbar-input-submit" title="<?= _("Apply to selected") ?>">

web/templates/pages/list_rrd.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'monthly')) echo " selected" ?>" href="?period=monthly"><?= _("Monthly") ?></a>
1616
<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'yearly')) echo " selected" ?>" href="?period=yearly"><?= _("Yearly") ?></a>
1717
<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'biennially')) echo " selected" ?>" href="?period=biennially"><?= _("Biennially") ?></a>
18-
<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'triennially')) echo " selected" ?>" href="?period=triennially"><?= _("Trienially") ?></a>
18+
<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'triennially')) echo " selected" ?>" href="?period=triennially"><?= _("Triennially") ?></a>
1919
</div>
2020
</div>
2121
</div>

web/templates/pages/list_stats.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<li class="stats-item-summary-list-item">
7979
<span>
8080
<?php if ($_SESSION["userContext"] === "admin" || ($_SESSION["userContext"] === "user" && $data[$key]["IP_OWNED"] != "0")) { ?>
81-
<?= _("IP Address") ?>:
81+
<?= _("IP Addresses") ?>:
8282
<?php } ?>
8383
</span>
8484
<span>

web/templates/pages/list_updates.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<div class="units-table js-units-container">
3232
<div class="units-table-header">
33-
<div class="units-table-cell"><?= _("Package") ?></div>
33+
<div class="units-table-cell"><?= _("Package Names") ?></div>
3434
<div class="units-table-cell"><?= _("Description") ?></div>
3535
<div class="units-table-cell u-text-center"><?= _("Version") ?></div>
3636
<div class="units-table-cell u-text-center"><?= _("Status") ?></div>
@@ -51,7 +51,7 @@
5151
?>
5252
<div class="units-table-row <?php if ($status == 'suspended') echo 'disabled'; ?> animate__animated animate__fadeIn js-unit">
5353
<div class="units-table-cell units-table-heading-cell u-text-bold">
54-
<span class="u-hide-desktop"><?= _("Package") ?>:</span>
54+
<span class="u-hide-desktop"><?= _("Package Names") ?>:</span>
5555
<?= $key ?>
5656
</div>
5757
<div class="units-table-cell">

0 commit comments

Comments
 (0)