User:Plastikspork/fr.js

// SporkFr

function SporkFr { document.forms.editform.wpSummary.value = "Translate Fr -> En";

var txt = document.forms.editform.wpTextbox1; txt.value = txt.value.replace(/\{\{(V)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(VI)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(VII)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(VIII)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(IX)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(X)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XI)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XII)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XIII)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XIV)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XV)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XVI)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XVII)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XVIII)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XIX)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XX)e siècle\}\}/g, '$1e siècle'); txt.value = txt.value.replace(/\{\{(XXI)e siècle\}\}/g, '$1e siècle');

txt.value = txt.value.replace(/\{\{(V)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(VI)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(VII)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(VIII)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(IX)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(X)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XI)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XII)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XIII)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XIV)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XV)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XVI)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XVII)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XVIII)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XIX)e s\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XX)e siècle\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XXI)e siècle\}\}/g, '$1e');

txt.value = txt.value.replace(/\{\{(V)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(VI)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(VII)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(VIII)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(IX)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(X)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XI)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XII)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XIII)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XIV)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XV)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XVI)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XVII)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XVIII)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XIX)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XX)e\}\}/g, '$1e'); txt.value = txt.value.replace(/\{\{(XXI)e\}\}/g, '$1e');

txt.value = txt.value.replace(/\{\{[_ ]*(?:[Èè]me|[Ee])[_ ]*\}\}/g, 'e'); txt.value = txt.value.replace(/\{\{[_ ]*[Ee]r[_ ]*\}\}/g, 'er');

txt.value = txt.value.replace(/\[\[Fichier:/gi, '[[File:');

txt.value = txt.value.replace(/\{\{[_ ]*(?:[Ll]oupe|[Aa]rticle[_ ]+détaillé)[_ ]*(\||\}\})/g, '{{main$1'); txt.value = txt.value.replace(/\{\{[_ ]*[Aa]rticle[_ ]+connexe[_ ]*(\||\}\})/g, '{{see also$1'); txt.value = txt.value.replace(/\{\{[_ ]*[Aa]phorisme[_ ]*(\||\}\}|[\r\n])/g, '{{quotation$1');

txt.value = txt.value.replace(/\{\{[_ ]*[Rr]éférences[_ ]*\|[ ]*colonnes[ ]*=[ ]*/g, '{{reflist|'); txt.value = txt.value.replace(/\{\{[_ ]*[Rr]éférences[_ ]*(\||\}\})/g, '{{reflist$1'); txt.value = txt.value.replace(/(\{\{)[_ ]*[Dd]ébut[_ ]+citation[_ ]*\}\}((?:[^{}]|[\r\n])*)\{\{[_ ]*[Ff]in[_ ]+citation[_ ]*(\}\})/g, '$1cquote|$2$3');

document.forms.editform.wpMinoredit.checked = true; document.forms.editform.wpDiff.click; }

//Allows URI to be properly decoded for view mode (see WP:AutoEd) function SporkFr_QueryString(p) { var re = RegExp('[&?]' + p + '=([^&]*)'); var matches; if (matches = re.exec(document.location)) { try { return decodeURI(matches[1]); } catch (e) { } } return null; }

$(function { if( SporkFr_QueryString('SporkFr1') ) {  SporkFr; } if (document.forms.editform) {  mw.util.addPortletLink('p-tb', 'javascript:SporkFr', 'SporkFr', 'ca-sporkfr', 'SporkFr', 'z', document.getElementById('ca-history')); } else if ( (mw.config.get('wgAction') == "view") && mw.config.get('wgIsArticle')) {   var url = mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=' + encodeURIComponent(mw.config.get('wgPageName')) + '&action=edit';   mw.util.addPortletLink('p-tb', url + '&SporkFr1=true', 'SporkFr', 'ca-sporkfr', 'SporkFr', 'z', document.getElementById('ca-history')); } });