diff options
Diffstat (limited to 'www/wiki/extensions/Translate/resources/js/ext.translate.storage.js')
-rw-r--r-- | www/wiki/extensions/Translate/resources/js/ext.translate.storage.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/www/wiki/extensions/Translate/resources/js/ext.translate.storage.js b/www/wiki/extensions/Translate/resources/js/ext.translate.storage.js index d2fd5fe9..85e9cb9e 100644 --- a/www/wiki/extensions/Translate/resources/js/ext.translate.storage.js +++ b/www/wiki/extensions/Translate/resources/js/ext.translate.storage.js @@ -1,4 +1,4 @@ -( function ( mw ) { +( function () { 'use strict'; /** @@ -18,16 +18,17 @@ * @param {string} title The title of the page including language code * to store the translation. * @param {string} translation The translation of the message + * @param {string} editSummary The edit summary * @return {jQuery.Promise} */ - save: function ( title, translation ) { + save: function ( title, translation, editSummary ) { var api = new mw.Api(); - // Change to csrf when support for MW 1.25 is dropped - return api.postWithToken( 'edit', { + return api.postWithToken( 'csrf', { action: 'edit', title: title, text: translation, + summary: editSummary, // If the session expires, fail the saving instead of saving it // as an anonymous user (if anonymous can save). // When undefined, the parameter is not included in the request @@ -38,4 +39,4 @@ mw.translate = mw.translate || {}; mw.translate.TranslationApiStorage = TranslationApiStorage; -}( mediaWiki ) ); +}() ); |