-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFixLanguageType.min.js
11 lines (11 loc) · 1.08 KB
/
FixLanguageType.min.js
1
2
3
4
5
6
7
8
9
10
11
/**
*
* @Name : FixLanguageType.js
* @Version : 1.1
* @Programmer : Max
* @Date : 2018-06-26-2018-07-02
* @Released under : https://github.com/BaseMax/FixLanguageTypeJs/blob/master/LICENSE
* @Repository : https://github.com/BaseMax/FixLanguageTypeJs
*
**/
!function(n,e){"use strict";var t=[["q","ض"],["w","ص"],["e","ث"],["r","ق"],["t","ف"],["y","غ"],["u","ع"],["i","ه"],["o","خ"],["p","ح"],["[","ج"],["]","چ"],["a","ش"],["s","س"],["d","ی"],["m","ئ"],["f","ب"],["g","ل"],["h","ا"],["j","ت"],["k","ن"],["l","م"],[";","ک"],['"',"گ"],["z","ظ"],["x","ط"],["c","ز"],["C","ژ"],["v","ر"],["b","ذ"],["n","د"],["\\","پ"],["`","پ"],[",","و"]],o=function(n,e,t,o){return n.replace(new RegExp(e.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g,"\\$&"),o?"gi":"g"),"string"==typeof t?t.replace(/\$/g,"$$$$"):t)};n.fixtype={en_fa:function(n){for(var e=0;e<t.length;e++)console.log(t[e]),n=o(n,t[e][0],t[e][1]);return n},fa_en:function(n){for(var e=0;e<t.length;e++)console.log(t[e]),n=o(n,t[e][1],t[e][0]);return n}},n.addEventListener("load",function(){},!1)}(window,document);