User:Siddhartha Ghai/TWG-i18n.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:Siddhartha Ghai/TWG-i18n. |
//<nowiki>
( function ( window, document, $, undefined ) { // Wrap with anonymous function
var TWG = {};
window.TWG = TWG; // allow global access
/* Here begins the i18n-able stuff. This contains messages that can be changed to create new modules without having to go through much of the code.*/
TWG.messages = {};
TWG.messages.commonsets = {};
TWG.messages.scriptname = 'TWG';
TWG.messages.globalfooterlink = 'User:Siddhartha Ghai/TWG';
TWG.messages.typeerror = 'This is not a valid type of tagging. Please choose either prepend or append or replace. Make sure it is all lowercase.';
/*
Note: Put all commonsets before defining any mods.
TWG.messages.commonsets.set = [
{}, same as TWG.messages.mod.templates
]
*/
TWG.messages.commonsets.CSD = [
{ type: 'header', label:'General Criteria' },
{ type: 'radio', name: 'csd',
list: [
{
label: 'Custom deletion rationale using db template',
value: 'db',
tooltip: 'db is short for "delete because". At least one of the other deletion criteria must still apply to the page, and you should (must?) make mention of this in your rationale. This is not a "catch-all" for when you can\'t find any criteria that fit.',
subgroup: {type: 'input', label: 'Please enter a reason', name: '1'}
},
{
label: 'G1: Patent nonsense. Pages consisting purely of incoherent text or gibberish with no meaningful content or history.',
value: 'db-nonsense',
tooltip: 'This does not include poor writing, partisan screeds, obscene remarks, vandalism, fictional material, material not in English, poorly translated material, implausible theories, or hoaxes. In short, if you can understand it, G1 does not apply.'
},
{
label: 'G2: Test page',
value: 'db-test',
tooltip: 'A page created to test editing or other Wikipedia functions. Pages in the User namespace are not included, nor are valid but unused or duplicate templates (although criterion T3 may apply).'
},
{
label: 'G3: Pure vandalism',
value: 'db-vandalism',
tooltip: 'Plain pure vandalism (including redirects left behind from pagemove vandalism)'
},
{
label: 'G3: Blatant hoax',
value: 'db-hoax',
tooltip: 'Blatant and obvious hoax, to the point of vandalism'
},
{
label: 'G4: Recreation of material deleted via a deletion discussion',
value: 'db-repost',
tooltip: 'A copy, by any title, of a page that was deleted via an XfD process or Deletion review, provided that the copy is substantially identical to the deleted version. This clause does not apply to content that has been "userfied", to content undeleted as a result of Deletion review, or if the prior deletions were proposed or speedy deletions, although in this last case, other speedy deletion criteria may still apply'
},
{
label: 'G5: Banned user',
value: 'db-banned',
tooltip: 'Pages created by banned users while they were banned'
},
{
label: 'G6: History merge',
value: 'histmerge',
tooltip: 'Temporarily deleting a page in order to merge page histories',
subgroup: {type: 'input', label: 'Please enter the name of the article whose history is to be merged into this article', name: '1'}
},
{
label: 'G6: Move',
value: 'db-move',
tooltip: 'Making way for a noncontroversial move like reversing a redirect',
// subgroup: {{type: 'input', label: 'Please enter the name of the page to be moved here', name:'1'},
// {type:'textarea', label: 'Please enter a reason for the move.', name: '2'}}
},
{
label: 'G6: XfD',
value: 'db-xfd',
tooltip: 'An admin has closed a deletion discussion (at AfD, FfD, RfD, TfD, CfD, SfD, or MfD) as "delete", but they didn\'t actually delete the page.',
// subgroup: {{type: 'input', label: 'Please enter the name of the votepage', name: 'votepage'},
// {type: 'checkbox', label:'Redirect? (Must be checked for RfD)', value:'yes', name:'redirect'}}
},
{
label: 'G6: Unnecessary disambiguation page',
value: 'db-disambig',
tooltip: 'This only applies for orphaned disambiguation pages which either: (1) disambiguate two or fewer existing Wikipedia pages and whose title ends in "(disambiguation)" (i.e., there is a primary topic); or (2) disambiguates no (zero) existing Wikipedia pages, regardless of its title.'
},
{
label: 'G6: Redirect to malplaced disambiguation page',
value: 'db-movedab',
tooltip: 'This only applies for redirects to disambiguation pages ending in (disambiguation) where a primary topic does not exist.'
},
{
label: 'G6: Copy-and-paste page move',
value: 'db-copypaste',
tooltip: 'This only applies for a copy-and-paste page move of another page that needs to be temporarily deleted to make room for a clean page move.',
subgroup: {type: 'input', label: 'Please enter the name of the page which has been copy-pasted', name: '1'}
},
{
label: 'G6: Housekeeping',
value: 'db-g6',
tooltip: 'Other non-controversial "housekeeping" tasks',
subgroup: {type: 'input', label: 'Please enter a rationale (optional)', name: 'rationale'}
},
{
label: 'G7: Author requests deletion, or author blanked',
value: 'db-author',
tooltip: 'Any page for which deletion is requested by the original author in good faith, provided the page\'s only substantial content was added by its author. If the author blanks the page, this can also be taken as a deletion request.'
},
{
label: 'G8: Pages dependent on a non-existent or deleted page',
value: 'db-g8',
tooltip: 'such as talk pages with no corresponding subject page; subpages with no parent page; file pages without a corresponding file; redirects to invalid targets, such as nonexistent targets, redirect loops, and bad titles; or categories populated by deleted or retargeted templates. This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.',
subgroup: {type: 'input', label: 'Please enter a rationale (optional)', name: 'rationale'}
},
{
label: 'G8: Subpages with no parent page',
value: 'db-subpage',
tooltip: 'This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.'
},
{
label: 'G10: Attack page',
value: 'db-attack',
tooltip: 'Pages that serve no purpose but to disparage their subject or some other entity (e.g., "John Q. Doe is an imbecile"). This includes a biography of a living person that is negative in tone and unsourced, where there is no NPOV version in the history to revert to. Administrators deleting such pages should not quote the content of the page in the deletion summary!'
},
{
label: 'G10: Wholly negative, unsourced BLP',
value: 'db-negublp',
tooltip: 'A biography of a living person that is entirely negative in tone and unsourced, where there is no neutral version in the history to revert to.'
},
{
label: 'G11: Unambiguous advertising',
value: 'db-spam',
tooltip: 'Pages which exclusively promote a company, product, group, service, or person and which would need to be fundamentally rewritten in order to become encyclopedic. Note that an article about a company or a product which describes its subject from a neutral point of view does not qualify for this criterion; an article that is blatant advertising should have inappropriate content as well'
},
{
label: 'G12: Unambiguous copyright infringement',
value: 'db-copyvio',
tooltip: 'Either: (1) Material was copied from another website that does not have a license compatible with Wikipedia, or is photography from a stock photo seller (such as Getty Images or Corbis) or other commercial content provider; (2) There is no non-infringing content in the page history worth saving; or (3) The infringement was introduced at once by a single person rather than created organically on wiki and then copied by another website such as one of the many Wikipedia mirrors',
subgroup: {type: 'input', label: 'Please enter the source url (along with http)', name: 'url'}
},
]
}
];
/*TWG.messages.mod = {
name: '', string, name of the module which shows up in the menu
altname: '', string, alt-text of the module name
title: '', title of the window
redirect: '', string, name of the page to redirect to, for same page use 'THISPAGE'
completed: '', string, the notice to display when all actions of a module have been completed
start: '', string, the notice to display when starting the tagging
submit: true/false, whether the form should have a submit button or not
namespace: [] an array of the namespace numbers where the module is to be active. Numbers should be numbers, not strings.
commonsets: [] an array of objects with each object having two properties, name and type. Name is to be the name of the commonset to be loaded, e.g 'blah' will give TWG.messages.commonsets.blah; and type is to be pre/post which decides whether the set is to be loaded before the mod's own templates or after them.
size: {width: , height: }, numbers, default size of the window to be created
footer: {text: '', link: ''}, strings, footer to be added
templates: [
{
contains objects to be form.append()ed. Each object is to represent one template with subgroup being used for params. Parameter names are derived from Name property of the elements. It should not contain anything except the parameter name to be used in the wikitext. The value of the property is derived from the value property of the element.
The name property supports two hooks, namely IGNORE and COMMONPARAM.
Using the former means that the element will be ignored when adding parameters to the template. If a top-level element is IGNOREd, all its subgroups will be considered templates unless IGNOREd themselves. Hence the first non-IGNOREd element will be considered template, and its subgroups as parameters, unless they are IGNOREd themselves, in which case, the parameters will be their child elements.
COMMONPARAM should only be used with top-level elements having no child elements. It is to be used only for adding a parameter which is common to all the templates in a module and has the same name in all of them.
}, repeat this for every template
],
page: {
main: {
type:'', string, append/prepend/replace, this decides whether new text is added, prepended or it replaces the old text
name:'', name of the page, string; for same page use 'THISPAGE'
wrap:'', tags to wrap the templates in, string e.g: 'code' for <code></code> wrapping
summary: '' string, the editsummary to use for the module
}
alt: [
{
type: same as page
name: same as page
wrap: same as page
summary: same as page
templatename: {object with parameters as property names. Property values may be the names of the parameters from the mainpage, or some hooks like CREATORTALK, THISPAGE etc.} repeat this for all templates.
},
]
}
}
*/
TWG.messages.Tag = {
name: 'Tag',
altname: 'Tag this page',
title: 'Page tagging',
redirect: 'THISPAGE',
completed: 'All done!',
start: 'Starting tagging...',
submit: true,
namespace: [2],
size: {width:640 , height:480 },
footer: {text: 'Inspired from Twinkle', link: 'Wikipedia:Twinkle'},
templates: [
{ type: 'header', label:'Maintainance' },
{
type: "checkbox",
name: "articleTags",
list:[
{value: "advert", label: "article is written like an advertisement"},
{value: "allplot", label: "article is almost entirely a plot summary"},
{value: "autobiography", label: "article is an autobiography and may not be written neutrally"},
{value: "BLP sources", label: "BLP article needs additional sources for verification"},
{value: "BLP unsourced", label: "BLP article has no sources at all (use BLP PROD instead for new articles)"},
{value: "capitalization", label: "article does not follow Wikipedia's guidelines on the use of capital letters"},
{value: "merge", label: "Merge this article with another one"},
{value: "globalize", name: "IGNORE", label:"article may not represent a worldwide view of the subject",
subgroup:{type: 'select',
list: [
{label: "{{globalize}}: article may not represent a worldwide view of the subject", value: "globalize" },
{label: "Region-specific {{globalize}} subtemplates", list: [
{ label: "{{globalize/Australia}}: article deals primarily with the Australian viewpoint", value: "globalize/Australia" },
{ label: "{{globalize/Canada}}: article deals primarily with the Canadian viewpoint", value: "globalize/Canada" },
{ label: "{{globalize/China}}: article deals primarily with the Chinese viewpoint", value: "globalize/China" },
{ label: "{{globalize/Common law}}: article deals primarily with the viewpoint of common law countries", value: "globalize/Common law" },
{ label: "{{globalize/Eng}}: article deals primarily with the English-speaking viewpoint", value: "globalize/Eng" },
{ label: "{{globalize/Europe}}: article deals primarily with the European viewpoint", value: "globalize/Europe" },
{ label: "{{globalize/France}}: article deals primarily with the French viewpoint", value: "globalize/France" },
{ label: "{{globalize/Germany}}: article deals primarily with the German viewpoint", value: "globalize/Germany" },
{ label: "{{globalize/India}}: article deals primarily with the Indian viewpoint", value: "globalize/India" },
{ label: "{{globalize/Middle East}}: article deals primarily with the Middle Eastern viewpoint", value: "globalize/Middle East" },
{ label: "{{globalize/North America}}: article deals primarily with the North American viewpoint", value: "globalize/North America" },
{ label: "{{globalize/Northern}}: article deals primarily with the northern hemisphere viewpoint", value: "globalize/Northern" },
{ label: "{{globalize/Southern}}: article deals primarily with the southern hemisphere viewpoint", value: "globalize/Southern" },
{ label: "{{globalize/South Africa}}: article deals primarily with the South African viewpoint", value: "globalize/South Africa" },
{ label: "{{globalize/UK}}: article deals primarily with the British viewpoint", value: "globalize/UK" },
{ label: "{{globalize/UK and Canada}}: article deals primarily with the British and Canadian viewpoints", value: "globalize/UK and Canada" },
{ label: "{{globalize/US}}: article deals primarily with the USA viewpoint", value: "globalize/US" },
{ label: "{{globalize/West}}: article deals primarily with the viewpoint of Western countries", value: "globalize/West" }
]}
]}
},
{name:"notability", value:"notability", label:"article's subject may not meet the notability guideline",
subgroup:{
name: '1',
type: 'select',
list: [
{ label: "{{notability}}: article\'s subject may not meet the general notability guideline", value: "" },
{ label: "{{notability|Academics}}: notability guideline for academics", value: "Academics" },
{ label: "{{notability|Biographies}}: notability guideline for biographies", value: "Biographies" },
{ label: "{{notability|Books}}: notability guideline for books", value: "Books" },
{ label: "{{notability|Companies}}: notability guidelines for companies and organizations", value: "Companies" },
{ label: "{{notability|Events}}: notability guideline for events", value: "Events" },
{ label: "{{notability|Films}}: notability guideline for films", value: "Films" },
{ label: "{{notability|Music}}: notability guideline for music", value: "Music" },
{ label: "{{notability|Neologisms}}: notability guideline for neologisms", value: "Neologisms" },
{ label: "{{notability|Numbers}}: notability guideline for numbers", value: "Numbers" },
{ label: "{{notability|Products}}: notability guideline for products and services", value: "Products" },
{ label: "{{notability|Sport}}: notability guideline for sports and athletics", value: "Sport" },
{ label: "{{notability|Web}}: notability guideline for web content", value: "Web" }
]
}
}
]},
{type:"textarea", value:"", name: "PLAINTEXTPRE", label:"Plaintext testing"}
],
page: {
main: {
type: 'prepend',
name: 'THISPAGE',
summary: 'Tagging page with [[User:Siddhartha Ghai/TWG|TWG]]'
}
}
};
TWG.messages.TagFile = {
name: 'Tag File',
altname: 'File maintainance tagging',
title: 'File maintainance tagging',
redirect: 'THISPAGE',
completed: 'All done!',
start: 'Starting...',
submit: true,
namespace: [2],
size: {width: 640, height: 480},
footer: {text: 'Inspired from Twinkle', link: 'Wikipedia:Twinkle'},
templates: [
{ type: 'header', label: 'License and sourcing problem tags' },
{ type: 'checkbox', name: 'imageTags', list: [
{ label: '{{Bsr}}: source info consists of bare image URL/generic base URL only', value: 'Bsr' },
{ label: '{{Non-free reduce}}: non-low-resolution fair use image (or too-long audio clip, etc)', value: 'Non-free reduce' },
{ label: '{{Non-free reduced}}: fair use media which has been reduced (old versions need to be deleted)', value: 'Non-free reduced' },
{ label: 'test', name: 'IGNORE',
subgroup: {type: 'checkbox',
list: [{label:'test2', name:'IGNORE',
subgroup: {type: 'checkbox',
list: [{label:'test3', value: 'blah',
subgroup: {type: 'input', name: 'test', label: 'test4'}
}]}
}]}
}]
}
],
page: {
main: {
type: 'prepend',
name: 'THISPAGE',
summary: 'File maintainance tagging using [[User:Siddhartha Ghai/TWG|TWG]]'
}
}
};
TWG.messages.csdarticle = {
name: 'CSD',
altname: 'Nominate article for speedy deletion',
title: 'Speedy deletion nomination',
redirect: 'THISPAGE',
completed: 'All done!',
start: 'Starting...',
submit: true,
namespace: [2],
commonsets: [{name:'CSD', type:'pre'}],
size: {width: 640, height: 480},
footer: {text: 'Inspired from Twinkle', link: 'Wikipedia:Twinkle'},
templates: [
{type: 'header', label: 'Article criteria'},
{ type: 'radio', name: 'csd', list: [
{
label: 'A1: No context. Articles lacking sufficient context to identify the subject of the article.',
value: 'db-nocontext',
tooltip: 'Example: "He is a funny man with a red car. He makes people laugh." This applies only to very short articles. Context is different from content, treated in A3, below.'
},
{
label: 'A2: Foreign language articles that exist on another Wikimedia project',
value: 'db-foreign',
tooltip: 'If the article in question does not exist on another project, the template {{notenglish}} should be used instead. All articles in a non-English language that do not meet this criteria (and do not meet any other criteria for speedy deletion) should be listed at Pages Needing Translation (PNT) for review and possible translation',
subgroup: {type: 'input', label:'Please provide an interwiki link to the source page', name:'source'}
},
{
label: 'A3: No content whatsoever',
value: 'db-nocontent',
tooltip: 'Any article consisting only of links elsewhere (including hyperlinks, category tags and "see also" sections), a rephrasing of the title, and/or attempts to correspond with the person or group named by its title. This does not include disambiguation pages'
},
{
label: 'A5: Transwikied articles',
value: 'db-transwiki',
tooltip: 'Any article that has been discussed at Articles for Deletion (et al), where the outcome was to transwiki, and where the transwikification has been properly performed and the author information recorded. Alternately, any article that consists of only a dictionary definition, where the transwikification has been properly performed and the author information recorded',
subgroup: {type: 'input', label:'Url of the page where this article has been transwikied.', name:'1'}
},
{
label: 'A7: Unremarkable people, groups, companies, web content, and individual animals',
value: 'db-a7',
tooltip: 'An article about a real person, group of people, band, club, company, web content, or individual animal that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead',
subgroup: {type: 'input', label:'Please enter the type of entity', name:'1'}
},
{
label: 'A7: Unremarkable person',
value: 'db-person',
tooltip: 'An article about a real person that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead'
},
{
label: 'A7: Unremarkable musician(s) or band',
value: 'db-band',
tooltip: 'Article about a band, singer, musician, or musical ensemble that does not assert the importance or significance of the subject'
},
{
label: 'A7: Unremarkable club',
value: 'db-club',
tooltip: 'Article about a club that does not assert the importance or significance of the subject'
},
{
label: 'A7: Unremarkable company or organization',
value: 'db-corp',
tooltip: 'Article about a company or organization that does not assert the importance or significance of the subject'
},
{
label: 'A7: Unremarkable website or web content',
value: 'db-web',
tooltip: 'Article about a web site, blog, online forum, webcomic, podcast, or similar web content that does not assert the importance or significance of its subject'
},
{
label: 'A7: Unremarkable individual animal',
value: 'db-animal',
tooltip: 'Article about an individual animal (e.g. pet) that does not assert the importance or significance of its subject'
},
{
label: 'A9: Unremarkable musical recording where artist\'s article doesn\'t exist',
value: 'db-a9',
tooltip: 'An article about a musical recording which does not indicate why its subject is important or significant, and where the artist\'s article has never existed or has been deleted'
},
{
label: 'A10: Recently created article that duplicates an existing topic',
value: 'a10',
tooltip: 'A recently created article with no relevant page history that does not aim to expand upon, detail or improve information within any existing article(s) on the subject, and where the title is not a plausible redirect. This does not include content forks, split pages or any article that aims at expanding or detailing an existing one.',
subgroup: {type: 'input', label: 'Name of the article to which this is redundant', name:'article'}
}
]}
],
page: {
main: {
type: 'prepend',
name: 'THISPAGE',
wrap: 'nowiki',
summary: 'Speedy deletion nomination using [[User:Siddhartha Ghai/TWG|TWG]]'
},
alt: [
{
type: 'append',
name: 'User talk:Siddhartha Ghai/Sandbox',
wrap: 'nowiki',
summary: 'Notification of speedy deletion nomination using [[User:Siddhartha Ghai/TWG|TWG]]',
db:{NAME:'subst:db-reason-notice', '1':'THISPAGE', 'header=1':'', '3':'1'},
'db-nonsense':{NAME:'subst:db-nonsense-notice', '1':'THISPAGE', 'header':'1'},
'db-test':{NAME:'subst:Db-test-notice', '1':'THISPAGE', 'header':'1'},
'db-vandalsim':{NAME:'subst:Db-vandalism-notice','1':'THISPAGE', 'header':'1'},
'db-hoax':{NAME:'subst:Db-vandalism-notice','1':'THISPAGE', 'header':'1'},
'db-repost':{NAME:'subst:uw-repost', '1':'THISPAGE', 'header':'1'},
histmerge:{NAME:'subst:db-copypaste-notice', '1': '1', '2':'THISPAGE'},
'db-copypaste':{NAME:'subst:Db-copypaste-notice', '1':'THISPAGE', 'header=1':''},
'db-attack':{NAME:'subst:db-attack-notice', '1':'THISPAGE', 'header':'1'},
'db-negublp':{NAME:'subst:db-negublp-notice', '1':'THISPAGE', 'header':'1'},
'db-spam':{NAME:'subst:spam-warn', '1':'THISPAGE', 'header':'1'},
'db-copyvio':{NAME:'subst:nothanks-sd', '1':'THISPAGE', 'header':'1','url':'url'},
'db-nocontext':{NAME:'subst:empty-warn', '1':'THISPAGE', 'header':'1'},
'db-foreign':{NAME:'subst:db-foreign-notice', '1':'THISPAGE', 'header':'1'},
'db-nocontent':{NAME:'subst:nocontent-warn', '1':'THISPAGE', 'header':'1'},
'db-transwiki':{NAME:'subst:Db-transwiki-notice', '1':'THISPAGE', 'header=1':''},
'db-a7':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header=1':''},
'db-person':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header':'1'},
'db-band':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header':'1'},
'db-club':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header':'1'},
'db-corp':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header':'1'},
'db-web':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header':'1'},
'db-animal':{NAME:'subst:nn-warn', '1':'THISPAGE', 'header':'1'},
'db-a9':{NAME:'subst:db-a9-notice', '1':'THISPAGE', 'header':'1'},
'db-a10':{NAME:'subst:db-a10-notice', '1':'THISPAGE', 'header':'1', 'article':'article'}
}
]
}
};
/*array containing the names of the mods,
used for general initialization of the mods and
detecting the messages to be used by it
contains strings
*/
TWG.mods = ['Tag', 'TagFile', 'csdarticle'];
/* Here ends the i18n-able stuff.*/
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Siddhartha_Ghai/TWG.js&action=raw&ctype=text/javascript');
} ( window, document, jQuery )); // End wrap with anonymous function
//</nowiki>