User:Frietjes/citetrans.js

jQuery(document).ready(function($) { if(mw.config.get('wgNamespaceNumber') != -1) {	mw.loader.using(['mediawiki.util']).done( function { var portletlink = mw.util.addPortletLink('p-tb','#','Citation translation','t-citetrans'); $(portletlink).click(function(e) {			e.preventDefault;			citationtranslationfunction;		}); }); } // // function citationtranslationfunction {  var myContent = document.getElementById('wpTextbox1').value;

// Date myContent = myContent.replace(/(\{\{)[_ ]*[Ff]echa(?:[_ ]+de[_ ]*inicio|)[_ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*edad[ ]*(\}\})/g, '$1start date and age|$4|$3|$2$5'); myContent = myContent.replace(/(\{\{)[_ ]*[Ff]echa(?:[_ ]+de[_ ]*inicio|)[_ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)(?:\|[ ]*link[\r\n\t ]*=[ a-z]*|)[ ]*(\}\})/g, '$1start date|$4|$3|$2$5'); myContent = myContent.replace(/(\{\{)[_ ]*[Ff]echa(?:[_ ]+de[_ ]*inicio|)[_ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)(?:\|[ ]*link[\r\n\t ]*=[ a-z]*|)[ ]*(\}\})/g, '$1start date|$3|$2$4'); myContent = myContent.replace(/(\{\{)[_ ]*[Ff]echa(?:[_ ]+de[_ ]*inicio|)[_ ]*\|[ ]*([0-9]+)(?:\|[ ]*link[\r\n\t ]*=[ a-z]*|)[ ]*(\}\})/g, '$1start date|$2$3'); myContent = myContent.replace(/(final[0-9]*[\r\n\t ]*=[\r\n\t ]*\{\{)start date/g, '$1end date'); myContent = myContent.replace(/(fecha de nacimiento[\r\n\t ]*=[\r\n\t ]*\{\{)start date/g, '$1birth date'); myContent = myContent.replace(/(\{\{)[_ ]*[Ll]ahirmati\|((?:[^\[\]\{\}\|]|\[\^\[\*\]\])*)\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*([0-9]+)[ ]*(\}\})/g, 'born $1birth date|$5|$4|$3$6 in $2'); myContent = myContent.replace(/(\{\{)[_ ]*[Kk]aynak[_ ]+belirt/g, '$1citation needed'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Kk]aynak-düz|[Kk]aynakları[_ ]+düzenle)/g, '$1citation style');

// translate citation templates myContent = myContent.replace(/(<)(ref[^<>\/]*>[\t ]*\{\{)(Internetquelle|Literatur)([\t ]*\|)/gi, '$1{' + '{subst:void}' + '}$2subst:$3$4'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Kk]aynak|[Cc]itation\/[Cc]ore)([\t \r\n]*[\||\}])/g, '$1citation$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Cc]iteer boek|[Kk]itap[_ ]+kaynağı)/gi, '$1cite book'); myContent = myContent.replace(/(\{\{)[_ ]*[Kk]irjaviite/g, '$1cite book'); myContent = myContent.replace(/(\{\{)[_ ]*[Oo]uvrage/gi, '$1cite book'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Кніга|[Cc]ytuj[_ ]+książkę|مرجع كتاب|[Bb]ok[_ ]*ref|[Cc]ita[_ ]+libro|[Gg]rāmatas[_ ]+atsauce)([_ \r\n]*\|)/g, '$1cite book$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Cc]hapitre)[_ \r\n]*(\|)/g, '$1cite chapter$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Артыкул)[_ \r\n]*(\|)/g, '$1cite article$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Aa]kademik[_ ]+dergi[_ ]+kaynağı|[Dd]ergi[_ ]+kaynağı)/g, '$1cite journal'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ytuj[_ ]+pismo/g, '$1cite journal'); myContent = myContent.replace(/(\{\{)[_ ]*[Tt]idskriftsref/g, '$1cite journal'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itar[_ ]+periódico/g, '$1cite journal'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itar[_ ]+jornal/g, '$1cite journal'); myContent = myContent.replace(/(\{\{)[_ ]*[Aa]rticle[_ \r\n]*(\|)/gi, '$1cite journal$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Dd]ergi[_ ]+kaynağı/gi, '$1cite journal'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Cc]itar[_ ]+notícias?|[Hh]aber[_ ]+kaynağı|[Gg]azete[_ ]+kaynağı|[Cc]iteer[_ ]+nieuws)/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ita[_ ]+(?:noticias?|news)/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*সংবাদ উদ্ধৃতি/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*[Tt]idningsref/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*استشهاد بخبر/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itácia[_ ]+periodika/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*[Zz]iņu[_ ]+atsauce/g, '$1cite news'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ita[_ ]+pubblicazione/g, '$1cite publication'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ita[_ ]+publicación/g, '$1cite publication'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itar[_ ]+publicação/g, '$1cite publication'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ita[_ ]*web/g, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Цц]итат[_ ]+уеб[_ ]*\|/g, '$1cite web|'); myContent = myContent.replace(/(\{\{)[_ ]*ওয়েব উদ্ধৃতি/g, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itar[_ ]+web/g, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[СCc]пасылка[_ ]*\|/g, '$1cite web|'); myContent = myContent.replace(/(\{\{)[_ ]*[Ll]ien[_ ]+web/g, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*مرجع ويب/gi, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*استشهاد ويب/gi, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ytuj[_ ]+stronę/g, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]iteer[_ ]+web/g, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Vv]erkkoviite/gi, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Ww]eb[_ ]+kaynağı/gi, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Tt]īmekļa[_ ]+atsauce/gi, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itácia[_ ]+elektronického[_ ]+dokumentu/gi, '$1cite web'); myContent = myContent.replace(/(\{\{)[_ ]*[Aa]nsiklopedi[_ ]+kaynağı/gi, '$1cite encyclopedia'); myContent = myContent.replace(/(\{\{)[_ ]*[Bb]ölüm[_ ]+kaynağı/gi, '$1cite episode'); myContent = myContent.replace(/(\{\{)[_ ]*[Vv]ideo[_ ]+kaynağı/gi, '$1cite video'); myContent = myContent.replace(/(\{\{)[_ ]*[Kk]onferans[_ ]+kaynağı/gi, '$1cite conference'); myContent = myContent.replace(/(\{\{)[_ ]*[Pp]odcast[_ ]+kaynağı/gi, '$1cite podcast'); myContent = myContent.replace(/(\{\{)[_ ]*[Tt]weet[_ ]+kaynağı/gi, '$1cite tweet'); myContent = myContent.replace(/(\{\{)[_ ]*[Gg]örüşme[_ ]+kaynağı/gi, '$1cite interview'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]itar[_ ]+livro/g, '$1cite book'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Cc]itar[_ ]+tese|[Tt]ez[_ ]+kaynağı)/g, '$1cite thesis'); myContent = myContent.replace(/(\{\{)[_ ]*[Ee]\-posta[_ ]+kaynağı/g, '$1cite mailing list'); myContent = myContent.replace(/(\{\{)[_ ]*[Ww]ebarşiv[_ ]*(\||\}\})/g, '$1web archive$2'); myContent = myContent.replace(/(\[\[)[ ]*Dosya[ ]*:/gi, '$1File:'); // ordinals and centuries myContent = myContent.replace(/\{\{1re\|((?:[^{}\|]|\{\{[^{}]*\}\})*)\}\}/g, '1re $1'); myContent = myContent.replace(/\{\{1er\|((?:[^{}\|]|\{\{[^{}]*\}\})*)\}\}/g, '1er $1'); myContent = myContent.replace(/\{\{([0-9]+)e\|((?:[^{}\|]|\{\{[^{}]*\}\})*)\}\}/g, '$1e $2'); myContent = myContent.replace(/\{\{([XVI]+)e\|((?:[^{}\|]|\{\{[^{}]*\}\})*)\}\}/g, '$1e $2'); myContent = myContent.replace(/\{\{1re\}\}/g, '1re'); myContent = myContent.replace(/\{\{1er\}\}/g, '1er'); myContent = myContent.replace(/\{\{Ier\}\}/g, 'Ier'); myContent = myContent.replace(/\{\{([XVI]+)e\}\}/g, '$1e'); myContent = myContent.replace(/\{\{([XVI]+)\}\}/g, '$1'); myContent = myContent.replace(/\{\{[Ss][_ ]+mini\-[_ ]*\|([XVI]+)\|e\}\}/g, '{'+'{abbr|$1e|$1e siècle}'+'}'); myContent = myContent.replace(/\{\{[Ss][_ ]*\|([XVI]+)\|e\}\}/g, '$1e siècle'); myContent = myContent.replace(/\{\{[Ss]\-[_ ]*\|([0-9]+)\|e\}\}/g, '$1e siècle'); myContent = myContent.replace(/\{\{[Ss]2\-[_ ]*\|([XVI]+)\|e\|([XVI]+)\|e\}\}/g, '$1e et $2e siècles'); myContent = myContent.replace(/\{\{[Ss]p\-[_ ]*\|([XVI]+)\|e\|[ ]*[\-–][ ]*\|([XVI]+)\|e\}\}/g, '$1e – $2e siècle'); myContent = myContent.replace(/\{\{[Ss]p\-[_ ]*\|([XVI]+)\|e\|[ ]*au[ ]*\|([XVI]+)\|e\}\}/g, '$1e au $2e siècle'); myContent = myContent.replace(/\{\{([XVI]+)e s\}\}/g, '$1e'); myContent = myContent.replace(/\{\{([XVI]+)e siècle\}\}/g, '$1e siècle'); myContent = myContent.replace(/\{\{([0-9]+)e\}\}/g, '$1e'); myContent = myContent.replace(/\{\{[_ ]*[Ss]\-[_ ]*\|[ ]*([XVI]+)[ ]*\|[ ]*e[ ]*\}\}/g, '$1e siècle'); myContent = myContent.replace(/\{\{[_ ]*\-[Ss]\-[_ ]*\|[ ]*([XVI]+)[ ]*\|[ ]*e[ ]*\}\}/g, '$1e siècle av. J.-C.'); myContent = myContent.replace(/\{\{[_ ]*[Ss]\-[_ ]*\|[ ]*([XVI]+)[ ]*\}\}/g, '$1e siècle'); myContent = myContent.replace(/\{\{[_ ]*\-[Ss]\-[_ ]*\|[ ]*([XVI]+)[ ]*\}\}/g, '$1e siècle av. J.-C.'); myContent = myContent.replace(/\{\{[_ ]*[Ss]\-[_ ]*\|[ ]*([XVI]+)[ ]*\|[ ]*\}\}/g, '$1e siècle'); myContent = myContent.replace(/\{\{[_ ]*\-[Ss]\-[_ ]*\|[ ]*([XVI]+)[ ]*\|[ ]*\}\}/g, '$1e siècle av. J.-C.'); myContent = myContent.replace(/\{\{[Ss]2\-[_ ]*\|[ ]*([XVI]+)[ ]*\|[ ]*([XVI]+)[ ]*\}\}/g, '$1e et $2e siècles'); myContent = myContent.replace(/\{\{[_ ]*e[_ ]*\}\}/gi, 'e'); // translate other templates myContent = myContent.replace(/(\{\{)[_ ]*([A-Za-z][a-z])S[_ ]*(\|)/g, '$1lang-$2' + '$3'); myContent = myContent.replace(/(\{\{[_ ]*lang\-[A-Za-z][a-z][_ ]*\|)/g, function(match) {return match.toLowerCase;}); myContent = myContent.replace(/(\{\{)[_ ]*(?:Toter link|Недоступная ссылка|Collegamento interrotto|Lien brisé|깨진 링크)[_ ]*(\}\}|\|)/gi, '$1dead link$2'); myContent = myContent.replace(/(\{\{)[_ ]*Kısaltma[_ ]*(\}\}|\|)/gi, '$1abbr$2'); myContent = myContent.replace(/(\{\{)[_ ]*Allmovie'de[_ ]*kişi(\}\}|\|)/gi, '$1AllMovie name$2'); myContent = myContent.replace(/(\{\{)[_ ]*Asya[_ ]*konusu[_ ]*(\|)/gi, '$1Asia topic$2'); myContent = myContent.replace(/(\{\{)[_ ]*[CC]ontrollo di autorità/g, '$1authority control'); myContent = myContent.replace(/(\{\{)[_ ]*[Aa]ncre[_ ]*(\||\}\})/g, '$1anchor$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Aa]rka[_ ]+plan[_ ]+rengi|[Aa]pr)[_ ]*(\||\}\})/g, '$1bg$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Ll]aquelle[_ ]*(\||\}\})/g, '$1clarify$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Ii]nterprogetto[ ]*\|[ ]*commons[\r\n\t ]*=[\r\n\t ]*[Cc]ategory:/g, '$1commons category|'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ommons[_ ]+kategori[_ ]*(\||\}\})/g, '$1commons category$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Cc]ommons[_ ]+kategori\-ufak[_ ]*(\||\}\})/g, '$1commons category-inline$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Dd]önüştürme[_ ]*\|/g, '$1convert|'); myContent = myContent.replace(/(\{\{)[_ ]*[Ss]ıralanabilir[_ ]+tablo[_ ]+için[_ ]+tarih/g, '$1date table sorting'); myContent = myContent.replace(/(\{\{)[_ ]*وصلة مكسورة[_ ]*(\}\}|\|)/gi, '$1dead link$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Dd]iminution[_ ]*(\}\}|\|)/gi, '$1decrease$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Discogs'ta sanatçı|Discog artist)[_ ]*(\}\}|\|)/gi, '$1Discogs artist$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Div sütunu)[_ ]*(\}\}|\|)/gi, '$1div col$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Div sütunu bitiş)[_ ]*(\}\}|\|)/gi, '$1div col end$2'); myContent = myContent.replace(/(\{\{)[_ ]*Çift[_ ]+resim[_ ]+istifi/gi, '$1double image'); myContent = myContent.replace(/(\{\{)[_ ]*[Bb]itiş[_ ]*kutusu/g, '$1end'); myContent = myContent.replace(/(\{\{)[_ ]*Avrupa[_ ]*konusu[_ ]*(\|)/gi, '$1Europe topic$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Bb]aşlık-taslak|[Bb]aşlık[_ ]+genişlet)[_ ]*(\||\}\})/gi, '$1expand section$2'); myContent = myContent.replace(/(\{\{)[_ ]*Seçkin[_ ]*liste[_ ]*(\}\}|\|)/gi, '$1Featured list$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Yy]azı[_ ]+tipi[_ ]*(\}\}|\|)/gi, '$1font$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Altın Portakal En İyi Aktör Ödülü Sahipleri|Altın Portakal En İyi Erkek Oyuncu Ödülü)(\}\}|\|)/gi, '$1GoldenOrangeAwardBestActor$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Altın Portakal En İyi Aktrisler|Altın Portakal En İyi Kadın Oyuncu Ödülü)(\}\}|\|)/gi, '$1GoldenOrangeAwardBestActress$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Altın Portakal En İyi Senaryo Ödülü)(\}\}|\|)/gi, '$1GoldenOrangeAwardBestScreenplay$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Altın Portakal En İyi Yardımcı Erkek Oyuncu Ödülü|Altın Portakal En İyi Yardımcı Erkek Oyuncu Ödülü Sahipleri)(\}\}|\|)/gi, '$1GoldenOrangeAwardBestSupportingActor$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Altın Portakal En İyi Yardımcı Kadın Oyuncu Ödülü)(\}\}|\|)/gi, '$1GoldenOrangeAwardBestSupportingActress$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:Altın Portakal Yaşam Boyu Onur Ödülü)(\}\}|\|)/gi, '$1GoldenOrangeAwardLifeAchievement$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Ee]dificio[_ ]+civile|[Yy]apı[_ ]+bilgi[_ ]+kutusu)/g, '$1Infobox building'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Kk]işi[_ ]+bilgi[_ ]+kutusu|[Oo]yuncu[_ ]+bilgi[_ ]+kutusu)/g, '$1Infobox person'); myContent = myContent.replace(/(\{\{)[_ ]*[Aa]ugmentation[_ ]*(\}\}|\|)/gi, '$1increase$2'); myContent = myContent.replace(/(\{\{)[_ ]*İng[_ ]*(\}\})/gi, '$1in lang|en$2'); myContent = myContent.replace(/(\{\{)[_ ]*Lejant[_ ]*(\}\}|\|)/gi, '$1legend$2'); myContent = myContent.replace(/(\{\{)[_ ]*Konum[_ ]*haritası[_ ]*(\}\}|\|)/gi, '$1Location map$2'); myContent = myContent.replace(/(\{\{)[_ ]*Konum[_ ]*haritası\+[_ ]*(\}\}|\|)/gi, '$1Location map+$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:مفصلة|[Aa]rticle[_ ]*détaillé|[Aa]na[_ ]*madde)/g, '$1main'); myContent = myContent.replace(/(\{\{)[_ ]*dipnotsuz[_ ]*(\}\}|\|)/gi, '$1more footnotes needed$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Hh]ayır[_ ]*(\}\}|\|)/gi, '$1no$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Aa]daylık[_ ]*(\}\}|\|)/gi, '$1nom$2'); myContent = myContent.replace(/(\{\{)[_ ]*Resmî[_ ]*site[_ ]*(\}\}|\|)/gi, '$1official website$2'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Pp]ortale|[Pp]ortail)[_ ]*(\|)/g, '$1portal$2'); myContent = myContent.replace(/(\{\{)[_ ]*Ksöz/gi, '$1quote'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Rr]éférences|[Kk]aynakça|[Rr]eferências|[Rr]ealist|[Pp]rzypisy|[Ll]istaref)/g, '$1reflist'); myContent = myContent.replace(/(\{\{)[_ ]*مراجع/g, '$1reflist'); myContent = myContent.replace(/(\{\{)[_ ]*(?:[Vv]edi[_ ]+anche|Ayrıca[_ ]*bakınız)[_ ]*(\|)/g, '$1see also$2'); myContent = myContent.replace(/(\{\{)[_ ]*Statik[_ ]*sütun[_ ]*başlangıcı[_ ]*(\}\}|\|)/gi, '$1Static column begin$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Kk]dş[_ ]*\|/g, '$1sfn|'); myContent = myContent.replace(/(\{\{)[_ ]*Küçük/gi, '$1small'); myContent = myContent.replace(/(\{\{)[_ ]*[Ss]ıralama[_ ]*\|/g, '$1sort|'); myContent = myContent.replace(/(\{\{)[_ ]*İçindekiler[_ ]*sağ[_ ]*(\}\}|\|)/gi, '$1TOC right$2'); myContent = myContent.replace(/(\{\{)[_ ]*Şarkı listesi/gi, '$1track listing'); myContent = myContent.replace(/(\{\{)[_ ]*Türkiye[_ ]*konuları[_ ]*(\}\}|\|)/gi, '$1Turkey topics$2'); myContent = myContent.replace(/(\{\{)[_ ]*bilinmiyor[_ ]*(\}\}|\|)/gi, '$1unknown$2'); myContent = myContent.replace(/(\{\{)[_ ]*kaynaksız[_ ]*(\}\}|\|)/gi, '$1unreferenced$2'); myContent = myContent.replace(/(\{\{)[_ ]*Evet[_ ]*(\}\}|\|)/gi, '$1yes$2'); myContent = myContent.replace(/(\{\{)[_ ]*[Uu]nité[_ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*(k?m)[ ]*\|[ ]*(2)[ ]*(\}\})/g, '$1cvt|$2|$3$4$5'); myContent = myContent.replace(/(\{\{)[_ ]*[Uu]nité[_ ]*\|[ ]*([0-9]+)[ ]*\|[ ]*(k?m)[ ]*(\}\})/g, '$1cvt|$2|$3$4'); myContent = myContent.replace(/(\{\{)[_ ]*[Uu]nité[_ ]*\|[ ]*([0-9\.]+)[ ]*\|[ ]*([^\{\}\|]*)[ ]*(\}\})/g, '$1formatnum:$2$4 $3'); myContent = myContent.replace(/(\{\{)[_ ]*[Uu]nité[_ ]*\|[ ]*([0-9,]+)[ ]*\|[ ]*([^\{\}\|]*)[ ]*(\}\})/g, '$2 $3'); myContent = myContent.replace(/\{\{[_ ]*М\.[_ ]*\}\}/g, 'Москва'); myContent = myContent.replace(/\{\{[_ ]*СПб\.[_ ]*\}\}/g, 'Санкт-Петербург');

// other clean up myContent = myContent.replace(/(title[\r\n\t ]*=[\r\n\t ]*)(ACTUAL ARTICLE TITLE BELONGS HERE!)/g, '$1<'+'!--$2-->'); myContent = myContent.replace(/[Ww]ayback[\t ]*\|[\t ]*url[\t ]*=[\t ]*([^\r\n\|\{\} ]*)[\t ]*\|[\t ]*date[\t ]*=[\t ]*([0-9]+)[\t ]*(\||\}\})/g, 'webarchive|url=https://web.archive.org/web/$2/$1$3'); myContent = myContent.replace(/([\r\n]|\[\[)Fichier:/gi, '$1File:'); myContent = myContent.replace(/(\[\[File:[^\[\]]*\|)vignette(\|)/g, '$1thumb$2'); myContent = myContent.replace(/(\{\{[_ ]*[Dd]ate)\-[_ \|]*\|([^{}\|]*\}\})/gi, '$1|$2'); myContent = myContent.replace(/(\{\{[_ ]*[Dd]ate)\-[_ \|]*\|([^{}\|]*)\|([^{}\|]*\}\})/gi, '$1|$2 $3'); myContent = myContent.replace(/(\{\{[_ ]*[Dd]ate)\-[_ \|]*\|([^{}\|]*)\|([^{}\|]*)\|([^{}\|]*\}\})/gi, '$1|$2 $3 $4'); // spacing myContent = myContent.replace(/(\{\{)[_ ]+((?:[Cc]ite|[Cc]itation))/g, '$1$2');

// roll up citations to simplify processing while (myContent.search(/\{\{(?:[Cc]ite|[Cc]itation)[_ ]+(?:book|web|article)[^\{\}\n]*[\n]/g) >= 0 ) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)[_ ]+(?:book|web|article)[^\{\}\n]*)[\n]/gi, '$1'); } for(var i=0; i<3; i++) { // cut these if they are blank myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*resumenprofano[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*fuenteprofano[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*fechaprofano[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*cita[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*mes[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*giorno[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*mesacceso[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*[Tt]unniste[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*konu[0-9]*[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*konubağı[0-9]*[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*soyadı[0-9]+[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*ad[0-9]+[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*каментарый[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*суаўтары[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*език-скрит[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*месец[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*)\|[ ]*съавтори[\r\n\t ]*=(?:| )*(\||\}\})/g,'$1$2'); myContent = myContent.replace(/(\{\{[Rr]eflist)[_ ]*\|[ ]*taille[\r\n\t ]*=[\r\n\t ]*(?:| )*(\||\}\})/g, '$1$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)[^{}\|]*\|)[ ]*(https?:[^{}\|]*)(\}\}|\|)/gi, '$1url=$2$3'); myContent = myContent.replace(/(\|)[ ]*([^{}\|=]*)(\}\}|\|)/g, '$3title=$4$1$2$5'); myContent = myContent.replace(/[\| ]*(\}\}|\|[ ]*[a-z0-9_\-]+[\r\n\t ]*=)/g, '$1');

// start translation myContent = myContent.replace(/(\{\{[Rr]eflist[_ ]*\|)[ ]*taille[\r\n\t ]*=[\r\n\t ]*([0-9]+)[ ]*(\}\})/g, '$1$2em$3'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:acessdate|acess\-date|data-acceso|fechaacceso|достъп_дата|সংগ্রহের-তারিখ|hämtdatum|consulta|acessodata|acessadoem|accesso|bezochtdatum|consulté le|data dostępu|dataaccés|AccessDate)([\r\n\t ]*=)/g,'$1access-date$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:añoacceso|[Ll]uettu|dátum prístupu|erişim\-?tarihi|تاريخ الوصول)([\r\n\t ]*=)/g,'$1access-date$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:agencia|ajans|agència)([\r\n\t ]*=)/g,'$1agency$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:urlarchivo|urlarchivio|arkivurl|архив_уеб_адрес|আর্কাইভের-ইউআরএল|arquivourl|مسار أرشيف|arşiv[Uu][Rr][Ll]|مسار الأرشيف)([\r\n\t ]*=)/g,'$1archive-url$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:fechaarchivo|dataarchivio|arkivdatum|архив_дата|আর্কাইভের-তারিখ|arquivodata|تاريخ أرشيف|arşivtarihi|تاريخ الأرشيف)([\r\n\t ]*=)/g,'$1archive-date$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:posizione)([\r\n\t ]*=)/g,'$1at$2'); while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:autore|auteur|autor|[Tt]ekijä|[Yy]azar|автор|مؤلف|författare|аўтар)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:autore|auteur|autor|[Tt]ekijä|[Yy]azar|автор|مؤلف|författare|аўтар)([0-9]*[\r\n\t ]*=)/g,'$1author$2'); } while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:autorlink|enlaceautor|wkautore|lien auteur|odkaz na autora|yazarlink|yazarbağı|författarlänk|автор_препратка|аўтарlink)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:autorlink|enlaceautor|wkautore|lien auteur|odkaz na autora|yazarlink|yazarbağı|författarlänk|автор_препратка|аўтарlink)([0-9]*[\r\n\t ]*=)/g,'$1authorlink$2'); } myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:capitolo|capítulo|bölüm|titre chapitre)([\r\n\t ]*=)/g,'$1chapter$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:url_capitolo|urlcapítulo|bölümurl)([\r\n\t ]*=)/g,'$1chapterurl$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:coautores|coautori|coauteurs|medförfattare|съавтори|суаўтары)([\r\n\t ]*=)/g,'$1coauthors$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:частка)([\r\n\t ]*=)/g,'$1contribution$2'); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:fecha|data|online on|дата|tarih|dátum|তারিখ|дата|تاريخ|Date|datum)([\r\n\t ]*=)/g,'$1date$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:giorno|jour)([\r\n\t ]*=)/g,'$1day$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:urlmorta|ölüurl|অকার্যকর-ইউআরএল)([\r\n\t ]*=)/g,'$1deadurl$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:выданьне|edizione|edición|edição|إصدار|basım|utgåva)([\r\n\t ]*=)/g,'$1edition$2'); while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:curatore|redaktör)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:curatore|redaktör)([0-9]*[\r\n\t ]*=)/g,'$1editor$2'); } while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editor-sobrenome|apellido-editor)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editor-sobrenome|apellido-editor)([0-9]*[\r\n\t ]*=)/g,'$1editor-last$2'); } while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editör)([0-9]*)-soyadı([\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editör)([0-9]*)-soyadı([\r\n\t ]*=)/g,'$1editor$2-last$3'); } while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editor-nome|nombre-editor)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editor-nome|nombre-editor)([0-9]*[\r\n\t ]*=)/g,'$1editor-first$2'); } while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editör)([0-9]*)-ad([\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editör)([0-9]*)-ad([\r\n\t ]*=)/g,'$1editor$2-first$3'); } while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editör)([0-9]*)-bağı([\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:editör)([0-9]*)-bağı([\r\n\t ]*=)/g,'$1editor$2-link$3'); } myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:ansiklopedi)([\r\n\t ]*=)/g,'$1encyclopedia$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:formato|biçim|формат|фармат)([\r\n\t ]*=)/g,'$1format$2'); while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:nome|nombre|ilk|primeiro|prenome|prénom|imię|ad|cognom|първо_име|імя|voornaam|meno|প্রথমাংশ|förnamn|الأول|muhatapadı)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:nome|nombre|ilk|primeiro|prenome|prénom|imię|ad|cognom|първо_име|імя|voornaam|meno|প্রথমাংশ|förnamn|الأول|muhatapadı)([0-9]*[\r\n\t ]*=)/g,'$1first$2'); } myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:görüşmeci)([\r\n\t ]*=)/g,'$1interviewer$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:العدد|sayı)([\r\n\t ]*=)/g,'$1issue$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:publicación|dergi|jornal|صحيفة|tidskrift)([\r\n\t ]*=)/g,'$1journal$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:idioma|llengua|língua[0-9]*|lingua|мова|język|език|dil|jazyk|لغة|langue|ভাষা|språk|اللغة)([\r\n\t ]*=)/g,'$1language$2'); while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:apellidos?|cognome|son|nom|sobrenome|nazwisko|soyadı|ultimo|último|Surname|achternaam|efternamn|priezvisko|фамилно_име|прозвішча|শেষাংশ|muhatapsoyadı|الأخير)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:apellidos?|cognome|son|nom|sobrenome|nazwisko|soyadı|ultimo|último|achternaam|Surname|efternamn|priezvisko|фамилно_име|শেষাংশ|прозвішча|muhatapsoyadı|الأخير)([0-9]*[\r\n\t ]*=)/g,'$1last$2'); } myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:месца|ubicación|lloc|città|[Jj]ulkaisupaikka|lugar|yer|miejsce|miesto|lieu|şehir|مكان|local)([\r\n\t ]*=)/g,'$1location$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:kurum)([\r\n\t ]*=)/g,'$1mailinglist$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:mes|mese|mois|месец|ay)([\r\n\t ]*=)/g,'$1month$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:gazete|সংবাদপত্র)([\r\n\t ]*=)/g,'$1newspaper$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:нумар|número|numero|wydanie|wydani|numara|nummer|edilekçeno|ebilgiedinmeno)([\r\n\t ]*=)/g,'$1number$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:altri|diğerleri)([\r\n\t ]*=)/g,'$1others$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:año\-original|annooriginale|dataoriginale)([\r\n\t ]*=)/g,'$1orig-year$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:página|pagine|passage|[Ss]ivu|[Ss]ayfa|sid)([\r\n\t ]*=)/g,'$1page$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:старонкі|páginas|paginas|pàgines|pagina|pagine|sayfalar|strony|страници|صفحات|sidor)([\r\n\t ]*=)/g,'$1pages$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:kişiler)([\r\n\t ]*=)/g,'$1people$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:дата публікацыі)([\r\n\t ]*=)/g,'$1publication-date$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:lugar-publicación|PublicationPlace|utgivningsort)([\r\n\t ]*=)/g,'$1publication-place$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:выдавецтва|editorial|editore|publicado|site|éditeur|editora|vydavateľ|выдавец|opublikowany|[Jj]ulkaisija|издател|প্রকাশক|yayıncı|yayımcı|wydawca|ناشر|utgivare|uitgever)([\r\n\t ]*=)/g,'$1publisher$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:citacao|cita|citazione|цитат|alıntı)([\r\n\t ]*=)/g,'$1quote$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:[Tt]unniste|cid)([\r\n\t ]*=)/g,'$1ref$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:serie|collana|seri)([\r\n\t ]*=)/g,'$1series$2'); while(myContent.search(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:konu)([0-9]*[\r\n\t ]*=)/g) >= 0) { myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:konu)([0-9]*[\r\n\t ]*=)/g,'$1subject$2'); } myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:título|títol|article|titolo|titulo|titre|titre ouvrage|titel|tytuł|загаловак|[Nn]imike|[Nn]imeke|titul|заглавие|শিরোনাম|rubrik|başlık|عنوان|Title|العنوان)([\r\n\t ]*=)/g,'$1title$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:tip)([\r\n\t ]*=)/g,'$1type$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:traduttore)([\r\n\t ]*=)/g,'$1translator$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:[Oo]soite|lire en ligne|уеб_адрес|ইউআরএল|مسار|URL|المسار)([\r\n\t ]*=)/g,'$1url$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:kullanıcı)([\r\n\t ]*=)/g,'$1user$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:tanıtıcı)([\r\n\t ]*=)/g,'$1via$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:volumen|wolumin|cilt|المجلد|volym)([\r\n\t ]*=)/g,'$1volume$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:sitioweb|ওয়েবসাইট|sito|الموقع)([\r\n\t ]*=)/g,'$1website$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:назва праекту|otros|obra|opera|periódico|pubblicazione|periodikum|eser|назва праекта|çalışma|iş|czasopismo|périodique|труд|কর্ম|Periodical|program|موقع|publicação|publicació|rivista|tidning)([\r\n\t ]*=)/g,'$1work$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:год|år|año|anno|ano|année|[Vv]uosi|yıl|rok|година|Year)([\r\n\t ]*=)/g,'$1year$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)arşivengelli([\r\n\t ]*=)[ ]*evet/g,'$1dead-url$2no'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)day([\r\n\t ]*=[^\|{}]*)\|[ ]*month[\r\n\t ]*=([^\|{}]*)\|[ ]*year[\r\n\t ]*=/g, '$1date$2 $3 '); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)month[\r\n\t ]*=([^\|{}]*)\|[ ]*year[\r\n\t ]*=/g, '$1date=$2 '); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)year[\r\n\t ]*=([^\|{}]*)\|[ ]*month[\r\n\t ]*=([^{}\|]*)/g, '$1date=$3 $2'); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:януари|gennaio|enero|janvier|januari|[Oo]cak|студзень|يناير|janeiro)(?:[\s]+de|[\s]+do)[\s]*/gi, '$1January '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:февруари|febbraio|febrero|februari|février|[Şş]ubat|люты|فبراير|fevereiro)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1February '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:Март|marzo|mars|maart|[Mm]art|сакавік|março)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1March '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:април|aprile|abril|avril|красавік|أبريل|[Nn]isan)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1April '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:може|maggio|maio|mei|mayo|mai|май|مايو|[Mm]ayıs)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1May '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:юни|giugno|junio|juin|juni|xuño|[Hh]aziran|чэрвень|يونيو|junho)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1June '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:Юли|luglio|julio|juillet|juli|[Tt]emmuz|ліпень|يوليو|julho)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1July '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:Август|agosto|août|augustus|[Aa]ğustos|жніўня|أغسطس)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1August '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:Септември|settembre|septiembre|septembre|[Ee]ylül|верасня|سبتمبر|setembro)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1September '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:октомври|ottobre|octubre|octobre|oktober|[Ee]kim|кастрычнік|أكتوبر|outubro)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1October '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:ноември|novembre|noviembre|novembre|[Kk]asım|лістапад|نوفمبر|novembro)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1November '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|[\s]+do|)(?:декември|dicembre|diciembre|décembre|[Aa]ralık|снежня|ديسمبر|dezembro)(?:[\s]+de|[\s]+do|)[\s]*/gi, '$1December '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)january(?:[\s]+de|)[\s]*/g, '$1January '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)february(?:[\s]+de|)[\s]*/g, '$1February '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)march(?:[\s]+de|)[\s]*/g, '$1March '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)april(?:[\s]+de|)[\s]*/g, '$1April '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)may(?:[\s]+de|)[\s]*/g, '$1May '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)june(?:[\s]+de|)[\s]*/g, '$1June '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)july(?:[\s]+de|)[\s]*/g, '$1July '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)august(?:[\s]+de|)[\s]*/g, '$1August '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)september(?:[\s]+de|)[\s]*/g, '$1September '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)october(?:[\s]+de|)[\s]*/g, '$1October '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)november(?:[\s]+de|)[\s]*/g, '$1November '); myContent = myContent.replace(/(\{\{(?:[Ww]eb[_ ]*archive|[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*(?:archive[\-]*|publication[\-]*|access[\-]*|)date[\s]*=[\s]*[0-9]*[\s]*)(?:de[\s]+|)december(?:[\s]+de|)[\s]*/g, '$1December '); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)ref([\r\n\t ]*=[\r\n\t ]*)ISBN[ ]?/g, '$1isbn$2'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)sbn([\r\n\t ]*=[\r\n\t ]*)([A-Z][^{}\|]*[A-Z0-9])[ ]*(\}\}|\|)/g, '$1id$2SBN $3$4'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:dead\-url|deadurl)([\r\n\t ]*=[\r\n\t ]*)(?:n|no|hayır)[ ]*(\}\}|\|)/g, '$1url-status$2live$3'); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*)(?:dead\-url|deadurl)([\r\n\t ]*=[\r\n\t ]*)(?:y|yes|evet)[ ]*(\}\}|\|)/g, '$1url-status$2dead$3'); } // unroll citations now that we have finished processing myContent = myContent.replace(//g, '\n'); // fix languages myContent = myContent.replace(/([\t ]*)(?:español)/gi, '$1es'); myContent = myContent.replace(/([\t ]*)(?:inglese|inglés|İngilizce)/gi, '$1en'); myContent = myContent.replace(/([\t ]*)(?:tedesco)/g, '$1de'); myContent = myContent.replace(/([\t ]*)(?:olandese)/g, '$1nl'); myContent = myContent.replace(/([\t ]*)(?:swe|Svenska)([^a-z])/gi, '$1sv$2'); myContent = myContent.replace(//g, ''); myContent = myContent.replace(/(\{\{(?:[Cc]ite|[Cc]itation)(?:[^{}]|\{\{[^{}]*\}\})*\|[ ]*language[\r\n\t ]*=[\r\n\t ]*)(?:inglese|inglés|İngilizce)/gi, '$1en');

if(document.getElementById('wpTextbox1').value != myContent) { document.getElementById('wpTextbox1').value = myContent; document.getElementById('wpSummary').value = 'translating citations'; } document.getElementById('wpDiff').click; } // // });