பயனர்:Jayarathina/iwt: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
வரிசை 62:
This tool can be used to search and replace a list of frequently translated words. This can be useful if you often translate words specific to your domain like name of chemical elements or list of technical terms or as simple as month names.
====Instructions to add replace list====
'''If you know JavaScript:''' You have to create twoan associative arrays in [[Special:MyPage/common.js|your common.js page]] with namesname ''en_wordsrelpaceList'' such that its key/index is the replace string and its value is the string to be searched for. ''ta_wordsThe value can also be a regular expression object.''. TheseBy arraysdefault shouldfor containstring thevalue listwill ofbe wordscase toinsensitive searchreplace forwill andoccur. theirFor replacementcase-sensitive <u>'''''atreplace theuse sameregular Index'''''</u>expression object. For examples see below.<br /><br />
 
'''If you don't know JavaScript:''' Please follow the following steps:
* Place the following two lines asat the first two linestop of [[Special:MyPage/common.js|your common.js page]]:
<source lang="javascript">
var relpaceList = {
var en_words = new Array( "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
' ஜனவரி' : ' January',
var ta_words = new Array( "ஜனவரி", "பெப்ரவரி", "மார்ச்", "ஏப்ரல்", "மே", "ஜூன்", "ஜூலை", "ஆகஸ்ட்", "செப்டம்பர்", "அக்டோபர்", "நவம்பர்", "டிசம்பர்");
' பெப்ரவரி' : ' February',
' மார்ச்' : ' March',
' ஏப்ரல்' : ' April',
' மே' : ' May',
' ஜூன்' : ' June',
' ஜூலை' : ' July',
' ஆகஸ்ட்' : ' August',
' செப்டம்பர்' : ' September',
' அக்டோபர்' : ' October',
' நவம்பர்' : ' November',
' டிசம்பர்' : ' December'
};
</source>
* If you observe the above code, you can see itthat contains(excluding twothe linesfirst and eachlast line) haseach listline ofcontains two words in quotes separated by a colon. TheNote firstthat each line containsexcluding the wordslast tois beterminated searchedby fora andcomma. theirThe replacementfirst word is foundthe intamil replacement and the second lineword respectivelyis the one that is to be searched for. All you have to do is to prepare your own list of words and replace them here. ''Both lines can contain words in any language. I have used English to Tamil for example alone.''
** By default case insensitive replace will occur. The second word can be a regular expression and regular expression modifiers can be applied to make it case insensitive. That is instead of enclosing the words in a quote, enclose it in a slash and add a g (for global) at the end as shown. The full explanation of all available regular expression options will be out of scope for this documentation. See [http://www.regular-expressions.info/ regular-expressions.info] and you can test your regular espression at [http://www.regular-expressions.info/javascript.html regexpal.com:JavaScript RegExp Object]
**Make sure that the order of your English words are same as Tamil replacement words. That is the first word in the English list is replaced by the first word in the Tamil list and so on.
<source lang="javascript">
**You have to place your list between ''Array('' and '')'' also make sure that your words are surrounded by double quotes and separated by comma as shown.
var relpaceList = {
**If you feel it is too hard, please leave message in my [[பயனர்_பேச்சு:Jayarathina|talk page]], I will be glad to help you to form your list.
'ஜனவரி' : /January/g,
* Please make sure that your list of words do not contain special characters. If they are present, they should be properly escaped to be used inside a regular expression. More specifically all of these should be escaped: \ ^ $ * + ? . ( ) | { } [ ]
' பெப்ரவரி' : /February/g
};
</source>
 
**If you feel it is too hard, please leave message in my [[பயனர்_பேச்சு:Jayarathina|talk page]], I will be glad to help you to form your list.
* Please make sure that your list of words do not contain special characters. If they are present, they should be properly escaped to be used inside a regular expression. More specifically all of these should be escaped: \ ^ $ * + ? . ( ) | { } [ ]
 
I have tested with ana arraylist of 255 words without any performance degradation Windows 8.1 machine with Intel Core i3 Processor on Firefox and Chrome Browsers.
 
===Sort list of Tamil words===
"https://ta.wikipedia.org/wiki/பயனர்:Jayarathina/iwt" இலிருந்து மீள்விக்கப்பட்டது