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 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 displays "Edit" instead. For English-language wikis, the tab says "View" and does not link to
action=edit
. - Adds a
uselang=qqx
footer link on all pages in non-MediaWiki namespaces.qqx
is a code for the pseudo-language that is used by MediaWiki to provide access to interface message keys. Example ofuselang=qqx
for this page - Extends default
uselang=qqx
debugging options with popups accessible by right-clicking on the needed element with message keys. Popups display links to edit the translatewiki.net message in the language of the wiki and to view the locally defined message. If the user is in a 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=1
in URL or clicking the footer link while inuselang=qqx
mode. 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=qqx
mode.
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.
The script does not support text defined in CSS styles or in various data-
attributes, like they are in the table of contents for most MediaWiki skins or in Echo notifications.
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.