2 SHELL
=/bin
/bash
-e
-o pipefail
7 @echo
"setup - Ubuntu/Debian für das Lokalisieren vorbereiten"
9 @echo
"de - Dies aufrufen, wenn man lokalisieren möchte"
10 @echo
"test-[de|ro] - Gibt aus wer noch was lokalisieren muss"
11 @echo
"update-[de|ro] - Aktualisiert die PO-Datei mit neuen Texten"
14 sudo apt-get
install gettext poedit python-polib
17 for lang in
$(LANGUAGES
) ; do \
18 msgfmt
-v
-o
$$lang/LC_MESSAGES
/multisite.mo
$$lang/LC_MESSAGES
/multisite.po
; \
21 # Update po file from checked out source and then call poedit. Remove warnings
22 # about not-reorderable message strings.
25 cd
$${L
#*-}/LC_MESSAGES ; \
27 xgettext
-w
80 --sort-output
--force-po \
28 -L python
--from-code
=utf-8
--omit-header \
30 ..
/..
/..
/web
/app
/index.wsgi \
31 $$(find
-L ..
/..
/..
/cmk
-type f
-name
"*.py") 2>&1 < /dev
/null | \
32 sed
'/format string with unnamed arguments cannot be properly localized/,/and a mapping instead of a tuple for the arguments./d' ; \
33 cat ..
/..
/header scanned.po
> new.po
; \
34 msgmerge
-w
80 -q
-U
-v multisite.po new.po
2>&1 < /dev
/null | grep
-v
"reference, merged" || true
; \
35 rm -f new.po scanned.po
39 sed
-i
'/^#[:.]/d' $$L/LC_MESSAGES
/multisite.po
; \
40 sed
-i
'/"POT-Creation-Date:/d' $$L/LC_MESSAGES
/multisite.po
; \
41 sed
-i
'/"PO-Revision-Date:/d' $$L/LC_MESSAGES
/multisite.po
; \
42 sed
-i
'/"Last-Translator:/d' $$L/LC_MESSAGES
/multisite.po
; \
47 POEDITOR
=$$(which poedit
2>/dev
/null || which virtaal
2>/dev
/null
) ; \
48 if
[ -z
"$$POEDITOR" ]; then \
49 echo
"ERROR: Unable to find PO file editor (poedit or virtual)" ; \
52 $$POEDITOR $@
/LC_MESSAGES
/multisite.po
53 $(MAKE
) update-
$@
# Sorgt für standardisierten Zeilenumbruch!
58 poedit
$@
/LC_MESSAGES
/multisite.po
59 sed
-i
'/^#:/d' $@
/LC_MESSAGES
/multisite.po
62 @L
=$@
; L
=$${L
#*-} ; ./blame $$L