From a57e89c82d1d6c041ffb6436b0d2e954ae218776 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Tue, 23 Apr 2013 16:20:02 +0200 Subject: [PATCH] * Makefile : Installation des fichiers de langue Compilation et Installation des fichiers de traductions pour Tiramisu --- Makefile | 33 ++++++++++++++++++++++++++++++++- translations/fr/tiramisu.mo | Bin 1015 -> 0 bytes 2 files changed, 32 insertions(+), 1 deletion(-) delete mode 100644 translations/fr/tiramisu.mo diff --git a/Makefile b/Makefile index 33922ac..ecefe19 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,9 @@ INSTALL_DATA := install -m 644 INSTALL_PROGRAM := install -m 755 INSTALL_DIR := install -m 755 -d +TRADUC_DIR = translations +TRADUC_DEST = $(DESTDIR)/usr/share/locale + PYTHON_OPTS = ifneq ($(DESTDIR),) PYTHON_OPTS += --root $(DESTDIR) @@ -16,16 +19,44 @@ LAST_TAG := $(shell git describe --tags --abbrev=0) VERSION := $(shell echo $(LAST_TAG) | awk -F'/' '{print $$2}' || true) VERSION_FILE := version.in +# Build translation files +define build_translation + if [ -d ${1} ]; then \ + for f in `find ${1} -name "*.po"`; do \ + msgfmt -o `dirname $$f`/`basename -s ".po" $$f`.mo $$f || true; \ + done; \ + fi +endef + +# Install Traduction +define install_translation + if [ -d ${1} ]; then \ + for file in `find ${1} -name "*.mo"`; do \ + $(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2` || true; \ + $(INSTALL_DIR) $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \ + $(INSTALL_DATA) $$file $(TRADUC_DEST)/`echo $$file | cut -d '/' -f 2`/LC_MESSAGES || true; \ + done; \ + fi +endef + all: clean: $(RM) -r build $(RM) -r tiramisu.egg-info/ + $(RM) -r $(TRADUC_DIR)/*/*.mo test: clean py.test -install: +build-lang: + $(call build_translation, $(TRADUC_DIR)) + +install-lang: build-lang + $(INSTALL_DIR) $(TRADUC_DEST) + $(call install_translation, $(TRADUC_DIR)) + +install: install-lang python setup.py install --no-compile $(PYTHON_OPTS) # List in .PHONY to force generation at each call diff --git a/translations/fr/tiramisu.mo b/translations/fr/tiramisu.mo deleted file mode 100644 index 300e24e615512634bfd7a5a4b811e25a287773d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1015 zcmZuv%Wl*#6b(>{H0;>00HMnYq2eK#c3>19LbOvfYpI{sbKy@$Y z!DoTVn89RrvZy%aGO@JpOGi6QQj;m1GP(|{dU}hrada3S1xg>tT&0xAJn^}7oDu?_ z$+GiSV>vW-oS-@o(_wTJXhVt7LzPikaH56^x*hLGGpC#eUcb=hm8SK&7#$vwnk<&8 z-kK&5KT&4Z_+s0=DHsLN)+9p}*{14Sh3j6nhf1fxhBbSfII)t7Ew&}D7gN~oF0?ke zFxH8+GE=E|?6Xn~OiZnf^?_KlEUSkQOSorDoiLgg;ezPQQ?w9Acjm%Q7(ysE`9M_} z|EufVoeLxAR%PkLz)D@>)r>`nRjD&CGZq7u`!S8)zw`=y_t#hZbe~Pmk7OcJwP$pD zXdkxLR@VB{-lKNdS~S|RM%MZn9KUwAi(D#wkCI(!OLh;Q4VFc3s;jCG*^0hSOsaGi zQ*TGP)^qWMHQT1G4a2E&6t%nU?n#R=E#vIyi&Q1ljYK>(-X^@*l!~dTH8xXfkYn`K zSthUfUqewLOYGGDZcFCuEtg|YjgB!L+YGm(0%a(_(RgxdsV(D6O8J1_!c(K;+ElhK n);KLVZ6<^?JUUL*?3{8Ij5ReBYS;3{SbrI+&QLpQA`AWi2Zt`8