Skip to content

Merge translations into plone.app.locales #983

Description

@esteele

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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions