Translator Buddy

Translator Buddy is a user script to simplify working with interface messages on MediaWiki wikis. It is most useful for fixing errors in MediaWiki translations on translatewiki.net website and for accessing or changing the interface messages defined locally on your wiki. Translator Buddy can be helpful both for wiki administrators and for regular users who are debugging or translating interface messages.
Features:
- Adds a
uselang=qqxfooter link on all pages in non-MediaWiki namespaces.qqxis a code for the pseudo-language that is used by MediaWiki to provide access to interface message keys. Example ofuselang=qqxfor this page - Extends default
uselang=qqxdebugging options with popups accessible by right-clicking on the needed element with message keys. This includes text added via CSS anddata-attributes, like TOC toggle button or Echo badge count messages, which are typically inaccessible to copy via usual means. Popups display a link to editing the translatewiki.net message in the language of the wiki and a link to view the locally defined message. If the user has a local user group that can edit the interface messages, locally defined message also uses an edit link. This can be disabled while using the script by usingtbdisable=1in URL or clicking the footer link while inuselang=qqxmode. For certain message groups, links to other translatewiki.net namespaces can be supported. For example, messages from Convenient Discussions user script display links to translatewiki.net pages in "Wikimedia" namespace while inuselang=qqxmode. - Adds a localised "All translations (translatewiki.net)" link in "Tools" menu for "MediaWiki" and "MediaWiki talk" namespaces.
- Adds a localised "Translate (translatewiki.net)" page tab (or toolbox link depending on the skin) for pages in MediaWiki namespaces. The tab links to an edit page for the message on translatewiki.net. For pages that exist locally, the tab uses "Edit" label instead. For English-language wikis, the tab uses "View" label and does not link to
action=edit. On translatewiki.net itself, the tab appears for messages in English language.
Installation
[edit]Source code for Translator Buddy
You can install this user script to your common.js subpage in any wiki or global.js subpage on Meta-Wiki by copy-pasting the following line:
mw.loader.load( 'https://www.mediawiki.org/w/index.php?title=User:Stjn/translatorBuddy.js&action=raw&ctype=text/javascript' ); // [[mw:Translator Buddy]]
The user script uses modern JavaScript which might not work on outdated browsers.
Limitations
[edit]Some message keys that get displayed by the script in uselang=qqx mode can be incorrect. The script currently does not check for message key validity or its existence in MediaWiki software.
Localisation
[edit]The user script uses default MediaWiki messages for its localisation and fetches it using standard MediaWiki messages API. If they are displayed for you incorrectly, your wiki might be missing them or defined them incorrectly locally. Currently used messages (links are to translatewiki.net):
- Allmessages-filter-translate ("Translate")
- Edit ("Edit")
- Translations ("All translations")
- View ("View")
- Word-separator (" ")
- Parentheses ("($1)")
Feedback
[edit]The script is maintained by stjn, a developer from Russian Wikipedia. Please leave the feedback or ask for improvements on the talk page for this page.
Name
[edit]The name of the user script was inspired by Indie Wiki Buddy, a browser extension for using independent wikis instead of Fandom.