mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-20 22:48:24 +03:00
@@ -7,12 +7,12 @@
|
||||
function createAdditionalSection(mainSection, network) {
|
||||
let o = mainSection.tab('additional', _('Additional Settings'));
|
||||
|
||||
o = mainSection.taboption('additional', form.Flag, 'yacd', _('Yacd enable'), _('<a href="http://openwrt.lan:9090/ui" target="_blank">openwrt.lan:9090/ui</a>'));
|
||||
o = mainSection.taboption('additional', form.Flag, 'yacd', _('Yacd enable'), '<a href="http://openwrt.lan:9090/ui" target="_blank">openwrt.lan:9090/ui</a>');
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
o = mainSection.taboption('additional', form.Flag, 'exclude_ntp', _('Exclude NTP'), _('For issues with open connections sing-box'));
|
||||
o = mainSection.taboption('additional', form.Flag, 'exclude_ntp', _('Exclude NTP'), _('Allows you to exclude NTP protocol traffic from the tunnel'));
|
||||
o.default = '0';
|
||||
o.rmempty = false;
|
||||
o.ucisection = 'main';
|
||||
|
||||
@@ -37,7 +37,7 @@ function createConfigSection(section, map, network) {
|
||||
o.depends('mode', 'proxy');
|
||||
o.ucisection = s.section;
|
||||
|
||||
o = s.taboption('basic', form.TextValue, 'proxy_string', _('Proxy Configuration URL'), _(''));
|
||||
o = s.taboption('basic', form.TextValue, 'proxy_string', _('Proxy Configuration URL'), '');
|
||||
o.depends('proxy_config_type', 'url');
|
||||
o.rows = 5;
|
||||
o.rmempty = false;
|
||||
|
||||
@@ -37,7 +37,7 @@ return view.extend({
|
||||
</style>
|
||||
`);
|
||||
|
||||
const m = new form.Map('podkop', _(''), null, ['main', 'extra']);
|
||||
const m = new form.Map('podkop', '', null, ['main', 'extra']);
|
||||
|
||||
// Main Section
|
||||
const mainSection = m.section(form.TypedSection, 'main');
|
||||
|
||||
29
luci-app-podkop/msgmerge.sh
Normal file
29
luci-app-podkop/msgmerge.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
PODIR="po"
|
||||
POTFILE="$PODIR/templates/podkop.pot"
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage: $0 <language_code> (e.g., ru, de, fr)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LANG="$1"
|
||||
POFILE="$PODIR/$LANG/podkop.po"
|
||||
|
||||
if [ ! -f "$POTFILE" ]; then
|
||||
echo "Template $POTFILE not found. Run xgettext first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f "$POFILE" ]; then
|
||||
echo "Updating $POFILE"
|
||||
msgmerge --update "$POFILE" "$POTFILE"
|
||||
else
|
||||
echo "Creating new $POFILE using msginit"
|
||||
mkdir -p "$PODIR/$LANG"
|
||||
msginit --no-translator --locale="$LANG" --width=120 --input="$POTFILE" --output-file="$POFILE"
|
||||
fi
|
||||
|
||||
echo "Translation file for $LANG updated."
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
24
luci-app-podkop/xgettext.sh
Normal file
24
luci-app-podkop/xgettext.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
SRC_DIR="htdocs/luci-static/resources/view/podkop"
|
||||
OUT_POT="po/templates/podkop.pot"
|
||||
ENCODING="UTF-8"
|
||||
|
||||
mapfile -t FILES < <(find "$SRC_DIR" -type f -name "*.js")
|
||||
if [ ${#FILES[@]} -eq 0 ]; then
|
||||
echo "No JS files found in $SRC_DIR"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$(dirname "$OUT_POT")"
|
||||
|
||||
echo "Generating POT template from JS files in $SRC_DIR"
|
||||
xgettext --language=JavaScript \
|
||||
--keyword=_ \
|
||||
--from-code="$ENCODING" \
|
||||
--output="$OUT_POT" \
|
||||
--width=120 \
|
||||
--package-name="PODKOP" \
|
||||
"${FILES[@]}"
|
||||
|
||||
echo "POT template generated: $OUT_POT"
|
||||
Reference in New Issue
Block a user