PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/po/tools/update-po.sh

http://txt2tags.googlecode.com/
Shell | 54 lines | 28 code | 10 blank | 16 comment | 5 complexity | 1e0b8d20e0df2a97393769d7a80414a2 MD5 | raw file
 1#!/bin/bash
 2# update-po.sh
 3# 2004-05-30 Aurelio Jargas
 4# 2010-06-18 renamed to update-po.sh, pot extraction moved to update-pot.sh
 5#
 6# You get the msgmerge/msgfmt commands from gettext package.
 7# On the Mac, download gettext at http://rudix.org
 8#
 9# Tips:
10#
11#   1. To generate the .mo file:
12#      msgfmt -o de.mo de.po
13#
14#   2. To install the mo file:
15#      su -c "cp -v de.mo /usr/share/locale/de/LC_MESSAGES/"
16#
17
18cd $(dirname "$0")
19
20cd ..  # Operate on the 'po' folder
21
22pot=txt2tags.pot
23
24becho(){ echo -e "\033[36;1m$*\033[m"; }
25
26for po in *.po; do
27	clear
28	becho "=============================================="
29	becho "$po"
30	becho "=============================================="
31	becho
32	becho "--------- Merging pot changes into $po"
33	msgmerge --no-fuzzy-matching $po $pot > $po.new
34	rm -f messages.mo
35
36	becho "--------- Any difference?"
37	diff -u $po $po.new
38
39	becho "--------- Update $po? [Yn]"
40	read YN
41	
42	if test "$YN" != n -a "$YN" != N
43	then
44		mv -v $po $po.old
45		mv -v $po.new $po
46	fi
47
48	becho "--------- Stats for $po"
49	msgfmt -c --statistics $po
50	
51	becho
52	becho "$po done    (Press Enter to continue)"
53	read foo
54done