mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-09 04:56:51 +03:00
chore: set width variable to 120 for consistent msgmerge and xgettext formatting in localization scripts
This commit is contained in:
@@ -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."
|
||||||
@@ -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[@]}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user