diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 1620117..073e75a 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -191,6 +191,11 @@ jobs: with: path: galette-core/galette/plugins/plugin-maps + - name: Compile translations + run: | + cd galette-core + bin/console galette:compile-locales plugin-maps + - name: Init for PostgreSQL env: POSTGRES_HOST: localhost diff --git a/.gitignore b/.gitignore index 1f66019..43a0d98 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ webroot/images/* !webroot/images/marker-galette-pro.png 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 5e2c359..019945b 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 216016c..059490b 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-maps 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 maps.pot; diff --git a/lang/ar.utf8/LC_MESSAGES/maps.mo b/lang/ar.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 42628cf..0000000 Binary files a/lang/ar.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/br.utf8/LC_MESSAGES/maps.mo b/lang/br.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 37604cd..0000000 Binary files a/lang/br.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/ca.utf8/LC_MESSAGES/maps.mo b/lang/ca.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 4a6092b..0000000 Binary files a/lang/ca.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/de_DE.utf8/LC_MESSAGES/maps.mo b/lang/de_DE.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 210ff47..0000000 Binary files a/lang/de_DE.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/en_US/LC_MESSAGES/maps.mo b/lang/en_US/LC_MESSAGES/maps.mo deleted file mode 100644 index f923b00..0000000 Binary files a/lang/en_US/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/es.utf8/LC_MESSAGES/maps.mo b/lang/es.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 2e3840d..0000000 Binary files a/lang/es.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/fr_FR.utf8/LC_MESSAGES/maps.mo b/lang/fr_FR.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 8fb91d4..0000000 Binary files a/lang/fr_FR.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/it_IT.utf8/LC_MESSAGES/maps.mo b/lang/it_IT.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 9d26c6d..0000000 Binary files a/lang/it_IT.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/nb_NO.utf8/LC_MESSAGES/maps.mo b/lang/nb_NO.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 76fda09..0000000 Binary files a/lang/nb_NO.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/oc.utf8/LC_MESSAGES/maps.mo b/lang/oc.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index b145dea..0000000 Binary files a/lang/oc.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/ota.utf8/LC_MESSAGES/maps.mo b/lang/ota.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index d827dd0..0000000 Binary files a/lang/ota.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/pt.utf8/LC_MESSAGES/maps.mo b/lang/pt.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 78aa68c..0000000 Binary files a/lang/pt.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/pt_BR.utf8/LC_MESSAGES/maps.mo b/lang/pt_BR.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 928759b..0000000 Binary files a/lang/pt_BR.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/ru.utf8/LC_MESSAGES/maps.mo b/lang/ru.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index cf52501..0000000 Binary files a/lang/ru.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/si.utf8/LC_MESSAGES/maps.mo b/lang/si.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 94286e0..0000000 Binary files a/lang/si.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/sl.utf8/LC_MESSAGES/maps.mo b/lang/sl.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index fb28166..0000000 Binary files a/lang/sl.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/sl/LC_MESSAGES/maps.mo b/lang/sl/LC_MESSAGES/maps.mo deleted file mode 100644 index 051063d..0000000 Binary files a/lang/sl/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/ta.utf8/LC_MESSAGES/maps.mo b/lang/ta.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 5027cc2..0000000 Binary files a/lang/ta.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/tr.utf8/LC_MESSAGES/maps.mo b/lang/tr.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 0864e20..0000000 Binary files a/lang/tr.utf8/LC_MESSAGES/maps.mo and /dev/null differ diff --git a/lang/uk.utf8/LC_MESSAGES/maps.mo b/lang/uk.utf8/LC_MESSAGES/maps.mo deleted file mode 100644 index 8824d7e..0000000 Binary files a/lang/uk.utf8/LC_MESSAGES/maps.mo and /dev/null differ