From 560dda86046250cb7875358692693abdd8074b7b Mon Sep 17 00:00:00 2001 From: Nikita Skryabin Date: Thu, 20 Feb 2025 23:49:41 +0300 Subject: [PATCH] feat(podkop): add translations for cache file and rewrite ttl options --- .../resources/view/podkop/podkop.js | 8 ++--- luci-app-podkop/po/ru/podkop.po | 35 ++++++++++++++++++- luci-app-podkop/po/templates/podkop.pot | 33 +++++++++++++++++ 3 files changed, 71 insertions(+), 5 deletions(-) diff --git a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js index c9d25c7..e80b20f 100644 --- a/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js +++ b/luci-app-podkop/htdocs/luci-static/resources/view/podkop/podkop.js @@ -697,25 +697,25 @@ return view.extend({ return true; }; - o = s.taboption('additional', form.Value, 'dns_rewrite_ttl', 'DNS Rewrite TTL', 'Time in seconds for DNS record caching (default: 600)'); + o = s.taboption('additional', form.Value, 'dns_rewrite_ttl', _('DNS Rewrite TTL'), _('Time in seconds for DNS record caching (default: 600)')); o.default = '600'; o.rmempty = false; o.ucisection = 'main'; o.validate = function (section_id, value) { if (!value) { - return 'TTL value cannot be empty'; + return _('TTL value cannot be empty'); } const ttl = parseInt(value); if (isNaN(ttl) || ttl < 0) { - return 'TTL must be a positive number'; + return _('TTL must be a positive number'); } return true; }; - o = s.taboption('additional', form.Value, 'cache_file', 'Cache File Path', 'Select or enter path for sing-box cache file. Change this ONLY if you know what you are doing'); + o = s.taboption('additional', form.Value, 'cache_file', _('Cache File Path'), _('Select or enter path for sing-box cache file. Change this ONLY if you know what you are doing')); o.value('/tmp/cache.db', 'RAM (/tmp/cache.db)'); o.value('/usr/share/sing-box/cache.db', 'Flash (/usr/share/sing-box/cache.db)'); o.default = '/tmp/cache.db'; diff --git a/luci-app-podkop/po/ru/podkop.po b/luci-app-podkop/po/ru/podkop.po index 93c6974..dd32b14 100644 --- a/luci-app-podkop/po/ru/podkop.po +++ b/luci-app-podkop/po/ru/podkop.po @@ -521,4 +521,37 @@ msgid "DNS server address cannot be empty" msgstr "Адрес DNS сервера не может быть пустым" msgid "Invalid DNS server format. Examples: 8.8.8.8 or dns.example.com" -msgstr "Неверный формат DNS сервера. Примеры: 8.8.8.8 или dns.example.com" \ No newline at end of file +msgstr "Неверный формат DNS сервера. Примеры: 8.8.8.8 или dns.example.com" + +msgid "DNS Rewrite TTL" +msgstr "Перезапись TTL для DNS" + +msgid "Time in seconds for DNS record caching (default: 600)" +msgstr "Время в секундах для кэширования DNS записей (по умолчанию: 600)" + +msgid "TTL value cannot be empty" +msgstr "Значение TTL не может быть пустым" + +msgid "TTL must be a positive number" +msgstr "TTL должно быть положительным числом" + +msgid "Cache File Path" +msgstr "Путь к файлу кэша" + +msgid "Select or enter path for sing-box cache file. Change this ONLY if you know what you are doing" +msgstr "Выберите или введите путь к файлу кэша sing-box. Меняйте ТОЛЬКО если знаете, что делаете" + +msgid "Cache file path cannot be empty" +msgstr "Путь к файлу кэша не может быть пустым" + +msgid "Path must be absolute (start with /)" +msgstr "Путь должен быть абсолютным (начинаться с /)" + +msgid "Path must end with cache.db" +msgstr "Путь должен заканчиваться на cache.db" + +msgid "Path must contain at least one directory (like /tmp/cache.db)" +msgstr "Путь должен содержать хотя бы одну директорию (например /tmp/cache.db)" + +msgid "Invalid path format. Must be like /tmp/cache.db" +msgstr "Неверный формат пути. Пример: /tmp/cache.db" \ No newline at end of file diff --git a/luci-app-podkop/po/templates/podkop.pot b/luci-app-podkop/po/templates/podkop.pot index 1506f1b..28cb66f 100644 --- a/luci-app-podkop/po/templates/podkop.pot +++ b/luci-app-podkop/po/templates/podkop.pot @@ -875,4 +875,37 @@ msgid "DNS Server" msgstr "" msgid "Select or enter DNS server address" +msgstr "" + +msgid "DNS Rewrite TTL" +msgstr "" + +msgid "Time in seconds for DNS record caching (default: 600)" +msgstr "" + +msgid "TTL value cannot be empty" +msgstr "" + +msgid "TTL must be a positive number" +msgstr "" + +msgid "Cache File Path" +msgstr "" + +msgid "Select or enter path for sing-box cache file. Change this ONLY if you know what you are doing" +msgstr "" + +msgid "Cache file path cannot be empty" +msgstr "" + +msgid "Path must be absolute (start with /)" +msgstr "" + +msgid "Path must end with cache.db" +msgstr "" + +msgid "Path must contain at least one directory (like /tmp/cache.db)" +msgstr "" + +msgid "Invalid path format. Must be like /tmp/cache.db" msgstr "" \ No newline at end of file