jenkins-bot has submitted this change and it was merged. Change subject: Apply selected action on Translation card to the current paragraph too ......................................................................
Apply selected action on Translation card to the current paragraph too Testplan: Translate a section. Change the translation provider choice using the MT tool card. The choice should be applied to the current section. If choice is an MT engine, the current section will have the machine translation. If choice is 'Use source', the current section will get copy of source section. If the choice is no machine translation, the section will be cleared. There is a bug about what happens if the section has user's manual translation. This commit does not change any behavior on that. It just overwrites it as we do now. Bug: T78143 Change-Id: Ief487458de9743a10d99e441bcf06761e6db20ff --- M modules/tools/ext.cx.tools.mt.js 1 file changed, 12 insertions(+), 2 deletions(-) Approvals: KartikMistry: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/tools/ext.cx.tools.mt.js b/modules/tools/ext.cx.tools.mt.js index b42e4d5..bb08f89 100644 --- a/modules/tools/ext.cx.tools.mt.js +++ b/modules/tools/ext.cx.tools.mt.js @@ -376,8 +376,18 @@ // Set the global engine // TODO This should be saved in a preference or a cookie - MTControlCard.provider = providerId; - + if ( MTControlCard.provider !== providerId ) { + MTControlCard.provider = providerId; + // Apply this choice to the current section. + if ( providerId === sourceMT ) { + this.useSource(); + } else if ( providerId === disableMT ) { + this.clearTranslation(); + } else { + // Must be an MT engine. Restore. + this.restoreTranslation(); + } + } // Set the main label this.$providerSelectorTrigger.text( this.getProviderTitle( providerId ) ); }; -- To view, visit https://gerrit.wikimedia.org/r/228205 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief487458de9743a10d99e441bcf06761e6db20ff Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> Gerrit-Reviewer: KartikMistry <kartik.mis...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits