GSoC 2018 Ideas: TTW Plone translation overrides

This is one post in a series to begin focused discussion about ideas that came out of our 2018 GSoC Brainstorm.

Please use this post as a place to begin to discuss this idea more in depth.

This idea was proposed by @djay and @jensens might be a good choice for mentor

The description:

"You can go to the control panel and pick any of the plone translations and override them yourself ie this is core i18n, not multi lingual content. You can perhaps export this translation to contribute your translations to plone, or just use it for small local site customisations.
Somewhat similar to https://www.facebook.com/translations
Should be able to ship a set of your translation overrides with your theme."

Go for it, community! Make this one shine!

c

We have already https://pypi.python.org/pypi/collective.ttwpo which I created for a customer recently, see also: New add-on collective.ttwpo

It can be extended with little effort to also override existing po-files.
Currently one can upload po-files or fetch them from a third party service (zanata is supported, others need adapters).

Missing: A simple TTW-Gettext-Editor inside Plone, for those not in the mood to use Zanata (or other services).

Also the current UI is very simple and for sure there is room for improvements.

A few years ago I created collective.storedtranslations but it never left the proof-of-concept state.

It sounds to me like any project based on this would be polishing and perfecting the UI around existing tools, rather than coding something from scratch. Is that an accurate take on the current situation?

@cewing given we do not want to reinvent the wheel: yes.

Indeed. And collective.ttwpo would be the best basis. There might be some code in my collective.storedtranslations that is useful in case people bump into problems, but I haven't really compared the two.

@jensens, @mauritsvanrees, could you two come up with a more in-depth description of what this project would entail? See last year's ideas page for an idea of the format. It would be wonderful to have that done in a week or two, if possible.

Also collective.themesitesetup registered translation overrides TTW, though it only UI was theme editor and changes were applied only when theme was "updated" or "activated". I used zope.app.i18n, which used to provide persistent message catalogs. I haven't looked into collective.ttwpo yet in detail, but with zope.app.i18n I had no problems in registering new catalogs or appending / overriding msgids in existing ones. (Only exception is JS "widgets" domain, which does not support cascading catalogs and therefore cannot be overridden, but instead it's ok to register new JS translation domains.)

From the related discussion in Plone 5.1 translations I think it's clear that making translations easier is very important to Plone.

1 Like

… in a perfect world…

  • Put 'translations' in debug mode
  • Browse the site
  • click on the 'bad/missing translations'
  • Edit the translation, save
  • Site and po-file is updated, buildout & mr.developer (or mrs.translator, maybe) updates GitHub......
2 Likes

@tkimnguyen I would have it more like this

  • site in production mode
  • go to control panel > language and click create language variant. Enter new language code. (or maybe have option override a language?)
  • browse the site
  • click on "bad/missing translations" (if have right permission)
  • edit the translation, save
  • if you go to another site in the same zope it won't have changed
  • site setup > language > save translation
  • downloads a zip with either new language variant or a modified .po which you can drop into git.
  • if you download the theme and upload it to a new site, activate it then the translations go with it and are instantly used.

I see translations being an easy way to customise a site, as well as something that needs to be there for an out of the box product. For example, if I wanted to alter the text on the login page. or if I wanted to improve a built in validation error.

1 Like

Like this: GitHub - collective/collective.themesitesetup: A plone.app.theming-plugin, which imports an embedded GS profile when theme is enabled?

1 Like

No. As @datakurre mentioned above that is only installed once. I'd suggest that the translation is stored and used from inside the resource registry and can even be edited in the theme editor. Any changes to the translations are automatically stored in the theme.
Not sure if thats feasible technically or not.
Obviously if you goal is contribute to plones core translations you would have to delete your local theme translation after it goes in the code.

Once as in every time you update the theme (there's "Update" button in theme editor for that).

It creates and registers persistent message catalog utility from zope.app.i18n/src/zope/app/i18n/messagecatalog.py at master · zopefoundation/zope.app.i18n · GitHub which is technically editable if there was an UI for that (obviously it themesitesetup does not sync messages from catalog back to theme).

A TTW approach will not work for translations with string interpolations.

-aj

1 Like