diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 2430a859..a30074a4 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -193,6 +193,11 @@ jobs: with: path: galette-core/galette/plugins/plugin-events + - name: Compile translations + run: | + cd galette-core + bin/console galette:compile-locales plugin-events + - name: Init for PostgreSQL env: POSTGRES_HOST: localhost @@ -276,6 +281,11 @@ jobs: path: galette-core/galette/plugins/plugin-events fetch-depth: 0 + - name: Compile translations + run: | + cd galette-core + bin/console galette:compile-locales plugin-events + - name: Find previous release run: | cd galette-core/galette/plugins/plugin-events diff --git a/.gitignore b/.gitignore index 518f1345..1e4d8970 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ webroot/js/*bundle* dist/ tempcache/ tests/coverage/ + +# compiled translations, built by bin/console galette:compile-locales +lang/*/LC_MESSAGES/*.mo diff --git a/bin/release b/bin/release index e9d8045f..1d2c0015 100755 --- a/bin/release +++ b/bin/release @@ -399,6 +399,15 @@ def add_libs(rel_name, galette_archive): galette.extractall(path=src_dir) galette.close() + # compile translations: MO files are not versioned + lang_dir = os.path.join(src_dir, rel_name, 'lang') + for pot in fnmatch.filter(os.listdir(lang_dir), '*.pot'): + domain = pot[:-len('.pot')] + for po in fnmatch.filter(os.listdir(lang_dir), '%s_*.po' % domain): + mo_dir = os.path.join(lang_dir, po[len(domain) + 1:-len('.po')], 'LC_MESSAGES') + os.makedirs(mo_dir, exist_ok=True) + run('msgfmt --check -o "%s" "%s"' % (os.path.join(mo_dir, domain + '.mo'), os.path.join(lang_dir, po))) + npm_dir = os.path.join(src_dir, rel_name) npm_cmd = 'npm install --prefix %s' % npm_dir print(npm_cmd) diff --git a/lang/Makefile b/lang/Makefile index b51880bd..e1611f30 100644 --- a/lang/Makefile +++ b/lang/Makefile @@ -25,21 +25,7 @@ po : done mo : - @echo "Generating MO files:" - @for l in ${LANGUAGES}; do \ - for d in ${DOMAINS}; do \ - mkdir -p ${INSTALLDIR}/$${l}/LC_MESSAGES; \ - echo " formatting ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo."; \ - msgfmt $${d}_$${l}.po -o ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new; \ - if diff -qI 'PO-Revision-Date:.*' ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo > /dev/null; then \ - echo " $${d}.mo NOT updated."; \ - rm ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new; \ - else \ - echo " $${d}.mo UPDATED."; \ - mv ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo.new ${INSTALLDIR}/$${l}/LC_MESSAGES/$${d}.mo; \ - fi; \ - done \ - done + cd ../../../../ && bin/console galette:compile-locales plugin-events extract : twig ${PHP_SOURCES} Makefile xgettext ${PHP_SOURCES} --keyword=_T:1,2t --keyword=__:1,2t --keyword=_Tn:1,2,4t --keyword=_Tx:1c,2,3t --keyword=_Tnx:1c,2,3,5t -L PHP --from-code=UTF-8 --add-comments=TRANS --force-po -o events.pot; diff --git a/lang/ar.utf8/LC_MESSAGES/events.mo b/lang/ar.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 4027058a..00000000 Binary files a/lang/ar.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ar/LC_MESSAGES/events.mo b/lang/ar/LC_MESSAGES/events.mo deleted file mode 100644 index ce319400..00000000 Binary files a/lang/ar/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/br.utf8/LC_MESSAGES/events.mo b/lang/br.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index a6f1255d..00000000 Binary files a/lang/br.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/br/LC_MESSAGES/events.mo b/lang/br/LC_MESSAGES/events.mo deleted file mode 100644 index 7c628a80..00000000 Binary files a/lang/br/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ca.utf8/LC_MESSAGES/events.mo b/lang/ca.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 91fd9522..00000000 Binary files a/lang/ca.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ca/LC_MESSAGES/events.mo b/lang/ca/LC_MESSAGES/events.mo deleted file mode 100644 index d64648f8..00000000 Binary files a/lang/ca/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/de_DE.utf8/LC_MESSAGES/events.mo b/lang/de_DE.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 088edd58..00000000 Binary files a/lang/de_DE.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/de_DE/LC_MESSAGES/events.mo b/lang/de_DE/LC_MESSAGES/events.mo deleted file mode 100644 index 088edd58..00000000 Binary files a/lang/de_DE/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/en_US/LC_MESSAGES/events.mo b/lang/en_US/LC_MESSAGES/events.mo deleted file mode 100644 index f8500dd7..00000000 Binary files a/lang/en_US/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/es.utf8/LC_MESSAGES/events.mo b/lang/es.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index b2ccddfd..00000000 Binary files a/lang/es.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/es/LC_MESSAGES/events.mo b/lang/es/LC_MESSAGES/events.mo deleted file mode 100644 index b2ccddfd..00000000 Binary files a/lang/es/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/fr_FR.utf8/LC_MESSAGES/events.mo b/lang/fr_FR.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 329728ec..00000000 Binary files a/lang/fr_FR.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/fr_FR/LC_MESSAGES/events.mo b/lang/fr_FR/LC_MESSAGES/events.mo deleted file mode 100644 index 329728ec..00000000 Binary files a/lang/fr_FR/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/it_IT.utf8/LC_MESSAGES/events.mo b/lang/it_IT.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 8ca93936..00000000 Binary files a/lang/it_IT.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/it_IT/LC_MESSAGES/events.mo b/lang/it_IT/LC_MESSAGES/events.mo deleted file mode 100644 index 8ca93936..00000000 Binary files a/lang/it_IT/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/nb_NO.utf8/LC_MESSAGES/events.mo b/lang/nb_NO.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 69937efa..00000000 Binary files a/lang/nb_NO.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/nb_NO/LC_MESSAGES/events.mo b/lang/nb_NO/LC_MESSAGES/events.mo deleted file mode 100644 index 666ac9de..00000000 Binary files a/lang/nb_NO/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/oc.utf8/LC_MESSAGES/events.mo b/lang/oc.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 14357a85..00000000 Binary files a/lang/oc.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/oc/LC_MESSAGES/events.mo b/lang/oc/LC_MESSAGES/events.mo deleted file mode 100644 index d2d90249..00000000 Binary files a/lang/oc/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ota.utf8/LC_MESSAGES/events.mo b/lang/ota.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 5228cf99..00000000 Binary files a/lang/ota.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ota/LC_MESSAGES/events.mo b/lang/ota/LC_MESSAGES/events.mo deleted file mode 100644 index 0f33f33e..00000000 Binary files a/lang/ota/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/pt.utf8/LC_MESSAGES/events.mo b/lang/pt.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index eec6c0d3..00000000 Binary files a/lang/pt.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/pt/LC_MESSAGES/events.mo b/lang/pt/LC_MESSAGES/events.mo deleted file mode 100644 index eec6c0d3..00000000 Binary files a/lang/pt/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/pt_BR.utf8/LC_MESSAGES/events.mo b/lang/pt_BR.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 558664f9..00000000 Binary files a/lang/pt_BR.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/pt_BR/LC_MESSAGES/events.mo b/lang/pt_BR/LC_MESSAGES/events.mo deleted file mode 100644 index 558664f9..00000000 Binary files a/lang/pt_BR/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ru.utf8/LC_MESSAGES/events.mo b/lang/ru.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index f48425e9..00000000 Binary files a/lang/ru.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ru/LC_MESSAGES/events.mo b/lang/ru/LC_MESSAGES/events.mo deleted file mode 100644 index f48425e9..00000000 Binary files a/lang/ru/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/si.utf8/LC_MESSAGES/events.mo b/lang/si.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index c834683e..00000000 Binary files a/lang/si.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/si/LC_MESSAGES/events.mo b/lang/si/LC_MESSAGES/events.mo deleted file mode 100644 index f432382e..00000000 Binary files a/lang/si/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/sl.utf8/LC_MESSAGES/events.mo b/lang/sl.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index bbded562..00000000 Binary files a/lang/sl.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/sl/LC_MESSAGES/events.mo b/lang/sl/LC_MESSAGES/events.mo deleted file mode 100644 index bbded562..00000000 Binary files a/lang/sl/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ta.utf8/LC_MESSAGES/events.mo b/lang/ta.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index 5c19a63e..00000000 Binary files a/lang/ta.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/ta/LC_MESSAGES/events.mo b/lang/ta/LC_MESSAGES/events.mo deleted file mode 100644 index 5c19a63e..00000000 Binary files a/lang/ta/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/tr.utf8/LC_MESSAGES/events.mo b/lang/tr.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index da762800..00000000 Binary files a/lang/tr.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/tr/LC_MESSAGES/events.mo b/lang/tr/LC_MESSAGES/events.mo deleted file mode 100644 index 442f66a5..00000000 Binary files a/lang/tr/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/uk.utf8/LC_MESSAGES/events.mo b/lang/uk.utf8/LC_MESSAGES/events.mo deleted file mode 100644 index dc1cdf5c..00000000 Binary files a/lang/uk.utf8/LC_MESSAGES/events.mo and /dev/null differ diff --git a/lang/uk/LC_MESSAGES/events.mo b/lang/uk/LC_MESSAGES/events.mo deleted file mode 100644 index dc1cdf5c..00000000 Binary files a/lang/uk/LC_MESSAGES/events.mo and /dev/null differ