-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.003
More file actions
47 lines (39 loc) · 1.67 KB
/
Makefile.003
File metadata and controls
47 lines (39 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#! /usr/bin/make -f
all: help
help:
@echo make all .................... : cette aide
@echo make help ................... : cette aide aussi
@echo make multilingue.pot ........ : recree le fichier de chaine sources
@echo make newlang DEST_LANG=xx ... : initialise les répertoires pour une langue
@echo make translate DEST_LANG=xx . : fait la traduction d\'une langue. met a jour
@echo make cleanall ............... : enleve tous les fichiers générés.
@echo
@echo
@echo exemple :
@echo bash multilingue '#' ca lance le script en anglais.
@echo make -f Makefile.003 newlang DEST_LANG=$$LANG
@echo make -f Makefile.003 translate DEST_LANG=$$LANG
@echo bash multilingue '#' ca lance le script traduit.
BASE_NAME=multilingue
POT_FILE=$(BASE_NAME).pot
L= DLANG="$(DEST_LANG)"; DLANG=$${DLANG%.*} ;
$(POT_FILE): $(BASE_NAME)
bash --dump-po-strings $(BASE_NAME) | xgettext -L PO -o $(POT_FILE) -
checklang:
@test '' != "$(DEST_LANG)" || { echo missing lang variable DEST_LANG ;\
echo run make help for help; false ; } >&2
newlang: checklang $(POT_FILE)
$L mkdir -p locale/"$$DLANG"/LC_MESSAGES
@$L test ! -r locale/"$$DLANG"/LC_MESSAGES/$(BASE_NAME).po || { \
echo "$La langue $$DLANG existe deja"; \
echo "pour mettre a jour : make translate"; \
false ; } >&2
$L msginit -l $(DEST_LANG) -i $(POT_FILE) -o locale/"$$DLANG"/LC_MESSAGES/$(BASE_NAME).po
translate: checklang $(POT_FILE)
$L test -r locale/"$$DLANG"/LC_MESSAGES/$(BASE_NAME).po || { \
echo did you run make newlang '?' ; false ; } >&2
$L msgmerge -U locale/"$$DLANG"/LC_MESSAGES/$(BASE_NAME).po \
multilingue.pot
$L poedit locale/"$$DLANG"/LC_MESSAGES/$(BASE_NAME).po
cleanall:
rm -rf $(BASE_NAME).* *% *~ locale