aboutsummaryrefslogtreecommitdiffstats
path: root/tools/po-update.sh
diff options
context:
space:
mode:
authorYuri Chornoivan <yurchor@ukr.net>2013-10-15 19:02:51 +0300
committerYuri Chornoivan <yurchor@ukr.net>2013-10-15 19:02:51 +0300
commit3aac82d0c04e65ae9bf451165733667421cb7161 (patch)
tree8172eebc9dbf5b9b6d1570a64630b524a3163e38 /tools/po-update.sh
parent26be839a908e61cd831f1b8b02733b25f43990e5 (diff)
downloadisodumper-3aac82d0c04e65ae9bf451165733667421cb7161.tar
isodumper-3aac82d0c04e65ae9bf451165733667421cb7161.tar.gz
isodumper-3aac82d0c04e65ae9bf451165733667421cb7161.tar.bz2
isodumper-3aac82d0c04e65ae9bf451165733667421cb7161.tar.xz
isodumper-3aac82d0c04e65ae9bf451165733667421cb7161.zip
Optimize po-update script
Diffstat (limited to 'tools/po-update.sh')
-rwxr-xr-xtools/po-update.sh27
1 files changed, 3 insertions, 24 deletions
diff --git a/tools/po-update.sh b/tools/po-update.sh
index bf468bc..8828175 100755
--- a/tools/po-update.sh
+++ b/tools/po-update.sh
@@ -27,45 +27,24 @@ POT_FILE="$POT_DIR/$DOMAIN.pot"
--package-version "$VERSION" \
--default-domain="$L_NAME" \
--language=Python --from-code=UTF-8 --files-from="$SOURCE_FILES" \
- --no-escape --indent --add-location --sort-by-file \
+ --no-escape --add-location --sort-by-file \
--add-comments=I18N \
--output="$POT_FILE"
/bin/sed --in-place --expression="s/charset=CHARSET/charset=UTF-8/" "$POT_FILE"
-
-unfmt() {
- local SOURCE="/usr/share/locale/$LL_CC/LC_MESSAGES/$1.mo"
- if test ! -f "$SOURCE"; then
- SOURCE="/usr/share/locale-langpack/$LL_CC/LC_MESSAGES/$1.mo"
- fi
- local TARGET="$(mktemp --tmpdir $1-$LL_CC-XXXXXX.po)"
- /usr/bin/msgunfmt \
- --no-escape --indent \
- --output-file="$TARGET" \
- "$SOURCE"
- echo "$TARGET"
-}
-
update_po() {
local LL_CC="$1"
local PO_FILE="$POT_DIR/$LL_CC.po"
- test -r "$PO_FILE" || /usr/bin/msginit \
- --no-translator --locale="$LL_CC" \
- --input="$POT_FILE" \
- --output-file="$PO_FILE"
-
+ echo "Update $(basename "$PO_FILE"):"
/usr/bin/msgmerge \
--update --no-fuzzy-matching \
- --no-escape --indent --add-location --sort-by-file \
+ --no-escape --add-location --sort-by-file \
--lang="$LL_CC" \
- --compendium="$(unfmt gtk30)" \
- --compendium="$(unfmt gtk30-properties)" \
"$PO_FILE" "$POT_FILE"
# /bin/sed --in-place --expression="s/Language: \\\\n/Language: $L_NAME\\\\n/" "$PO_FILE"
- echo "Updated $PO_FILE"
}
if test "$1"; then