tazlito rev 188

Prepa for gettextization (Makefile and box)
author Christophe Lincoln <pankso@slitaz.org>
date Thu Nov 11 21:35:29 2010 +0100 (2010-11-11)
parents 740c4e602c14
children bac6501cea49
files Makefile tazlitobox
line diff
     1.1 --- a/Makefile	Sun Nov 07 08:28:41 2010 +0000
     1.2 +++ b/Makefile	Thu Nov 11 21:35:29 2010 +0100
     1.3 @@ -4,13 +4,32 @@
     1.4  SBINDIR?=/sbin
     1.5  PREFIX?=/usr
     1.6  DOCDIR?=/usr/share/doc
     1.7 +LINGUAS?=
     1.8  
     1.9  all:
    1.10  
    1.11 +# i18n.
    1.12 +
    1.13 +pot:
    1.14 +	xgettext -o po/tazlitobox/tazlitobox.pot -L Shell ./tazlitobox
    1.15 +
    1.16 +msgmerge:
    1.17 +	@for l in $(LINGUAS); do \
    1.18 +		echo -n "Updating $$l po file."; \
    1.19 +		msgmerge -U po/tazlitobox/$$l.po po/tazlitobox/tazlitobox.pot ; \
    1.20 +	done;
    1.21 +
    1.22 +msgfmt:
    1.23 +	@for l in $(LINGUAS); do \
    1.24 +		echo "Compiling $$l mo file..."; \
    1.25 +		mkdir -p po/mo/$$l/LC_MESSAGES; \
    1.26 +		msgfmt -o po/mo/$$l/LC_MESSAGES/tazlitobox.mo po/tazlitobox/$$l.po ; \
    1.27 +	done;
    1.28 +
    1.29  # Installation.
    1.30  # Config file goes in /etc/tazlito
    1.31  
    1.32 -install:
    1.33 +install: msgfmt
    1.34  	@echo "Installing Tazlito into $(PREFIX)/bin..."
    1.35  	install -g root -o root -m 0777 tazlito $(PREFIX)/bin
    1.36  	install -g root -o root -m 0777 tazlitobox $(PREFIX)/bin
    1.37 @@ -20,6 +39,9 @@
    1.38  	@echo "Installing Tazlito documentation..."
    1.39  	install -g root -o root -m 0755 -d /usr/share/doc/tazlito
    1.40  	install -g root -o root -m 0644 doc/tazlito.en.html /usr/share/doc/tazlito
    1.41 +	# i18n
    1.42 +	mkdir -p $(DESTDIR)$(PREFIX)/share/locale
    1.43 +	cp -a po/mo/* $(DESTDIR)$(PREFIX)/share/locale
    1.44  
    1.45  # Uninstallation commands.
    1.46  
    1.47 @@ -28,4 +50,11 @@
    1.48  	rm -f $(PREFIX)/bin/tazlitobox
    1.49  	rm -rf /etc/tazlito
    1.50  	rm -rf /usr/share/doc/tazlito
    1.51 +	rm -rf $(DESTDIR)$(PREFIX)/share/locale/*/LC_MESSAGES/tazlito*.mo
    1.52  
    1.53 +clean:
    1.54 +	rm -rf _pkg
    1.55 +	rm -rf po/mo
    1.56 +	
    1.57 +
    1.58 +
     2.1 --- a/tazlitobox	Sun Nov 07 08:28:41 2010 +0000
     2.2 +++ b/tazlitobox	Thu Nov 11 21:35:29 2010 +0100
     2.3 @@ -8,6 +8,13 @@
     2.4  #
     2.5  VERSION=3.0
     2.6  
     2.7 +# Include gettext helper script.
     2.8 +. /usr/bin/gettext.sh
     2.9 +
    2.10 +# Export package name for gettext.
    2.11 +TEXTDOMAIN='tazusbbox'
    2.12 +export TEXTDOMAIN
    2.13 +
    2.14  export BIN=$0
    2.15  
    2.16  # Check if user is root.