Merge pull request #182 from itdoginfo/translation

Translation
This commit is contained in:
Kirill Sobakin
2025-10-02 10:54:26 +03:00
committed by GitHub
3 changed files with 14 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ set -euo pipefail
PODIR="po" PODIR="po"
POTFILE="$PODIR/templates/podkop.pot" POTFILE="$PODIR/templates/podkop.pot"
WIDTH=120
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then
echo "Usage: $0 <language_code> (e.g., ru, de, fr)" echo "Usage: $0 <language_code> (e.g., ru, de, fr)"
@@ -19,11 +20,11 @@ fi
if [ -f "$POFILE" ]; then if [ -f "$POFILE" ]; then
echo "Updating $POFILE" echo "Updating $POFILE"
msgmerge --update "$POFILE" "$POTFILE" msgmerge --update --width="$WIDTH" "$POFILE" "$POTFILE"
else else
echo "Creating new $POFILE using msginit" echo "Creating new $POFILE using msginit"
mkdir -p "$PODIR/$LANG" mkdir -p "$PODIR/$LANG"
msginit --no-translator --locale="$LANG" --width=120 --input="$POTFILE" --output-file="$POFILE" msginit --no-translator --locale="$LANG" --width="$WIDTH" --input="$POTFILE" --output-file="$POFILE"
fi fi
echo "Translation file for $LANG updated." echo "Translation file for $LANG updated."

View File

@@ -13,7 +13,7 @@ msgstr ""
"Language-Team: none\n" "Language-Team: none\n"
"Language: ru\n" "Language: ru\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ASCII\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
@@ -307,8 +307,8 @@ msgid ""
"Enter connection string starting with vless:// or ss:// for proxy configuration. Add comments with // for backup " "Enter connection string starting with vless:// or ss:// for proxy configuration. Add comments with // for backup "
"configs" "configs"
msgstr "" msgstr ""
"Введите строку подключения, начинающуюся с vless:// или ss:// для настройки прокси. " "Введите строку подключения, начинающуюся с vless:// или ss:// для настройки прокси. Добавляйте комментарии с // для "
"Добавляйте комментарии с // для сохранения других конфигураций" "сохранения других конфигураций"
#: htdocs/luci-static/resources/view/podkop/configSection.js:100 #: htdocs/luci-static/resources/view/podkop/configSection.js:100
msgid "No active configuration found. At least one non-commented line is required." msgid "No active configuration found. At least one non-commented line is required."
@@ -501,7 +501,8 @@ msgstr "Список пользовательских доменов"
#: htdocs/luci-static/resources/view/podkop/configSection.js:332 #: htdocs/luci-static/resources/view/podkop/configSection.js:332
msgid "Enter domain names separated by comma, space or newline. You can add comments after //" msgid "Enter domain names separated by comma, space or newline. You can add comments after //"
msgstr "Введите имена доменов, разделяя их запятой, пробелом или с новой строки. Вы можете добавлять комментарии после //" msgstr ""
"Введите имена доменов, разделяя их запятой, пробелом или с новой строки. Вы можете добавлять комментарии после //"
#: htdocs/luci-static/resources/view/podkop/configSection.js:360 #: htdocs/luci-static/resources/view/podkop/configSection.js:360
#, javascript-format #, javascript-format
@@ -602,8 +603,8 @@ msgid ""
"Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline. You can add comments " "Enter subnets in CIDR notation or single IP addresses, separated by comma, space or newline. You can add comments "
"after //" "after //"
msgstr "" msgstr ""
"Введите подсети в нотации CIDR или отдельные IP-адреса, разделенные запятой, пробелом или новой строкой. " "Введите подсети в нотации CIDR или отдельные IP-адреса, разделенные запятой, пробелом или новой строкой. Вы можете "
"Вы можете добавлять комментарии после //" "добавлять комментарии после //"
#: htdocs/luci-static/resources/view/podkop/configSection.js:487 #: htdocs/luci-static/resources/view/podkop/configSection.js:487
#, javascript-format #, javascript-format
@@ -623,8 +624,8 @@ msgstr "CIDR должен быть между 0 и 32 в: %s"
#: htdocs/luci-static/resources/view/podkop/configSection.js:510 #: htdocs/luci-static/resources/view/podkop/configSection.js:510
msgid "At least one valid subnet or IP must be specified. Comments-only content is not allowed." msgid "At least one valid subnet or IP must be specified. Comments-only content is not allowed."
msgstr "" msgstr ""
"Должна быть указана хотя бы одна действительная подсеть или IP. Содержимое, состоящее только из комментариев, " "Должна быть указана хотя бы одна действительная подсеть или IP. Содержимое, состоящее только из комментариев, не "
"не допускается." "допускается."
#: htdocs/luci-static/resources/view/podkop/configSection.js:516 #: htdocs/luci-static/resources/view/podkop/configSection.js:516
msgid "Remote Subnet Lists" msgid "Remote Subnet Lists"

View File

@@ -3,6 +3,7 @@
SRC_DIR="htdocs/luci-static/resources/view/podkop" SRC_DIR="htdocs/luci-static/resources/view/podkop"
OUT_POT="po/templates/podkop.pot" OUT_POT="po/templates/podkop.pot"
ENCODING="UTF-8" ENCODING="UTF-8"
WIDTH=120
mapfile -t FILES < <(find "$SRC_DIR" -type f -name "*.js") mapfile -t FILES < <(find "$SRC_DIR" -type f -name "*.js")
if [ ${#FILES[@]} -eq 0 ]; then if [ ${#FILES[@]} -eq 0 ]; then
@@ -17,7 +18,7 @@ xgettext --language=JavaScript \
--keyword=_ \ --keyword=_ \
--from-code="$ENCODING" \ --from-code="$ENCODING" \
--output="$OUT_POT" \ --output="$OUT_POT" \
--width=120 \ --width="$WIDTH" \
--package-name="PODKOP" \ --package-name="PODKOP" \
"${FILES[@]}" "${FILES[@]}"