Remove echo for printf
Check if 'src/IDF/conf/path.php' exist before use it
This commit is contained in:
parent
c279313048
commit
c2bf1bac38
66
Makefile
66
Makefile
@ -22,25 +22,35 @@
|
|||||||
# sudo apt-get install python-setuptools
|
# sudo apt-get install python-setuptools
|
||||||
# sudo easy_install -U transifex-client
|
# sudo easy_install -U transifex-client
|
||||||
|
|
||||||
PLUF_PATH=$(shell php -r "require_once('src/IDF/conf/path.php'); echo PLUF_PATH;")
|
|
||||||
|
|
||||||
all help:
|
|
||||||
@echo "Rules for generate tarball :"
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@printf "Rules for generate tarball :\n"
|
||||||
@for b in `git branch | sed "s/^. //g"`; do \
|
@for b in `git branch | sed "s/^. //g"`; do \
|
||||||
echo -e "\t"$$b"_tarball - Generate a zip archive of the "$$b" branch."; \
|
printf "\t"$$b"_tarball - Generate a zip archive of the "$$b" branch.\n"; \
|
||||||
done
|
done
|
||||||
@echo -e "\nRules for internationnalization :";
|
@printf "\nRules for internationnalization :\n";
|
||||||
@echo -e "\tpot-update - Update the POT file from HTML template and PHP source, then merge it with PO file"
|
@printf "\tpot-update - Update the POT file from HTML template and PHP source, then merge it with PO file.\n"
|
||||||
@echo -e "\tpot-push - Send the POT file on transifex server"
|
@printf "\tpot-push - Send the POT file on transifex server.\n"
|
||||||
@echo -e "\tpo-update - Merge POT file into PO file. POT is not regenerated."
|
@printf "\tpo-update - Merge POT file into PO file. POT is not regenerated.\n"
|
||||||
@echo -e "\tpo-push - Send the all PO file on transifex server"
|
@printf "\tpo-push - Send the all PO file on transifex server.\n"
|
||||||
@echo -e "\tpo-pull - Get all PO file from transifex server"
|
@printf "\tpo-pull - Get all PO file from transifex server.\n"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Internationnalization rule, POT & PO file manipulation
|
# Internationnalization rule, POT & PO file manipulation
|
||||||
#
|
#
|
||||||
|
.PHONY: pluf_path
|
||||||
|
pluf_path:
|
||||||
|
ifeq (src/IDF/conf/path.php, $(wildcard src/IDF/conf/path.php))
|
||||||
|
PLUF_PATH=$(shell php -r "require_once('src/IDF/conf/path.php'); echo PLUF_PATH;")
|
||||||
|
else
|
||||||
|
@printf "File 'src/IDF/conf/path.php' don't exist. Please configure it !\n"
|
||||||
|
@exit 1
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: pot-update po-update
|
.PHONY: pot-update po-update
|
||||||
pot-update:
|
pot-update: pluf_path
|
||||||
# Backup pot file
|
# Backup pot file
|
||||||
@if [ -e src/IDF/locale/idf.pot ]; then \
|
@if [ -e src/IDF/locale/idf.pot ]; then \
|
||||||
mv -f src/IDF/locale/idf.pot src/IDF/locale/idf.pot.bak; \
|
mv -f src/IDF/locale/idf.pot src/IDF/locale/idf.pot.bak; \
|
||||||
@ -49,7 +59,7 @@ pot-update:
|
|||||||
# Extract string
|
# Extract string
|
||||||
@cd src; php $(PLUF_PATH)/extracttemplates.php IDF/conf/idf.php IDF/gettexttemplates
|
@cd src; php $(PLUF_PATH)/extracttemplates.php IDF/conf/idf.php IDF/gettexttemplates
|
||||||
@cd src; for phpfile in `find . -iname "*.php"`; do \
|
@cd src; for phpfile in `find . -iname "*.php"`; do \
|
||||||
echo "Parsing file : "$$phpfile; \
|
printf "Parsing file : "$$phpfile"\n"; \
|
||||||
xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j --keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
|
xgettext -o idf.pot -p ./IDF/locale/ --from-code=UTF-8 -j --keyword --keyword=__ --keyword=_n:1,2 -L PHP $$phpfile ; \
|
||||||
done
|
done
|
||||||
# Remove tmp folder
|
# Remove tmp folder
|
||||||
@ -57,11 +67,11 @@ pot-update:
|
|||||||
# Update PO
|
# Update PO
|
||||||
@make po-update
|
@make po-update
|
||||||
|
|
||||||
po-update:
|
po-update: pluf_path
|
||||||
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
@for pofile in `ls src/IDF/locale/*/idf.po`; do \
|
||||||
echo "Updating file : "$$pofile; \
|
printf "Updating file : "$$pofile"\n"; \
|
||||||
msgmerge -v -U $$pofile src/IDF/locale/idf.pot; \
|
msgmerge -v -U $$pofile src/IDF/locale/idf.pot; \
|
||||||
echo ; \
|
printf "\n"; \
|
||||||
done
|
done
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -72,22 +82,22 @@ check-tx-config:
|
|||||||
@if [ ! -e .tx/config ]; then \
|
@if [ ! -e .tx/config ]; then \
|
||||||
mkdir -p .tx; \
|
mkdir -p .tx; \
|
||||||
touch .tx/config; \
|
touch .tx/config; \
|
||||||
echo "[main]" >> .tx/config; \
|
printf "[main]\n" >> .tx/config; \
|
||||||
echo "host = http://www.transifex.net" >> .tx/config; \
|
printf "host = http://www.transifex.net\n" >> .tx/config; \
|
||||||
echo "" >> .tx/config; \
|
printf "\n" >> .tx/config; \
|
||||||
echo "[indefero.idfpot]" >> .tx/config; \
|
printf "[indefero.idfpot]\n" >> .tx/config; \
|
||||||
echo "file_filter = src/IDF/locale/<lang>/idf.po" >> .tx/config; \
|
printf "file_filter = src/IDF/locale/<lang>/idf.po\n" >> .tx/config; \
|
||||||
echo "source_file = src/IDF/locale/idf.pot" >> .tx/config; \
|
printf "source_file = src/IDF/locale/idf.pot\n" >> .tx/config; \
|
||||||
echo "source_lang = en" >> .tx/config; \
|
printf "source_lang = en\n" >> .tx/config; \
|
||||||
fi
|
fi
|
||||||
@if [ ! -e $(HOME)/.transifexrc ]; then \
|
@if [ ! -e $(HOME)/.transifexrc ]; then \
|
||||||
touch $(HOME)/.transifexrc; \
|
touch $(HOME)/.transifexrc; \
|
||||||
echo "[http://www.transifex.net]" >> $(HOME)/.transifexrc; \
|
printf "[http://www.transifex.net]\n" >> $(HOME)/.transifexrc; \
|
||||||
echo "username = " >> $(HOME)/.transifexrc; \
|
printf "username = \n" >> $(HOME)/.transifexrc; \
|
||||||
echo "token = " >> $(HOME)/.transifexrc; \
|
printf "token = \n" >> $(HOME)/.transifexrc; \
|
||||||
echo "password = " >> $(HOME)/.transifexrc; \
|
printf "password = \n" >> $(HOME)/.transifexrc; \
|
||||||
echo "hostname = http://www.transifex.net" >> $(HOME)/.transifexrc; \
|
printf "hostname = http://www.transifex.net\n" >> $(HOME)/.transifexrc; \
|
||||||
echo "You must edit the file ~/.transifexrc to setup your transifex account (login & password) !"; \
|
printf "You must edit the file ~/.transifexrc to setup your transifex account (login & password) !\n"; \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user