Feature: Machine translation for user-generated content#6127
Feature: Machine translation for user-generated content#6127tramuntanal merged 19 commits intodevelopfrom
Conversation
|
I've updated the PR description, in case anyone's curious! |
c8fe241 to
513b8f2
Compare
681aaa3 to
4ae9f10
Compare
4ae9f10 to
5cbf1c3
Compare
5cbf1c3 to
6cd43aa
Compare
|
@decidim/core Hi! This is ready for reviews, can you check it please? 😄 |
|
@mrcasals As a Decidim implementor I would like to know about this feature, right now it hides in the code. Can you add some docs in docs/customization please? |
|
@tramuntanal OK, will do! This PR is also waiting for #6385 too, it would be awesome if you could review that PR too 🙏 |
There was a problem hiding this comment.
Good job!
I mainly find a lack of documentation:
- documentation for implementors in how to configure an machine translation service and a links to real implementations of services (if any), in
docs/customize - documentation for developers about the API that a compatible machine translation service should implment and the machine translation flow, the MachineTranslationSaveJob..., in
docs/advanced
Also, I found many models with incorrect translatable_fields can you please re-check that all models have the correct fields defined? maybe we're missing some
decidim-core/app/jobs/decidim/machine_translation_resource_job.rb
Outdated
Show resolved
Hide resolved
|
@tramuntanal I've addressed the feedback. Can you re-review this PR and #6385 please? 😄 |
* Base branch * remove file * Require confirmation on exiting a survey mid-answering (#6118) * Require confirmation on exit * Add specs * Use path instead of url * Fix changelog * Trigger build * Fix expected path on test * Fix method call * Take textareas and selects into account * WIP adding concern * Adding concern in all the models which have translatable fields * removed :extended_data as translatable field * WIP adding concern * Adding concern in all the models which have translatable fields * Revert "Require confirmation on exiting a survey mid-answering (#6118)" This reverts commit bdeb933. * Revert "remove file" This reverts commit 2565dbb. * Revert "Base branch" This reverts commit 2a09cc4. Co-authored-by: Marc Riera Casals <mrc2407@gmail.com>
…6128) * Adding setting to organizations table and creating global config * Adding config accessor to core.rb * Base branch * Added a check to display machine translation settings and changed initializer value * Fixing lint issue in migration file * Adding test and removing test file Co-authored-by: decidim-bot <decidim-bot@users.noreply.github.com> Co-authored-by: anagha <anagha1996@gmail.com>
* Base branch * remove file * Idenifying translatable fields in meetings and comments Co-authored-by: Marc Riera Casals <mrc2407@gmail.com>
Co-authored-by: Marc Riera Casals <mrc2407@gmail.com> Co-authored-by: Marc Riera <mrc2407@gmail.com>
fc17203 to
34519e4
Compare
tramuntanal
left a comment
There was a problem hiding this comment.
Good @oriolgual and @mrcasals !
Extracted from decidim/decidim#6127
🎩 What? Why?
We're working on adding a machine-translation system for Decidim. This comes from:
https://meta.decidim.org/processes/roadmap/f/122/proposals/15238
This PR will serve as a base branch for all related changes, so that we don't accidentally release the feature half way.
Implementation
The whole system will lay behind two config options:
Decidim.config.enable_machine_translations), disabled by defaultWe'll create
Decidim::TranslatedField, a new model that will hold all machine translations. This is the same approach theglobalizegem does. By separating these translations we have a way to differentiate machine translations from human translations.This is the process:
Decidim::TranslatedFieldin a "pending" state. This means we've scheduled a translation request but it's not finished yet.Decidim::TranslatedFieldwith it.translated_attribute(model.field)calls, because with the current method we can't get to the DB because we only receive the field value. We'll create a newtranslated(model, :field)that will behave similarly to the current one, but if there's no human translation available then we'll delegate the search to theDecidim::TranslatedFieldtable.translated_attribute(model.field)method, and help us automfix this change. We'll also deprecate the old method, just in case.With this system, we expect developers to be able to implement bridges to Google Translate, DeepL, Bing or similar services.
📌 Related Issues
📋 Subtasks
See related PRs.
📷 Screenshots (optional)