2023-09-14 13:57:59 +02:00
|
|
|
.PHONY: test all
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := all
|
|
|
|
|
2023-09-14 17:29:33 +02:00
|
|
|
all: update_trad
|
2021-10-24 01:38:57 +02:00
|
|
|
|
|
|
|
node_modules/jest/bin/jest.js:
|
|
|
|
npm install jest
|
|
|
|
|
|
|
|
node_modules/puppeteer:
|
|
|
|
npm install puppeteer
|
|
|
|
|
|
|
|
test: node_modules/jest/bin/jest.js node_modules/puppeteer
|
|
|
|
./node_modules/jest/bin/jest.js
|
2023-09-14 13:57:59 +02:00
|
|
|
|
2023-09-14 17:29:33 +02:00
|
|
|
update_trad:
|
2023-09-14 13:57:59 +02:00
|
|
|
# Extraction des phrases traductibles...
|
2023-09-29 11:53:15 +02:00
|
|
|
@xgettext --from-code=utf-8 --no-location --output=./locale/application.pot *.php templates/*.php templates/components/*.php
|
2023-09-14 13:57:59 +02:00
|
|
|
|
|
|
|
# Mise a jour des fichiers .po...
|
|
|
|
@for lang in $$(find locale -mindepth 1 -maxdepth 1 -type d); do \
|
|
|
|
po_file="$$lang/LC_MESSAGES/application.po"; \
|
|
|
|
msgmerge --update -N "$$po_file" ./locale/application.pot; \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Creation des fichiers .mo...
|
|
|
|
@for lang in $$(find locale -mindepth 1 -maxdepth 1 -type d); do \
|
2023-09-25 16:22:34 +02:00
|
|
|
po_file="$$lang/LC_MESSAGES/application.po"; \
|
|
|
|
rm -f "$$lang/LC_MESSAGES/application.mo"; \
|
|
|
|
msgfmt "$$po_file" --output-file="$$lang/LC_MESSAGES/application.mo"; \
|
|
|
|
git add "$$lang/LC_MESSAGES/application.mo"; \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Génération des empreintes de .mo..
|
|
|
|
|
|
|
|
@for lang in $$(find locale -mindepth 1 -maxdepth 1 -type d); do \
|
|
|
|
checksum="$$(md5sum locale/*/LC_MESSAGES/application.mo | md5sum | cut -d " " -f 1)"; \
|
|
|
|
rm $$lang/LC_MESSAGES/application_*.mo; \
|
|
|
|
git rm $$lang/LC_MESSAGES/application_*.mo; \
|
|
|
|
rm locale/application_*.pot; \
|
|
|
|
git rm locale/application_*.pot; \
|
|
|
|
ln -s "application.mo" "$$lang/LC_MESSAGES/application_$$checksum.mo"; \
|
|
|
|
ln -s "application.pot" "locale/application_$$checksum.pot"; \
|
|
|
|
git add "$$lang/LC_MESSAGES/application_$$checksum.mo"; \
|
|
|
|
git add "locale/application_$$checksum.pot"; \
|
|
|
|
done
|