User:Nux/content-translate-helper.js

/** * Adds missing content translate link (new vector). * @deprecated abandoned. Is not useful in 2023 anymore, and not worth fixing for v'22 changes */ $(function{ var config = {    dst: 'pl',  };  function itemTpl (url, dst) {    return `        	 Translate (${dst})         `;  }  function urlTpl (dst) {    var src = mw.config.get('wgContentLanguage');    var title = encodeURIComponent(mw.config.get('wgPageName'));    return `https://${dst}.wikipedia.org/wiki/Special:ContentTranslation?title=Special:ContentTranslation&to=${dst}&from=${src}&page=${title}&targettitle=${title}`;  }  var $container = $('#t-whatlinkshere').parent;  if (!$container.length) {    return;  }  var url = urlTpl(config.dst);  $container.append(itemTpl(url, config.dst)) })