பயனர்:Mdmahir/lang-names-to-tamil.js

கட்டற்ற பன்மொழி அகரமுதலியான விக்சனரியில் இருந்து.

குறிப்பு - சேமித்த பின்னர், நீங்கள் செய்த மாற்றங்களைக் காண்பதற்கு உங்கள் உலவியின் இடைமாற்று அகற்றப்பட வேண்டும்.

  • மொஸில்லா பயர்பாக்ஸ் / சபாரி: Shift+Reload, அல்லது Ctrl-F5 அல்லது Ctrl-R (⌘-R Mac ல்)
  • கூகிள் குரோம் Ctrl-Shift-R அழுத்தவும். (⌘-Shift-R Mac ல்) ;
  • இண்டர்நெட் எக்ஸ்ப்ளோரர்: Ctrl-Refresh அல்லது Ctrl-F5 ஐ அழுத்தவும்.
  • ஒபேரா: Tools → Preferences இல் இடைமாற்றை அகற்றவும்;
// ஆங்கில விக்சனரியிலிருந்து சொற்களில் உள்ள <nowiki>{{trans-top}} to {{trans-bottom}} க்குள் உள்ள மொழி பெயர்களை தமிழிற்கு மாற்ற இந்த கருவி உபயோகமாயிருக்கும்.</nowiki> 
//இந்த கருவியை விக்கியில் செயல்படுத்த மேலும் மேம்படுத்த வேண்டி உள்ளது. அதேசமயம் தற்போது நீங்கள் கீழுள்ள நிரலை வெட்டி // ஒரு notepad ல் ஒட்டி html (unicode or utf-8 encoding) ஆக சேமித்து உபயோகிக்கலாம்.

//Jquery UI can be removed if it is already imported.
mw.loader.load("http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js");


jQuery.noConflict();

// உங்களது கருத்துக்களை உரையாடல் பக்கத்தில் தெரிவிக்கவும்.

function Convert(){

arr=[
["Latin","இலத்தின்"],
["Danish","டானிஷ்"],
["Mandarin Chinese","மந்தரிய சீனம்"],
["Spanish","எசுப்பானியம்"],
["English","ஆங்கிலம்"],
["Urdu","உருது"],
["Hindi","இந்தி"],
["Arabic","அரபி"],
["Bengali","வங்காளம்"],
["Portuguese","போர்த்துகீசியம்"],
["Russian","உருசியம்"],
["Japanese","எப்பானியம்"],
["German","செருமானியம்"],
["Javanese","யாவானியம்"],
["Punjabi","பஞ்சாபி"],
["Wu","வூ சீனம்"],
["French","பிரான்சியம்"],
["Telugu","தெலுங்கு"],
["Vietnamese","வியத்நாமியம்"],
["Marathi","மராத்தி"],
["Korean","கொரியம்"],
["Tamil","தமிழ்"],
["Italian","இத்தாலியம்"],
["Turkish","துருக்கியம்"],
["Cantonese","சீனம்"],
["Tagalog","தகலாகியம்"],
["Gujarati","குசராத்தி"],
["Min","சீனம்"],
["Maithili","மைத்திலியம்"],
["Polish","போலாந்தியம்"],
["Ukranian","உக்கிரேனியம்"],
["Malay","மலாய்"],
["Bojpuri","போசுபுரியம்"],
["Xiang","சியாங் சீனம்"],
["Malayalam","மலையாளம்"],
["Kannada","கன்னடம்"],
["Sunda","சுண்டம்"],
["Burmese","பர்மியம் (பர்மீயம்)"],
["Oriya","ஒரியா"],
["Persian","பெர்சியம் பாரசீகம்"],
["Hakka","அக்க சீனம்"],
["Hausa","அவுசம்"],
["Romanian","உரோமானியம்"],
["Indonesian","இந்தோனேசியம்"],
["Azerbaijani","அசர்பைசானியம்"],
["Dutch","நெதர்லாந்தியம்"],
["Gan","கான் சீனம்"],
["Thai","தாய்லாந்தியம்"],
["Yoruba","யொரூபம்"],
["Sindhi","சிந்தியம்"],
["Pashto","பாசுதியம்"],
["Uzbek","உசுபெக்கியம்"],
["Igbo","ஈபோ"],
["Saraiki","சரைக்கியம்"],
["Amharic","அம்காரிக்கியம்"],
["Nepali","நேப்பாளியம்"],
["Serbo-Croatian","செர்போ குரோயேசியம்"],
["Kurdish","குருதியம்"],
["Cebuano","செபுவானியம்"],
["Assamese","அசாமியம்"],
["Malagasy","மலகாசியம்"],
["Hungarian","உங்காரியம்"],
["Zhuang","சுவாங் சீனம்"],
["Madurese","மதுரையம்"],
["Singalese","சிங்களம்"],
["Greek","கிரேக்கம்"],
["Fula","பூலம்"],
["Czeck","செக்கியம்"],
["Shona","சோனம்"],
["Oromo","ஒரோமம்"],
["Somali","சோமாலியம்"],
["Zulu","சூளு"],
["Quechua","கெச்சுவம்"],
["Kazak","காசாக்கியம்"],
["Tibetan","திபெத்தியம்"],
["Haitian Creole","எயித்தி கிரயோலம்"],
["Belarusian","பெலரூசியம்"],
["Swedish","சுவீதியம்"],
["Bulgarian","புல்காரியம்"],
["Khmer","கிமேரியம்"],
["Xhosa","கோசம்"],
["Balochi","பலோசியம்"],
["Afrikaans","ஆப்பிரிக்கானியம்"],
["Hebrew","எபிரேயம்"],
["Catalan","எசுப்பானியம்"],
["Turkmen","துருக்குமேனியம்"],
["Kongo","கோங்கோ"],
["Tajik","தசீக்கியம்"],
["Santali","சாந்தாலியம்"],
["Albanian","அல்பானியம்"],
["Armenian","அருமேனியம்"],
["Mongolian","மங்கோலியம்"],
["Danish","தேனியம்"],
["Tatar","தாத்தாரியம்"],
["Slovak","சுலோவாக்கியம்"],
["Swahili","சுவாகிலி"],
["Romani","உரோமானியம்"],
["Norwegian","நொர்வேசியம்"],
["Tibetan","திபெத்தியம்"],
["Kashmiri","கசுமீரியம்"],
["Konkani","கொங்கணி"],
["Balinese","பாலினேசியம்"],
["Yiddish","இதீசியம்"],
["Lithuanian","இலுத்துவானியம்"],
["Gondi","கோந்தியம்"],
["Lingala","இலிங்காளம்"],
["Latvian","இலாத்வியம்"],
["Basque","பாசுகியம்"],
["Naga","நாகம்"],
["Welsh","வெல்சியம்"],
["Maltese","மால்தேசியம்"],
["Corsican","கோர்சிகியம்"],
["Samoan","சமோவம்"],
["Irish","அயர்லாந்தியம்"],
["Icelandic","அய்சுலாந்தியம்"],
["Maori","மவோரியம்"],
["Tahitian","தகீத்தியம்"],
["Tongan","தோங்கியம்"],
["Sanskrit","சமசுகிருதம்"],
["Esperanto","எசுபெராந்தம்"]


]
other_var=[["''n''","''பெயர்ச்சொல்''"],
['plural','பன்மை']]
txt=document.getElementById('in').value

for(i=0;i<arr.length;i++){
txt=txt.replaceAll(arr[i][1],"[["+arr[i][1]+"]]");
txt=txt.replaceAll(arr[i][0],"[["+arr[i][1]+"]]");

txt=txt.replace("[[[[","[[");
txt=txt.replace("]]]]","]]");
txt=txt.replace("#[["+arr[i][1]+"]]","#"+arr[i][1]);
}
for(i=0;i<other_var.length;i++){
txt=txt.replaceAll(other_var[i][0], other_var[i][1]);

}
document.getElementById('out').value=txt;
}

String.prototype.replaceAll = function (replaceThis, withThis) {
   var re = new RegExp(RegExp.quote(replaceThis),"gi"); 
   return this.replace(re, withThis);
};


RegExp.quote = function(str) {
     return str.replace(/([.?*+^$[\]\\(){}-])/gi, "\\$1");
};

function RedlinkRemoval(){

$preview=jQuery('#previewbox').text();
if($preview=='PREVIEW HERE'){
alert("Click preview button first!");
return false;
}
var $redlinks=[];

jQuery('.new').each(function(){
$redlinks.push(jQuery(this).text());
});
temp=jQuery('#out').val();
jQuery.each($redlinks,function(){
temp=temp.replace('[['+ this +']]',this);
});
jQuery('#out').val(temp);
}

$htm ="This page helps u to convert English to tamil for language names (English will print ஆங்கிலம்)";
$htm +="<br\/><br\/>Input (English):<br />";
$htm +="<textarea id='in' name='in' cols=80 rows=6><\/textarea>";
$htm +="<br\/><input type='button' onclick='Convert\(\)' value='Convert to Tamil'>";
$htm +="<br\/>Output in Tamil : (<a href='javascript:void(0)' onclick='RedlinkRemoval()' style='color:#0645AD'>Click here to remove red link </a>)<br\/>";
$htm +="<textarea id='out' name='out' cols=80 rows=6><\/textarea>";
$htm +="<input type='button' id='temp_preview' value='Step 2: Preview the generated code' onclick='tempPreview()' />";
//$htm +="<input type='checkbox' id='red_link' onclick='RedlinkRemoval()'>Remove Red link & update the output<br />";
$htm +="Step 3:Copy & Paste the above wiki text into the wiktionary page.<div id='previewbox' style='display:none'>PREVIEW HERE</div>";

jQuery(document).ready(function(){
$dialog= jQuery('<div></div>')
.html($htm)
.dialog({autoOpen: false,
title: 'Translation tool',
height:500,
width:600,
maxHeight:400,
modal:true});
if(jQuery('#wpTextbox1').is(':visible')){
jQuery("<a href='javascript:void(0)' onclick='openHelper()' >Translation Helper</a>").insertBefore(jQuery('#wpTextbox1'));
}
else{
jQuery("<a href='javascript:void(0)' onclick='openHelper()' >Translation Helper</a>").insertBefore(jQuery('#wikEdInputWrapper'));
}
});

function tempPreview(){
TempOut=jQuery('#out').val();
if(TempOut!=''){
//path="?format=json&action=parse&text="+TempOut;
jQuery('#previewbox').show();
url='http://ta.wiktionary.org/w/api.php';
jQuery.post(url, { "format": "json","action":"parse","text":TempOut },
   function(data){
var parseddata=data.parse.text.*;
jQuery("#previewbox").html(parseddata);                      
   
   }, "json");
}//tempPreview
}

function openHelper(){
$dialog.dialog('open');
}
"https://ta.wiktionary.org/w/index.php?title=பயனர்:Mdmahir/lang-names-to-tamil.js&oldid=1904267" இலிருந்து மீள்விக்கப்பட்டது