/po/tools/update-po.sh
http://txt2tags.googlecode.com/ · Shell · 54 lines · 28 code · 10 blank · 16 comment · 5 complexity · 1e0b8d20e0df2a97393769d7a80414a2 MD5 · raw file
- #!/bin/bash
- # update-po.sh
- # 2004-05-30 Aurelio Jargas
- # 2010-06-18 renamed to update-po.sh, pot extraction moved to update-pot.sh
- #
- # You get the msgmerge/msgfmt commands from gettext package.
- # On the Mac, download gettext at http://rudix.org
- #
- # Tips:
- #
- # 1. To generate the .mo file:
- # msgfmt -o de.mo de.po
- #
- # 2. To install the mo file:
- # su -c "cp -v de.mo /usr/share/locale/de/LC_MESSAGES/"
- #
- cd $(dirname "$0")
- cd .. # Operate on the 'po' folder
- pot=txt2tags.pot
- becho(){ echo -e "\033[36;1m$*\033[m"; }
- for po in *.po; do
- clear
- becho "=============================================="
- becho "$po"
- becho "=============================================="
- becho
- becho "--------- Merging pot changes into $po"
- msgmerge --no-fuzzy-matching $po $pot > $po.new
- rm -f messages.mo
- becho "--------- Any difference?"
- diff -u $po $po.new
- becho "--------- Update $po? [Yn]"
- read YN
-
- if test "$YN" != n -a "$YN" != N
- then
- mv -v $po $po.old
- mv -v $po.new $po
- fi
- becho "--------- Stats for $po"
- msgfmt -c --statistics $po
-
- becho
- becho "$po done (Press Enter to continue)"
- read foo
- done