Просмотр исходного кода

Fix several translation issues (#3742)

myrevery 2 лет назад
Родитель
Сommit
01fe5f452a

+ 1 - 1
.github/workflows/crowdin.yml

@@ -19,7 +19,7 @@ jobs:
       - name: Build hestiacp.pot
       - name: Build hestiacp.pot
         if: github.repository == 'hestiacp/hestiacp'
         if: github.repository == 'hestiacp/hestiacp'
         run: |
         run: |
-          sudo apt install gettext -y
+          sudo apt-get -qq install gettext
           cd ./web/locale
           cd ./web/locale
           bash ./hst_scan_i18n.sh
           bash ./hst_scan_i18n.sh
       - name: Commit new .pot file
       - name: Commit new .pot file

+ 17 - 18
web/locale/hst_scan_i18n.sh

@@ -1,37 +1,36 @@
 #!/bin/bash
 #!/bin/bash
-if [ ! -e /usr/bin/xgettext ]; then
+
+if [ ! -x /usr/bin/xgettext ]; then
 	echo " **********************************************************"
 	echo " **********************************************************"
 	echo " * Unable to find xgettext please install gettext package *"
 	echo " * Unable to find xgettext please install gettext package *"
 	echo " **********************************************************"
 	echo " **********************************************************"
 	exit 3
 	exit 3
 fi
 fi
 
 
-echo "[ * ] Move hestiacp.pot to Move hestiacp.pot.old"
+echo "[ * ] Move hestiacp.pot to hestiacp.pot.old"
 mv hestiacp.pot hestiacp.pot.old
 mv hestiacp.pot hestiacp.pot.old
-echo "" > hestiacp.pot
+true > hestiacp.pot
 
 
 echo "[ * ] Search *.php *.html and *.sh for php based gettext functions"
 echo "[ * ] Search *.php *.html and *.sh for php based gettext functions"
 find ../.. \( -name '*.php' -o -name '*.html' -o -name '*.sh' \) | xgettext --output=hestiacp.pot --language=PHP --join-existing -f -
 find ../.. \( -name '*.php' -o -name '*.html' -o -name '*.sh' \) | xgettext --output=hestiacp.pot --language=PHP --join-existing -f -
-OLDIFS=$IFS
-IFS=$'\n'
+
 # Scan the description string for list updates page
 # Scan the description string for list updates page
-for string in $(awk -F'DESCR=' '/data=".+ DESCR=[^"]/ {print $2}' ../../bin/v-list-sys-hestia-updates | cut -d\' -f2); do
-	if [ -z "$(grep "\"$string\"" hestiacp.pot)" ]; then
-		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
+while IFS= read -r string; do
+	if ! grep -q "\"$string\"" hestiacp.pot; then
+		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
 	fi
 	fi
-done
+done < <(awk -F'DESCR=' '/data=".+ DESCR=[^"]/ {print $2}' ../../bin/v-list-sys-hestia-updates | cut -d\' -f2)
+
 # Scan the description string for list server page
 # Scan the description string for list server page
-for string in $(awk -F'SYSTEM=' '/data=".+ SYSTEM=[^"]/ {print $2}' ../../bin/v-list-sys-services | cut -d\' -f2); do
-	if [ -z "$(grep "\"$string\"" hestiacp.pot)" ]; then
-		echo -e "\n#: ../../bin/v-list-sys-services:"$(grep -n "$string" ../../bin/v-list-sys-services | cut -d: -f1)"\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
+while IFS= read -r string; do
+	if ! grep -q "\"$string\"" hestiacp.pot; then
+		echo -e "\n#: ../../bin/v-list-sys-services:$(grep -n "$string" ../../bin/v-list-sys-services | cut -d: -f1)\nmsgid \"$string\"\nmsgstr \"\"" >> hestiacp.pot
 	fi
 	fi
-done
-IFS=$OLDIFS
+done < <(awk -F'SYSTEM=' '/data=".+ SYSTEM=[^"]/ {print $2}' ../../bin/v-list-sys-services | cut -d\' -f2)
 
 
 # Prevent only date change become a commit
 # Prevent only date change become a commit
-if [ $(diff hestiacp.pot hestiacp.pot.old | wc -l) != 2 ]; then
-	rm hestiacp.pot
-	mv hestiacp.pot.old hestiacp.pot
-else
+if [ "$(diff hestiacp.pot hestiacp.pot.old | wc -l)" -gt 4 ]; then
 	rm hestiacp.pot.old
 	rm hestiacp.pot.old
+else
+	mv -f hestiacp.pot.old hestiacp.pot
 fi
 fi

+ 1 - 1
web/templates/pages/list_backup.php

@@ -36,7 +36,7 @@
 
 
 <div class="container">
 <div class="container">
 
 
-	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backup Details") ?></h1>
+	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backups") ?></h1>
 
 
 	<div class="units-table js-units-container">
 	<div class="units-table js-units-container">
 		<div class="units-table-header">
 		<div class="units-table-header">

+ 1 - 1
web/templates/pages/list_backup_detail.php

@@ -33,7 +33,7 @@
 
 
 <div class="container">
 <div class="container">
 
 
-	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backups") ?></h1>
+	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backup Details") ?></h1>
 
 
 	<div class="units-table js-units-container">
 	<div class="units-table js-units-container">
 		<div class="units-table-header">
 		<div class="units-table-header">

+ 1 - 1
web/templates/pages/list_firewall_banlist.php

@@ -27,7 +27,7 @@
 
 
 <div class="container">
 <div class="container">
 
 
-	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Banned IPs") ?></h1>
+	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Banned IP Addresses") ?></h1>
 
 
 	<div class="units-table js-units-container">
 	<div class="units-table js-units-container">
 		<div class="units-table-header">
 		<div class="units-table-header">

+ 1 - 1
web/templates/pages/list_firewall_ipset.php

@@ -27,7 +27,7 @@
 
 
 <div class="container">
 <div class="container">
 
 
-	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("IP Lists") ?></h1>
+	<h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("IPset IP Lists") ?></h1>
 
 
 	<div class="units-table js-units-container">
 	<div class="units-table js-units-container">
 		<div class="units-table-header">
 		<div class="units-table-header">

+ 1 - 1
web/templates/pages/list_ip.php

@@ -41,7 +41,7 @@
 					<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
 					<input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
 					<select class="form-select" name="action">
 					<select class="form-select" name="action">
 						<option value=""><?= _("Apply to selected") ?></option>
 						<option value=""><?= _("Apply to selected") ?></option>
-						<option value="reread IP"><?= _("Verify IP Address") ?></option>
+						<option value="reread IP"><?= _("Refresh IP Addresses") ?></option>
 						<option value="delete"><?= _("Delete") ?></option>
 						<option value="delete"><?= _("Delete") ?></option>
 					</select>
 					</select>
 					<button type="submit" class="toolbar-input-submit" title="<?= _("Apply to selected") ?>">
 					<button type="submit" class="toolbar-input-submit" title="<?= _("Apply to selected") ?>">

+ 1 - 1
web/templates/pages/list_rrd.php

@@ -15,7 +15,7 @@
 			<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'monthly')) echo " selected" ?>" href="?period=monthly"><?= _("Monthly") ?></a>
 			<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'monthly')) echo " selected" ?>" href="?period=monthly"><?= _("Monthly") ?></a>
 			<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'yearly')) echo " selected" ?>" href="?period=yearly"><?= _("Yearly") ?></a>
 			<a class="toolbar-link<?php if ((!empty($period)) && ($period == 'yearly')) echo " selected" ?>" href="?period=yearly"><?= _("Yearly") ?></a>
                         <a class="toolbar-link<?php if ((!empty($period)) && ($period == 'biennially')) echo " selected" ?>" href="?period=biennially"><?= _("Biennially") ?></a>
                         <a class="toolbar-link<?php if ((!empty($period)) && ($period == 'biennially')) echo " selected" ?>" href="?period=biennially"><?= _("Biennially") ?></a>
-                        <a class="toolbar-link<?php if ((!empty($period)) && ($period == 'triennially')) echo " selected" ?>" href="?period=triennially"><?= _("Trienially") ?></a>
+                        <a class="toolbar-link<?php if ((!empty($period)) && ($period == 'triennially')) echo " selected" ?>" href="?period=triennially"><?= _("Triennially") ?></a>
 		</div>
 		</div>
 	</div>
 	</div>
 </div>
 </div>

+ 1 - 1
web/templates/pages/list_stats.php

@@ -78,7 +78,7 @@
 							<li class="stats-item-summary-list-item">
 							<li class="stats-item-summary-list-item">
 								<span>
 								<span>
 									<?php if ($_SESSION["userContext"] === "admin" || ($_SESSION["userContext"] === "user" && $data[$key]["IP_OWNED"] != "0")) { ?>
 									<?php if ($_SESSION["userContext"] === "admin" || ($_SESSION["userContext"] === "user" && $data[$key]["IP_OWNED"] != "0")) { ?>
-										<?= _("IP Address") ?>:
+										<?= _("IP Addresses") ?>:
 									<?php } ?>
 									<?php } ?>
 								</span>
 								</span>
 								<span>
 								<span>

+ 2 - 2
web/templates/pages/list_updates.php

@@ -30,7 +30,7 @@
 
 
 	<div class="units-table js-units-container">
 	<div class="units-table js-units-container">
 		<div class="units-table-header">
 		<div class="units-table-header">
-			<div class="units-table-cell"><?= _("Package") ?></div>
+			<div class="units-table-cell"><?= _("Package Names") ?></div>
 			<div class="units-table-cell"><?= _("Description") ?></div>
 			<div class="units-table-cell"><?= _("Description") ?></div>
 			<div class="units-table-cell u-text-center"><?= _("Version") ?></div>
 			<div class="units-table-cell u-text-center"><?= _("Version") ?></div>
 			<div class="units-table-cell u-text-center"><?= _("Status") ?></div>
 			<div class="units-table-cell u-text-center"><?= _("Status") ?></div>
@@ -51,7 +51,7 @@
 			?>
 			?>
 			<div class="units-table-row <?php if ($status == 'suspended') echo 'disabled'; ?> animate__animated animate__fadeIn js-unit">
 			<div class="units-table-row <?php if ($status == 'suspended') echo 'disabled'; ?> animate__animated animate__fadeIn js-unit">
 				<div class="units-table-cell units-table-heading-cell u-text-bold">
 				<div class="units-table-cell units-table-heading-cell u-text-bold">
-					<span class="u-hide-desktop"><?= _("Package") ?>:</span>
+					<span class="u-hide-desktop"><?= _("Package Names") ?>:</span>
 					<?= $key ?>
 					<?= $key ?>
 				</div>
 				</div>
 				<div class="units-table-cell">
 				<div class="units-table-cell">