# HG changeset patch # User Christophe Lincoln # Date 1289507729 -3600 # Node ID cc8b4e7e46b349db606ca9e2c4f92df912458be8 # Parent 740c4e602c14fc21d348a34343c48062c32dd1d2 Prepa for gettextization (Makefile and box) diff -r 740c4e602c14 -r cc8b4e7e46b3 Makefile --- a/Makefile Sun Nov 07 08:28:41 2010 +0000 +++ b/Makefile Thu Nov 11 21:35:29 2010 +0100 @@ -4,13 +4,32 @@ SBINDIR?=/sbin PREFIX?=/usr DOCDIR?=/usr/share/doc +LINGUAS?= all: +# i18n. + +pot: + xgettext -o po/tazlitobox/tazlitobox.pot -L Shell ./tazlitobox + +msgmerge: + @for l in $(LINGUAS); do \ + echo -n "Updating $$l po file."; \ + msgmerge -U po/tazlitobox/$$l.po po/tazlitobox/tazlitobox.pot ; \ + done; + +msgfmt: + @for l in $(LINGUAS); do \ + echo "Compiling $$l mo file..."; \ + mkdir -p po/mo/$$l/LC_MESSAGES; \ + msgfmt -o po/mo/$$l/LC_MESSAGES/tazlitobox.mo po/tazlitobox/$$l.po ; \ + done; + # Installation. # Config file goes in /etc/tazlito -install: +install: msgfmt @echo "Installing Tazlito into $(PREFIX)/bin..." install -g root -o root -m 0777 tazlito $(PREFIX)/bin install -g root -o root -m 0777 tazlitobox $(PREFIX)/bin @@ -20,6 +39,9 @@ @echo "Installing Tazlito documentation..." install -g root -o root -m 0755 -d /usr/share/doc/tazlito install -g root -o root -m 0644 doc/tazlito.en.html /usr/share/doc/tazlito + # i18n + mkdir -p $(DESTDIR)$(PREFIX)/share/locale + cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale # Uninstallation commands. @@ -28,4 +50,11 @@ rm -f $(PREFIX)/bin/tazlitobox rm -rf /etc/tazlito rm -rf /usr/share/doc/tazlito + rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazlito*.mo +clean: + rm -rf _pkg + rm -rf po/mo + + + diff -r 740c4e602c14 -r cc8b4e7e46b3 tazlitobox --- a/tazlitobox Sun Nov 07 08:28:41 2010 +0000 +++ b/tazlitobox Thu Nov 11 21:35:29 2010 +0100 @@ -8,6 +8,13 @@ # VERSION=3.0 +# Include gettext helper script. +. /usr/bin/gettext.sh + +# Export package name for gettext. +TEXTDOMAIN='tazusbbox' +export TEXTDOMAIN + export BIN=$0 # Check if user is root.