Skip to content
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

Multilingualism handling #225

Closed
3 of 4 tasks
erral opened this issue Mar 3, 2017 · 11 comments
Closed
3 of 4 tasks

Multilingualism handling #225

erral opened this issue Mar 3, 2017 · 11 comments

Comments

@erral
Copy link
Member

erral commented Mar 3, 2017

We need an endpoint to return the translations of a given content and another one to link two contents as translations of each other.

Progress so far:

  • Plone 5 with plone.app.multilingual
  • Plone 4 with plone.app.multilingual
  • Plone 4 with Products.LinguaPlone
  • Plone 4 without Products.LinguaPlone/plone.app.multilingual (it has to work without creating any endpoint)
@erral
Copy link
Member Author

erral commented Mar 3, 2017

The idea is to provide a new enpoint called @translations on the same way that the current @workflow one that on GET returns the current translations of the content objects and on POST creates the translation link between both.

@erral erral self-assigned this Mar 3, 2017
@erral erral added this to the BeethovenSprint2017 milestone Mar 3, 2017
@erral
Copy link
Member Author

erral commented Mar 3, 2017

When linking to content items as translations, we need to pass a parameter with the id of the linked content.

For the moment I will try to use the current value of @id of a content-item (its URL) for it.

@erral
Copy link
Member Author

erral commented Mar 3, 2017

@erral
Copy link
Member Author

erral commented Mar 3, 2017

Is it safe to asume that the @translations endpoint should only exist in Plone 5 and not in Plone 4 because p.a.multilingual is included by default in Plone 5 and not in Plone 4?

@tisto tisto mentioned this issue Mar 4, 2017
56 tasks
@erral
Copy link
Member Author

erral commented Mar 4, 2017

Discussed with @sneridagh and @buchi:

  • With Plone 4 and p.a.multilingual we have several different scenarios because we can be using p.a.multilingual version 1 or 2, and this can complicate the testing setup and scenarios, but not the actual implementation, which would be quite similar for Plone 5 (only some imports change, because in Plone 4 and p.a.m 1 and 2 some interfaces are implemented on the package plone.multilingual.

  • So we are going to implement the @translations endpoint for:

    • Plone 5 and plone.app.multilingual
    • Plone 4 and Products.LinguaPlone.

This would require to add conditional registrations for LinguaPlone and different test setup.

@erral
Copy link
Member Author

erral commented Mar 5, 2017

The build is green:

https://travis-ci.org/plone/plone.restapi/builds/207939667

I still want to do some other checks if I can make it work with Plone 4 and earlier versions of plone.app.multilingual (1.x and 2.x) (currently I have some test issues with them)

@tisto
Copy link
Member

tisto commented Mar 10, 2017

@erral would you mind creating a pull request? Or is it too early for this?

@erral
Copy link
Member Author

erral commented Mar 10, 2017 via email

@erral
Copy link
Member Author

erral commented Mar 10, 2017

And of course, I need to rewrite the docs to handle changes on #248

@erral
Copy link
Member Author

erral commented May 2, 2017

After a long fight with this issue and the different test-setup scenarios needed to run this, I found it too complex to handle the whole scope of multilingualism handling just in one package.

If I include the implementation for LinguaPlone in plone.restapi, the documentation of plone.restapi breaks, because LinguaPlone installs some more vocabularies, and thus the @vocabularies endpoint documentation test breaks.

If I try to install plone.app.multilingual in Plone 4, there are some more testing breakages that occur when running the tests when the code is exactly the same...

Anyway neither LinguaPlone nor plone.app.multilngual are installed by default in Plone 4, moreover there are two versions of plone.app.multilingual that work in Plone 4 (1.x and 2.x).

So, as the last attempt, I just included the @translations endpoint for Plone 5 (using zcml:condition="have plone-5") and included the tests using some ugly PAM_INSTALLED conditional.

Anyway, the code and tests for LinguaPlone work, so I would go to include it in an external package, something like collective.restapi.linguaplone. I will try to do so also for plone.app.multilingual 1.x and 2.x with something like collective.restapi.pam.

Comments? @sneridagh @tisto @buchi

@erral
Copy link
Member Author

erral commented Nov 6, 2017

The pull-request is merged, we can close this.

For future reference, only Plone 5 support is added directly on plone.restapi. To get Plone 4 support with either LinguaPlone or plone.app.multilingual use specific addons (https://pypi.python.org/pypi/collective.restapi.linguaplone and https://pypi.python.org/pypi/collective.restapi.pam)

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

2 participants