MediaWiki:Gadget-TranslationAdder.js/documentation

Hello, you have come here looking for the meaning of the word MediaWiki:Gadget-TranslationAdder.js/documentation. In DICTIOUS you will not only get to know all the dictionary meanings for the word MediaWiki:Gadget-TranslationAdder.js/documentation, but we will also tell you about its etymology, its characteristics and you will know how to say MediaWiki:Gadget-TranslationAdder.js/documentation in singular and plural. Everything you need to know about the word MediaWiki:Gadget-TranslationAdder.js/documentation you have here. The definition of the word MediaWiki:Gadget-TranslationAdder.js/documentation will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofMediaWiki:Gadget-TranslationAdder.js/documentation, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.
Documentation for MediaWiki:Gadget-TranslationAdder.js. [edit]
This page contains usage information, categories, interwiki links and other content describing the template.

Uses data in MediaWiki:Gadget-TranslationAdder-Data.js.

For usage instructions, see MediaWiki:Gadget-TranslationAdder.js/help.

Todo

Bugs/Enhancements
  • Handle API errors.
  • A field for additional edit summary
  • Reset checkboxes and fields when language code is changed
Features
  • Edit existing translations.
  • Add translation gloss.
  • Make gadget recognize special high-performance translation templates {{tt}}, {{tt+}}, {{multitrans}} (discussion).

Coding

This code adds an input box below the translation table and passes an edit-object to the Editor.js-script when the user press "preview". It stores settings in cookies for every time the user press save on the blue editor-popup.

At the basic level, edits can be made by passing an edit object to the editor. Edit objects consist of a "redo" function which modifies the page HTML to reflect the edit, an "undo" function which does exactly the opposite of "redo", an "edit" function which performs the edit, and a "summary" string to be added to the edit summary.

How to edit the code and test

Disable the gadget "Enable the buttons that allow editing of translation tables on by default" in Special:Preferences#mw-prefsection-gadgets. Make an editable version by copying the code in MediaWiki:Gadget-TranslationAdder.js to User:YourNameHere/scripts/TranslationAdder.js. (Put your name in place of YourNameHere and change the page name however you want.) Run this editable version by putting this code in Special:MyPage/common.js:

// This array of dependencies comes from ].
// If the list of dependencies changes, copy the text after dependencies=
// for TranslationAdder and run console.log(JSON.stringify("paste dependencies here".split(/, ?/)))
// in your browser's JavaScript console. Put the resulting array as the first argument to mw.loader.using.
mw.loader.using(,
function() {
	importScript('User:YourNameHere/scripts/TranslationAdder.js');
});

Edit and see if you can make any improvements.