Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/219312

Change subject: Convert unadapted links to plain text while publishing
......................................................................

Convert unadapted links to plain text while publishing

Ideally, we will require a validator and cleaner from each tool
module before publishing. It is a bit architecture work we have to
do in near future. For now, this is done in a simple way.

Testplan:
Translate LaTeX from en to=es. Click on first section, note the
unadapted links in translation. They will be in gray color. Publish.
The published article should not have them as links. They should be
plain text.

Change-Id: Ib530fd95c7934f422a6b5850cd06fd861a9987cb
---
M modules/publish/ext.cx.publish.js
M modules/tools/ext.cx.tools.link.js
2 files changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/12/219312/1

diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index d1bafb9..ec7a31e 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -334,6 +334,11 @@
                                return $( this ).html();
                        } );
 
+                       // All unadapted links are unwrapped.
+                       $section.find( '.cx-target-link-unadapted' 
).replaceWith( function () {
+                               return $( this ).html();
+                       } );
+
                        // Remove empty sections
                        if ( !$.trim( $section.text() ) ) {
                                $section.remove();
diff --git a/modules/tools/ext.cx.tools.link.js 
b/modules/tools/ext.cx.tools.link.js
index 6d6e96c..5754b2f 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -688,6 +688,7 @@
        };
 
        CXTargetLink.prototype.markUnAdapted = function () {
+               // All these unadapted links will be converted to plain text 
while publishing.
                this.$link.addClass( 'cx-target-link-unadapted' );
        };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/219312
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib530fd95c7934f422a6b5850cd06fd861a9987cb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to