We have some packages that started their lives as non-core addons, but didn't merge their translations into plone.app.locales when they were added to core.
See:
[edit by @jensens] added 2 packages
[edit by @gforcada] added a bunch more
HOW TO
[remixed by @gforcada from https://github.com/plone/plone.app.event/issues/181#issuecomment-96406149 thanks @vincentfretin]
- get a working buildout.coredev checkout
- checkout the target package (
./bin/develop co $PACKAGE_NAME)
- modify the target package to use the plone domain (see plone/plone.app.discussion@0713bcd and plone/plone.app.discussion@19fe254)
- modify
experimental/i18n.cfg in buildout.coredev 5.1 to include the target package in plone domain. See plone/buildout.coredev@802549d
- run
bin/buildout -c experimental/i18n.cfg on buildout.coredev 5.1
- use
bin/i18n plone to regenerate plone.pot and resync plone files. (If there is any removed messages, be sure to look if this is normal, it may be an issue you have to fix before continuing your work)
- use
bin/i18ndude admix command to transfer translated messages from the target package to plone.po for each language. Something like this:
P_A_LOCALES="src/plone.app.locales/plone/app/locales/locales"
TARGET_PACKAGE="src/plone.app.discussion/plone/app/discussion/locales"
PO_FILE="plone.app.discusion.po"
locales=`cd ${TARGET_PACKAGE}; ls | /bin/grep -v .pot`
for locale in $locales;
do
bin/i18ndude admix ${P_A_LOCALES}/$locale/LC_MESSAGES/plone.po ${TARGET_PACKAGE}/$locale/LC_MESSAGES/${PO_FILE} > ${P_A_LOCALES}/$locale/LC_MESSAGES/plone.po.tmp
mv ${P_A_LOCALES}/$locale/LC_MESSAGES/plone.po.tmp ${P_A_LOCALES}/$locale/LC_MESSAGES/plone.po
done
- commit, push (on branches) and create pull requests for both the target package and plone.app.locales
- add an extra commit on the target package to remove the locales folder (don't forget to remove the
i18n:registerTranslations directive in configure.zcml)
- another pull request on buildout.coredev with the
experimental/i18n.cfg update
- they need to be merged all 3 together
- remember to add changelog entries on the target package and
plone.app.locales!
- last thing: add the pull request on this comment and tick the checkbox!
We have some packages that started their lives as non-core addons, but didn't merge their translations into plone.app.locales when they were added to core.
See:
[edit by @jensens] added 2 packages
[edit by @gforcada] added a bunch more
HOW TO
[remixed by @gforcada from https://github.com/plone/plone.app.event/issues/181#issuecomment-96406149 thanks @vincentfretin]
./bin/develop co $PACKAGE_NAME)experimental/i18n.cfgin buildout.coredev 5.1 to include the target package inplonedomain. See plone/buildout.coredev@802549dbin/buildout -c experimental/i18n.cfgon buildout.coredev 5.1bin/i18n ploneto regenerate plone.pot and resync plone files. (If there is any removed messages, be sure to look if this is normal, it may be an issue you have to fix before continuing your work)bin/i18ndude admixcommand to transfer translated messages from the target package to plone.po for each language. Something like this:i18n:registerTranslationsdirective inconfigure.zcml)experimental/i18n.cfgupdateplone.app.locales!