diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index 9e4de53..a3672eb 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -170,6 +170,11 @@ jobs: with: path: galette-core/galette/plugins/plugin-oauth2 + - name: Compile translations + run: | + cd galette-core + bin/console galette:compile-locales plugin-oauth2 + - name: Install plugin dependencies run: | cd galette-core/galette/plugins/plugin-oauth2 @@ -278,6 +283,11 @@ jobs: with: path: galette-core/galette/plugins/plugin-oauth2 + - name: Compile translations + run: | + cd galette-core + bin/console galette:compile-locales plugin-oauth2 + - name: Install plugin dependencies run: | cd galette-core/galette/plugins/plugin-oauth2 diff --git a/.gitignore b/.gitignore index 9aceb0c..ec257c2 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ tests/config/encryption-key.php tests/config/config.yml tests/coverage/ + +# compiled translations, built by bin/console galette:compile-locales +lang/*/LC_MESSAGES/*.mo diff --git a/bin/release b/bin/release index 3057278..0574cfd 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))) + plugin_dir = os.path.join(src_dir, rel_name) # development only, nothing a Galette installation needs diff --git a/lang/Makefile b/lang/Makefile index 3e1e366..32d2f61 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-oauth2 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 oauth2.pot; diff --git a/lang/ar/LC_MESSAGES/oauth2.mo b/lang/ar/LC_MESSAGES/oauth2.mo deleted file mode 100644 index a94fa90..0000000 Binary files a/lang/ar/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/br/LC_MESSAGES/oauth2.mo b/lang/br/LC_MESSAGES/oauth2.mo deleted file mode 100644 index a5eaadc..0000000 Binary files a/lang/br/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/ca/LC_MESSAGES/oauth2.mo b/lang/ca/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 3e0f3db..0000000 Binary files a/lang/ca/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/de/LC_MESSAGES/oauth2.mo b/lang/de/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 440a8b6..0000000 Binary files a/lang/de/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/en_US/LC_MESSAGES/oauth2.mo b/lang/en_US/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 38d554a..0000000 Binary files a/lang/en_US/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/es/LC_MESSAGES/oauth2.mo b/lang/es/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 0e24de8..0000000 Binary files a/lang/es/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/fr_FR.utf8/LC_MESSAGES/oauth2.mo b/lang/fr_FR.utf8/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 50f42bc..0000000 Binary files a/lang/fr_FR.utf8/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/fr_FR/LC_MESSAGES/oauth2.mo b/lang/fr_FR/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 50f42bc..0000000 Binary files a/lang/fr_FR/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/it/LC_MESSAGES/oauth2.mo b/lang/it/LC_MESSAGES/oauth2.mo deleted file mode 100644 index d12bfce..0000000 Binary files a/lang/it/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/nb_NO/LC_MESSAGES/oauth2.mo b/lang/nb_NO/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 8eb4fe3..0000000 Binary files a/lang/nb_NO/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/oc/LC_MESSAGES/oauth2.mo b/lang/oc/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 5e34b37..0000000 Binary files a/lang/oc/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/ota/LC_MESSAGES/oauth2.mo b/lang/ota/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 4cbcce0..0000000 Binary files a/lang/ota/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/pt/LC_MESSAGES/oauth2.mo b/lang/pt/LC_MESSAGES/oauth2.mo deleted file mode 100644 index bd24ad4..0000000 Binary files a/lang/pt/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/pt_BR/LC_MESSAGES/oauth2.mo b/lang/pt_BR/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 58936d9..0000000 Binary files a/lang/pt_BR/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/ru/LC_MESSAGES/oauth2.mo b/lang/ru/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 1ebc5f1..0000000 Binary files a/lang/ru/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/si/LC_MESSAGES/oauth2.mo b/lang/si/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 441f425..0000000 Binary files a/lang/si/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/sl/LC_MESSAGES/oauth2.mo b/lang/sl/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 6edd07e..0000000 Binary files a/lang/sl/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/ta/LC_MESSAGES/oauth2.mo b/lang/ta/LC_MESSAGES/oauth2.mo deleted file mode 100644 index d7977c5..0000000 Binary files a/lang/ta/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/tr/LC_MESSAGES/oauth2.mo b/lang/tr/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 3b9ceac..0000000 Binary files a/lang/tr/LC_MESSAGES/oauth2.mo and /dev/null differ diff --git a/lang/uk/LC_MESSAGES/oauth2.mo b/lang/uk/LC_MESSAGES/oauth2.mo deleted file mode 100644 index 4062318..0000000 Binary files a/lang/uk/LC_MESSAGES/oauth2.mo and /dev/null differ