Usuário(a):Daask/vector.js
Nota: Depois de publicar, poderá ter de contornar a cache do seu navegador para ver as alterações.
- Firefox / Safari: Pressione Shift enquanto clica Recarregar, ou pressione Ctrl-F5 ou Ctrl-R (⌘-R no Mac)
- Google Chrome: Pressione Ctrl-Shift-R (⌘-Shift-R no Mac)
- Edge: Pressione Ctrl enquanto clica Recarregar, ou pressione Ctrl-F5.
// Copied from http://tools.wmflabs.org/translate/help.php
$(function () {
var translate = {
//The language you translate to
targetLanguage: 'en',
//The language you translate from
sourceLanguage: wgDBname.substr(0, wgDBname.length - 4),
//The name of the link
tabLinkName: 'Translate',
getLink: function () {
return 'http://tools.wmflabs.org/translate/text.php?article=' + wgPageName + '&from=' + this.sourceLanguage + '&to=' + this.targetLanguage;
},
//Initializes script
initialize: function() {
if (wgNamespaceNumber == 0) {
mw.util.addPortletLink('p-cactions', this.getLink(), this.tabLinkName, "tab-translate", 'Translate to ' + this.targetLanguage, "t");
}
}
};
translate.initialize();
});