Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4121754
storage.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
storage.js
View Options
'use strict'
;
/**
* This class can save translation to translation stash.
*
* @since 2013.10
*/
var
TranslationStashStorage
=
function
()
{
// No-op for now. Could take api module as param for example.
};
TranslationStashStorage
.
prototype
=
{
/**
* Save the translation.
*
* @param {string} title The title of the page including language code
* to store the translation.
* @param {string} translation The translation of the message
* @return {jQuery.Promise}
*/
save
:
function
(
title
,
translation
)
{
var
api
=
new
mw
.
Api
();
return
api
.
postWithToken
(
'csrf'
,
{
action
:
'translationstash'
,
subaction
:
'add'
,
title
:
title
,
translation
:
translation
}
).
then
(
function
()
{
// Fake normal save API
return
{
edit
:
{
result
:
'Success'
}
};
}
);
},
/**
* Get the current users translations.
*
* @param {string} user User name
* @return {jQuery.Promise}
*/
getUserTranslations
:
function
(
user
)
{
var
api
=
new
mw
.
Api
();
return
api
.
postWithToken
(
'csrf'
,
{
action
:
'translationstash'
,
subaction
:
'query'
,
username
:
user
}
).
promise
();
}
};
module
.
exports
=
TranslationStashStorage
;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 04:56 (5 h, 28 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1b/6b/7fce21fe57b1440755faaf93363d
Default Alt Text
storage.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment