User talk:Ebrahim/ArticleTranslator.js

About this tool
This tool is useful for translating wikipedia links according to interwikis also it has some statistics options: For more information, if you know Persian see fa:ویکی‌پدیا:راهنمای ابزار کمک مترجم otherwise use Google translation :)
 * 1) Translating links in Read mode (adding target wiki links near the original)
 * 2) Translating links in edit mode (replacing target links instead of original one)
 * 3) Counting number of interwikis that are linked to pages that are not in target wiki (by pressing + button near the page title)
 * 4) Search words translation in Google translation and Google search engine (by pressing = button near the page title)
 * 5) Constructing list of pages that are not in target wiki and sort it according to number of interwikis and number of Special:WhatLinksHere (by pressing + button near the page title)

Customizing
For using this code you can customize it with this variables and you should put this code in Special:Mypage/common.js
 * Using this code

Every parameter (line) is optional and if you don't specify it, it will fallback to script defaults. For example if you just want to change the home wiki, this would be enough:

Here is a sample for this gadget translation/localization.

Disable on special pages
Hi !

Could you change the script so it is not enabled on special pages? Helder 11:16, 16 November 2013 (UTC)
 * Hi . It is very nice for me that you are using the script! :) IMHO special pages are also good to have the feature generally and disabling the script there is making users flexibility less so I think it is better to leave this on :) But if you don't like this enabled on a special special page(!) please bring a example about it. Thank you :) –ebraminiotalk 23:48, 9 January 2014 (UTC)

TfD that may be of interest
This script is part of the discussion on Templates for discussion/Log/2016 March 18 —PC-XT+ 05:23, 19 March 2016 (UTC) 22:42, 19 March 2016 (UTC)

Script showing up in Category:Pages using invalid self-closed HTML tags
Your script, and copies of it, are showing up in. Can you please fix it by changing both instances of  to  ? Let me know if you have any questions. Thanks. – Jonesey95 (talk) 20:17, 31 October 2017 (UTC)
 * Jonesey95: Done. Thanks :) −ebrahimtalk 21:10, 27 November 2017 (UTC)

Script Not working
First, this script is nice, but there is a problem, we use it in sd.wikipedia, but suddenly it stopped working, don't know what happened, it will be great help if you solve this problem for us. if you want to search for the script in sd.wikipedia, just type, MediaWiki:Tourwiki - Thanks in advance. Arslanali (talk) 15:12, 25 October 2018 (UTC)

Ar language
Hello. I want to use this tool to translate links from en to ar, not fa. What should I write in User:Avocato/common.js?--Avocato (talk) 12:43, 17 May 2019 (UTC)
 * User:Avocato: Hi! You will need something like this,

But if you are using this in English Wikipedia anyway, what you got already is ok. Thanks :) −ebrahimtalk 12:35, 11 May 2021 (UTC)

user-select
when you enable, a phrase is added after the page the title threads something like "translate links from en to fa". If you triple-click on the page title to select it, this phrase is also selected which is not desirable. The solution is to make sure  has the   CSS property set to.

I think the best approach is to create a page called User:Ebrahim/ArticleTranslator.css on enwiki, then use  at the top of fa:MediaWiki:Tofawiki.js to load this CSS page. The content of the CSS page should be:

We use a similar one in fa:MediaWiki:Gadget-close.css for that same reason. huji— TALK 16:49, 11 March 2020 (UTC)
 * This is fixed eventually however needed some more workaround in order to make it work in all the different browsers (this was alone was breaking Safari that's why I didn't apply it immediately). −ebrahimtalk 12:35, 11 May 2021 (UTC)

A tool with a similar function
Hi, do you know about Lacmus? JWBTH (talk) 17:01, 26 May 2023 (UTC)
 * Interesting, thanks for sharing 😊 −ebrahimtalk 06:13, 14 April 2024 (UTC)

definedTemplatesfortemplates and definedTemplatesforcategories
Hi, I made some changes to your code, to translate templates and categories link in templates like:

Here is the changed code: meta:User:Mr._Ibrahem/ArticleTranslator_2024.js. Thanks. Mr. Ibrahem (talk) 23:54, 13 June 2024 (UTC)

not work in edit mood
its not work in edit mood but work in some file have (viw source) mood Redaking (talk) 06:01, 16 July 2024 (UTC)