plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
254 stars 191 forks source link

Merge translations into plone.app.locales #983

Closed esteele closed 6 years ago

esteele commented 9 years ago

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]

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
bloodbare commented 9 years ago

There is also plone.app.multilingual

vincentfretin commented 9 years ago

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

claytonc commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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

claytonc commented 9 years ago

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

jensens commented 9 years ago

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 commented 9 years ago

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

claytonc commented 9 years ago

+1

vincentfretin commented 9 years ago

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

claytonc commented 9 years ago

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

jensens commented 9 years ago

yes please.

gforcada commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

And I will merge french translation.

ale-rt commented 9 years ago

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 commented 9 years ago

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

vincentfretin commented 9 years ago

@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 commented 9 years ago

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

vincentfretin commented 9 years ago

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.

gforcada commented 9 years ago

@vincentfretin that's something that's most probably suited for jenkins to do, running it once per week and sending an email to (who?) would be enough?

vincentfretin commented 9 years ago

@gforcada I replied directly to https://github.com/plone/jenkins.plone.org/issues/132

vincentfretin commented 9 years ago

plone.app.caching translations are currently in plone.app.locales/plone/app/locales/locales-addons

vincentfretin commented 9 years ago

I'm not sure about the plone.app.widgets package. Do we have messages there that is not in the "widgets" domain (pot file generated from the mockup repo)?

vincentfretin commented 9 years ago

BTW, plone.app.lockingbehavior, plone.app.referenceablebehavior and some other packages are not part of Plone core, but are in the Ecosystem section (see versions.cfg). Do we really include them in plone.app.locales?

vincentfretin commented 9 years ago

I'm in favor of including ecosytem packages in plone.app.locales to increase the visibility for translators. Generally it's 2 or 5 messages in each package. There was only the French translation in plone.app.referenceablebehavior for example. :)

staeff commented 8 years ago

hi @vincentfretin - when I run bin/i18n plone as described in the howto above, I have o lot of changes (87), that are not related what I was working on. I'm not sure how to go about this. Do you have any suggestions?

vincentfretin commented 8 years ago

@staeff Yeah, there are lots of messages from permission zcml directive, we working on this https://github.com/collective/i18ndude/pull/31

Do this and you'll be set:

cd src/plone.app.locales
git checkout .
git pull
cd ../..
cd src/i18ndude
git checkout 85c6884ec93eb5fca3c421006a4e29565769d148

This will uses the commit before the latest commit of the i18ndude maurits-extract-zcml branch. You should have 0 new message, 0 removed with this.

vincentfretin commented 8 years ago

@staeff you should now remove src/i18ndude and rebuildout. (the branch was force pushed)

vincentfretin commented 8 years ago

For those who are working on this. I don't follow continuously the activity here. Please merge your PRs yourself when you're done. If you are not sure, ping me or @gforcada and we will give you a go to merge. More importantly when you do the plone.app.locales PR, don't wait too long to merge it because it will expire quickly (no automatic merge) and you will have to redo your work. Please update the todo list in the first comment as well. Thanks.

jensens commented 8 years ago

@vincentfretin there are a bunch of PR open regarding this move by different people. Self-merge is usally not what we want. I lost a bit track here. May I ask you to merge them if all is fine from your POV?

vincentfretin commented 8 years ago

Sure It would help if the persons doing PR reference this issue.

jensens commented 8 years ago

full ack, this is overall always a good way to keep things together.

vincentfretin commented 8 years ago

We now use i18ndude master, the zcml branch has been merged.

staeff commented 8 years ago

@vincentfretin - moved plone/plone.formwidget.recurrence translations to p.a.locales. This are the related pull requests: https://github.com/plone/buildout.coredev/pull/166 https://github.com/plone/plone.formwidget.recurrence/pull/19 https://github.com/collective/plone.app.locales/pull/94

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.formwidget.namedfile. This are the related pull requests: https://github.com/plone/buildout.coredev/pull/168 https://github.com/plone/plone.formwidget.namedfile/pull/18 https://github.com/collective/plone.app.locales/pull/95

vincentfretin commented 8 years ago

merged. @staeff can you edit the first comment of this issue to check the packages you did? Thanks.

staeff commented 8 years ago

@vincentfretin thanks for merging. Yes I'll update the first comment. Also: I forgot some changes and you already merged. Could you review https://github.com/plone/plone.formwidget.namedfile/pull/19 and merge if its ok. Thank you!

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.formwidget.datetime. This are the related pull requests: https://github.com/plone/buildout.coredev/pull/170 https://github.com/plone/plone.formwidget.datetime/pull/16 https://github.com/collective/plone.app.locales/pull/96

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.formwidget.datetime. This are the related pull requests: https://github.com/plone/plone.formwidget.autocomplete/pull/17 Since there were no translation file in this products, its only this single pr.

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.formwidget.datetime. This are the related pull requests: https://github.com/plone/buildout.coredev/pull/171 https://github.com/plone/plone.formwidget.contenttree/pull/23 https://github.com/collective/plone.app.locales/pull/97

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.formwidget.datetime. This are the related pull requests: https://github.com/plone/buildout.coredev/pull/172 https://github.com/plone/plone.app.versioningbehavior/pull/22 https://github.com/collective/plone.app.locales/pull/98

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.caching. This are the related pull requests: https://github.com/plone/plone.caching/pull/2 Since there were no translation file in the product, its only this single pr.

staeff commented 8 years ago

@vincentfretin - Use plone i18n domain for plone.caching. This are the related pull requests: https://github.com/plone/buildout.coredev/pull/173 https://github.com/plone/plone.app.widgets/pull/126 https://github.com/collective/plone.app.locales/pull/100

vincentfretin commented 8 years ago

As @mauritsvanrees said in https://github.com/plone/plone.formwidget.autocomplete/pull/17 plone.formwidget.autocomplete master is used in Plone 4.3.x as well. Instead of maintaining a branch of plone.formwidget.autocomplete just for the translations in Plone 4.3.x, I suggest to include them in plone.app.locales 4.3.x as well. It should be the case for plone.formwidget.namedfile and plone.formwidget.datetime too. Did I forget a package that use master for both Plone 4.3 and Plone 5? Commits will follow.

vincentfretin commented 8 years ago

@mauritsvanrees It should be good now.

mauritsvanrees commented 8 years ago

@vincentfretin Very good. Thank you!

lukasgraf commented 8 years ago

@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 commented 8 years ago

@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:

erral commented 6 years ago

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.

https://github.com/plone/plone.app.multilingual/pull/306

https://github.com/collective/plone.app.locales/pull/200 https://github.com/collective/plone.app.locales/pull/201

https://github.com/plone/buildout.coredev/pull/429 https://github.com/plone/buildout.coredev/pull/430