Skip to content

Merge translations into plone.app.locales #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
21 of 22 tasks
esteele opened this issue Sep 15, 2015 · 64 comments
Closed
21 of 22 tasks

Merge translations into plone.app.locales #983

esteele opened this issue Sep 15, 2015 · 64 comments

Comments

@esteele
Copy link
Member

esteele commented Sep 15, 2015

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!
@esteele esteele added this to the Plone 5.0 milestone Sep 15, 2015
@bloodbare
Copy link
Member

There is also plone.app.multilingual

@vincentfretin
Copy link
Member

and maybe plone.app.multilingual and plone.app.versioningbehavior

@claytonc
Copy link
Member

claytonc commented Nov 4, 2015

I found plone.app.contenttypes and plone.app.lockingbehavior not translated.
I'm already translating it.
I will add in plone.app.locales.
The files "plone.app.contenttypes.pot" and "plone.app.lockingbehavior" has to be created inside locales-addons? Correct ?

@jensens
Copy link
Member

jensens commented Nov 4, 2015

plone.app.contenttypes are mainly in the plone i18n-domain. Is there an own plone.app.contenttypes i18n-domain defined somehwere? if yes: create a pot file for it.

plone.app.versioningbehavior is translated here:
https://github.com/plone/plone.app.versioningbehavior/tree/master/plone/app/versioningbehavior/locales
So files has just to be copied over to plone.app.locales and removed at the original place.

@vincentfretin
Copy link
Member

plone.app.contenttypes translations are in the plone domain in plone.app.locales.

@claytonc
Copy link
Member

claytonc commented Nov 4, 2015

Is it better to change "plone.app.contenttypes" domain at the file plone.app.contenttypes/plone/app/contenttypes/behaviors/configure.zcml to "plone"?

@jensens
Copy link
Member

jensens commented Nov 4, 2015

plone.app.lockingbehavior has one string Locking ind the domain plone.app.lockingbehavior - I propose to change the zcml and put it into the plone domain and translate it there.

@jensens
Copy link
Member

jensens commented Nov 4, 2015

+1 for using not that many i18n-domains.
if there are less than 5-10 messages i'd not use an own file.

@claytonc
Copy link
Member

claytonc commented Nov 4, 2015

+1

@vincentfretin
Copy link
Member

yes please change to i18n_domain="plone" in configure.zcml if it's still i18n_domain="plone.app.contenttypes"

@claytonc
Copy link
Member

claytonc commented Nov 4, 2015

Okay! I changed i18n_domain and should I change plone.app.lockingbehavior too ?

@jensens
Copy link
Member

jensens commented Nov 4, 2015

yes please.

@gforcada
Copy link
Member

gforcada commented Nov 5, 2015

On a fully checked out buildout.coredev (see branch all-sources) there were quite a few more packages that were defining their own translation domain.

I added all of them on the first message, edit and fix at will :-)

@claytonc
Copy link
Member

claytonc commented Nov 6, 2015

In product plone.app.referenceablebehavior I will to change the zcml and put it into the plone domain and translate it there. And I will delete locales folder and edit configure.zcml removing reference for folder.

@claytonc
Copy link
Member

claytonc commented Nov 6, 2015

And I will merge french translation.

@ale-rt
Copy link
Member

ale-rt commented Nov 10, 2015

Since 3.4.5 i18ndude supports chameleon, so there should be no need to "modify your local zope.tal".

This lines should also go:

vincentfretin added a commit to plone/buildout.coredev that referenced this issue Nov 11, 2015
@vincentfretin
Copy link
Member

Thanks @ale-rt I didn't see the new version, I updated the instructions in the i18n.cfg file.

@vincentfretin
Copy link
Member

@gforcada Thanks for beginning this work. I'm glad I'm not the only one anymore to know how to update Plone translations.
For the script in the first comment, I think it's not complete. This:

    bin/i18ndude admix ${P_A_LOCALES}/$locale/LC_MESSAGES/plone.po ${TARGET_PACKAGE}/$locale/LC_MESSAGES/${PO_FILE} > ${P_A_LOCALES}/$locale/LC_MESSAGES/${PO_FILE}.po

should be:

    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

I edited the first comment with this solution.

@gforcada
Copy link
Member

@vincentfretin the mv is on the next bullet point :-) I just removed it because now is redundant

@vincentfretin
Copy link
Member

We should do a i18ndude find-untranslated on all packages too. I did it only for Products.CMFPlone at the ploneconf sprints and fixed several issues.

vincentfretin added a commit to plone/buildout.coredev that referenced this issue Feb 9, 2016
…widget.contenttree translations to plone.app.locales 4.3.x (refs plone/Products.CMFPlone#983)
vincentfretin added a commit to collective/plone.app.locales that referenced this issue Feb 9, 2016
…tetime,

plone.formwidget.contenttree which now use the plone domain.
(refs plone/Products.CMFPlone#983)
vincentfretin added a commit to plone/plone.formwidget.datetime that referenced this issue Feb 9, 2016
mister-roboto pushed a commit to plone/buildout.coredev that referenced this issue Feb 9, 2016
Branch: refs/heads/master
Date: 2016-02-09T13:49:45+01:00
Author: Vincent Fretin (vincentfretin) <vincent.fretin@gmail.com>
Commit: plone/plone.formwidget.datetime@1d28980

add changelog entry and specify dependency of plone.app.locales &gt;= 4.3.9 (refs plone/Products.CMFPlone#983)

Files changed:
M CHANGES.rst
M setup.py
@vincentfretin
Copy link
Member

@mauritsvanrees It should be good now.

@mauritsvanrees
Copy link
Member

@vincentfretin Very good. Thank you!

@lukasgraf
Copy link
Member

@vincentfretin I'm not clear about the background of this change, but your commit in plone.formwidget.datetime to depend on plone.app.locales >= 4.3.9 broke Plone 4.3 buildouts that include plone.app.contenttypes (1.1.x):

Version and requirements information containing plone.app.locales:
  [versions] constraint on plone.app.locales: 4.3.7
  Requirement of Products.CMFPlone: plone.app.locales
  Requirement of plone.formwidget.datetime[z3cform]: plone.app.locales>=4.3.9
  Requirement of plone.formwidget.datetime>=1.1: plone.app.locales>=4.3.9
  Requirement of plone.app.locales: setuptools
While:
  Installing instance.
Error: The requirement ('plone.app.locales>=4.3.9') is not allowed by your [versions] constraint (4.3.7)

For example, the plone.app.contenttypes 1.1.x buildout will fail like that.


http://dist.plone.org/release/4.3-latest/versions.cfg pins

plone.app.contenttypes = 1.1b5
plone.app.event = 1.1.5
plone.app.locales = 4.3.7

(Let me know if you'd like me to open up a separate issue for this somewhere - I'll then move my comment accordingly).

@vincentfretin
Copy link
Member

@lukasgraf The explicit dependency is intentional so you don't end up with the datetime widget only in English. I want the buildout to fail :) Several solutions here:

  • pin plone.formwidget.datetime to 1.2 (instead of 1.3 you get when you don't pin)
  • pin plone.app.locales to 4.3.9
  • wait Plone 4.3.8 to be released which include plone.app.locales 4.3.9

jone added a commit to 4teamwork/ftw-buildouts that referenced this issue Feb 16, 2016
plone.formwidget.datetime 1.3 is incompatible with Plone <= 4.3.7
plone/Products.CMFPlone#983 (comment)
vincentfretin added a commit to collective/plone.app.locales that referenced this issue Jul 1, 2016
@erral
Copy link
Member

erral commented Mar 19, 2018

Moving plone.app.multilingual translations into plone.app.locales:

plone.app.multilingual master is used both for Plone 5.0.x and 5.1.x, so I included the translations in both 5.x and master branches of plone.app.locales.

plone/plone.app.multilingual#306

collective/plone.app.locales#200
collective/plone.app.locales#201

plone/buildout.coredev#429
plone/buildout.coredev#430

@vincentfretin
Copy link
Member

LGTM @erral If nobody disagree, you can merge all those PR.

@erral
Copy link
Member

erral commented Mar 19, 2018

The pull-requests for p.a.multilingual are failing in an unrelated way:

https://jenkins.plone.org/job/pull-request-5.0/415/#showFailuresLink
https://jenkins.plone.org/job/pull-request-5.1/955/#showFailuresLink
https://jenkins.plone.org/job/pull-request-5.2/466/#showFailuresLink

Should I merge or try to reproduce and fix before merging?

@erral
Copy link
Member

erral commented Mar 19, 2018

Sorry, it's not unrelated. I have a missing msgid to move

@erral
Copy link
Member

erral commented Mar 19, 2018

OK, p.a.multilingual tests are expected to fail until all pull requests are merged, because they depend on a translation coming from plone.app.locales. So I'm merging them.

@erral
Copy link
Member

erral commented Mar 20, 2018

Moving plone.dexterity translations:

These are PRs to include plone.dexterity's translations into plone.app.locales.

These are for Plone 5.1.x:

plone/plone.dexterity#80
plone/buildout.coredev#431
collective/plone.app.locales#204

I messed up with the translations, so I retired the former PRs and issued new ones.

plone/plone.dexterity#82
plone/buildout.coredev#434
collective/plone.app.locales#208

These are the PR for Plone 5.0.x:

plone/plone.dexterity#81
plone/buildout.coredev#432
collective/plone.app.locales#205
plone/plone.dexterity#83
plone/buildout.coredev#435
collective/plone.app.locales#209

@erral
Copy link
Member

erral commented Mar 20, 2018

PR for Products.CMFDiffTool:

plone/Products.CMFDiffTool#32

@erral
Copy link
Member

erral commented Mar 20, 2018

@vincentfretin
Copy link
Member

@erral Thanks for your work. You should start merging all those PR before you have any conflicts.

@erral
Copy link
Member

erral commented Mar 20, 2018

Thanks for your guide too, it was very useful to get things done.

@erral
Copy link
Member

erral commented Mar 20, 2018

I also created a PR to include those files in 5.2 branch of coredev: plone/buildout.coredev#440

@vincentfretin
Copy link
Member

Yes indeed, it should be in sync with 5.1 branch, thanks.

@gforcada
Copy link
Member

All done?!! Cool thanks to everyone for working on this!

Shall the issue be closed then?

@erral
Copy link
Member

erral commented Mar 21, 2018

On the list above there is stille an open thing: plone.z3cform, but it's still an open issue whether it should be moved to plone organisation or not.

@gforcada
Copy link
Member

Well, then we can close it and add on that ticket that as soon as we move it, if we ever do, translations should also get merged into plone.app.locales.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests