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

Enable translation on Alert CT #134

Open
andrebonon opened this issue Mar 20, 2024 · 4 comments
Open

Enable translation on Alert CT #134

andrebonon opened this issue Mar 20, 2024 · 4 comments

Comments

@andrebonon
Copy link
Contributor

Problem:
Enabling content translation for the Alert Content-Type does not ensure proper translation of an Alert. The React app fetches data from the "/alerts" URL without passing a language parameter, which means Drupal cannot determine which node translation to return.

Solution:
Modify the REST Resource "/alerts" to check for a language prefix in the request URL. If a language prefix is present, the service should load and return the content in the corresponding translated language.

@andrebonon
Copy link
Contributor Author

andrebonon commented Mar 20, 2024

Problem 2
The "/alerts" route cannot be found if a translated URL is passed as a param.
I.E.: /alerts?uri=/fr/component-style-guide-fr&_format=json

The route matcher throws an error.
https://github.com/open-y-subprojects/openy_node_alert/blob/main/src/Plugin/rest/resource/AlertsRestResource.php#L198

Check the errors below:
Screenshot 2024-03-20 at 20 26 27

Screenshot 2024-03-20 at 20 04 19

@podarok
Copy link
Contributor

podarok commented Mar 21, 2024

This is a good idea, but here are some concerns

Actually - enabling Drupal translation leads to a larger number of issues, because initially distribution was created with a - source in English + machine translation to any other language ( Google translate ), given the lack of resources Ys having for supporting multiple translations in a content
I'd call this as a major epic for our Backlog, because there are issues with
enabling translation everywhere will lead to checking all components ( Views related) , all SQL queries, all Content Types, Activity Finder, Schedules(you'd need to pull multilanguage data and split it in results for the user's language
upgrade path would request everyone to convert their sites to become multilingual, because configs also would need to be translated. Having multilingual enabled when you have only one language - is pretty confusing from Content Editing perspective
That said, if we want to enable Drupal core multilanguage - we need to come up with a proper strategy of how this needs to be done and what would be backport policy for the distribution if we decide to not enable Drupal core multilanguage

@andrebonon
Copy link
Contributor Author

#136

@andrebonon
Copy link
Contributor Author

this is merged: #136

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

No branches or pull requests

2 participants