проблем с превод от латиница на кирилица

C++ JAVA
Post Reply
Pro_Lamer4e
Нов
Нов
Posts: 188
Joined: Mon Oct 26, 2009 5:10 am

проблем с превод от латиница на кирилица

Post by Pro_Lamer4e » Tue Jun 12, 2018 12:51 pm

върнах се малко назад в времето кога на мода бяха тъй наречените торрент сайтове... в него има една java която превежда текста но е на руски. Как да го препработа за да е на български ето цялата java

Code: Select all

<script type="text/javascript" language="JavaScript">
	function RowsTextarea&#40;n, w&#41; &#123;
		var inrows = document.getElementById&#40;n&#41;;
		if &#40;w < 1&#41; &#123;
			var rows = -5;
		&#125; else &#123;
			var rows = +5;
		&#125;
		var outrows = inrows.rows + rows;
		if &#40;outrows >= 5 && outrows < 50&#41; &#123;
			inrows.rows = outrows;
		&#125;
		return false;
	&#125;

	var SelField = document.<?php echo $form;?>.<?php echo $name;?>;
	var TxtFeld = document.<?php echo $form;?>.<?php echo $name;?>;

	var clientPC = navigator.userAgent.toLowerCase&#40;&#41;; // Get client info
	var clientVer = parseInt&#40;navigator.appVersion&#41;; // Get browser version

	var is_ie = &#40;&#40;clientPC.indexOf&#40;"msie"&#41; != -1&#41; && &#40;clientPC.indexOf&#40;"opera"&#41; == -1&#41;&#41;;
	var is_nav = &#40;&#40;clientPC.indexOf&#40;'mozilla'&#41; != -1&#41; && &#40;clientPC.indexOf&#40;'spoofer'&#41; == -1&#41;
		&& &#40;clientPC.indexOf&#40;'compatible'&#41; == -1&#41; && &#40;clientPC.indexOf&#40;'opera'&#41; == -1&#41;
		&& &#40;clientPC.indexOf&#40;'webtv'&#41; == -1&#41; && &#40;clientPC.indexOf&#40;'hotjava'&#41; == -1&#41;&#41;;

	var is_moz = 0;

	var is_win = &#40;&#40;clientPC.indexOf&#40;"win"&#41; != -1&#41; || &#40;clientPC.indexOf&#40;"16bit"&#41; != -1&#41;&#41;;
	var is_mac = &#40;clientPC.indexOf&#40;"mac"&#41; != -1&#41;;

	function StoreCaret&#40;text&#41; &#123;
		if &#40;text.createTextRange&#41; &#123;
			text.caretPos = document.selection.createRange&#40;&#41;.duplicate&#40;&#41;;
		&#125;
	&#125;
	function FieldName&#40;text, which&#41; &#123;
		if &#40;text.createTextRange&#41; &#123;
			text.caretPos = document.selection.createRange&#40;&#41;.duplicate&#40;&#41;;
		&#125;
		if &#40;which != ""&#41; &#123;
			var Field = eval&#40;"document.<?php echo $form;?>." + which&#41;;
			SelField = Field;
			TxtFeld = Field;
		&#125;
	&#125;
	function AddSmile&#40;SmileCode&#41; &#123;
		var SmileCode;
		var newPost;
		var oldPost = SelField.value;
		newPost = oldPost + SmileCode;
		SelField.value = newPost;
		SelField.focus&#40;&#41;;
		return;
	&#125;
	function AddSelectedText&#40;Open, Close&#41; &#123;
		if &#40;SelField.createTextRange && SelField.caretPos && Close == '\n'&#41; &#123;
			var caretPos = SelField.caretPos;
			caretPos.text = caretPos.text.charAt&#40;caretPos.text.length - 1&#41; == ' ' ? Open + Close + ' ' &#58; Open + Close;
			SelField.focus&#40;&#41;;
		&#125; else if &#40;SelField.caretPos&#41; &#123;
			SelField.caretPos.text = Open + SelField.caretPos.text + Close;
		&#125; else &#123;
			SelField.value += Open + Close;
			SelField.focus&#40;&#41;;
		&#125;
	&#125;
	function InsertCode&#40;code, info, type, error&#41; &#123;
		if &#40;code == 'name'&#41; &#123;
			AddSelectedText&#40;'&#91;b&#93;' + info + '&#91;/b&#93;', '\n'&#41;;
		&#125; else if &#40;code == 'url' || code == 'mail'&#41; &#123;
			if &#40;code == 'url'&#41; var url = prompt&#40;info, 'http&#58;//'&#41;;
			if &#40;code == 'mail'&#41; var url = prompt&#40;info, ''&#41;;
			if &#40;!url&#41; return alert&#40;error&#41;;
			if &#40;&#40;clientVer >= 4&#41; && is_ie && is_win&#41; &#123;
				selection = document.selection.createRange&#40;&#41;.text;
				if &#40;!selection&#41; &#123;
					var title = prompt&#40;type, type&#41;;
					AddSelectedText&#40;'&#91;' + code + '=' + url + '&#93;' + title + '&#91;/' + code + '&#93;', '\n'&#41;;
				&#125; else &#123;
					AddSelectedText&#40;'&#91;' + code + '=' + url + '&#93;', '&#91;/' + code + '&#93;'&#41;;
				&#125;
			&#125; else &#123;
				mozWrap&#40;TxtFeld, '&#91;' + code + '=' + url + '&#93;', '&#91;/' + code + '&#93;'&#41;;
			&#125;
		&#125; else if &#40;code == 'color' || code == 'family' || code == 'size'&#41; &#123;
			if &#40;&#40;clientVer >= 4&#41; && is_ie && is_win&#41; &#123;
				AddSelectedText&#40;'&#91;' + code + '=' + info + '&#93;', '&#91;/' + code + '&#93;'&#41;;
			&#125; else if &#40;TxtFeld.selectionEnd && &#40;TxtFeld.selectionEnd - TxtFeld.selectionStart > 0&#41;&#41; &#123;
				mozWrap&#40;TxtFeld, '&#91;' + code + '=' + info + '&#93;', '&#91;/' + code + '&#93;'&#41;;
			&#125;
		&#125; else if &#40;code == 'li' || code == 'hr'&#41; &#123;
			if &#40;&#40;clientVer >= 4&#41; && is_ie && is_win&#41; &#123;
				AddSelectedText&#40;'&#91;' + code + '&#93;', ''&#41;;
			&#125; else &#123;
				mozWrap&#40;TxtFeld, '&#91;' + code + '&#93;', ''&#41;;
			&#125;
		&#125; else &#123;
			if &#40;&#40;clientVer >= 4&#41; && is_ie && is_win&#41; &#123;
				var selection = false;
				selection = document.selection.createRange&#40;&#41;.text;
				if &#40;selection && code == 'quote'&#41; &#123;
					AddSelectedText&#40;'&#91;' + code + '&#93;' + selection + '&#91;/' + code + '&#93;', '\n'&#41;;
				&#125; else &#123;
					AddSelectedText&#40;'&#91;' + code + '&#93;', '&#91;/' + code + '&#93;'&#41;;
				&#125;
			&#125; else &#123;
				mozWrap&#40;TxtFeld, '&#91;' + code + '&#93;', '&#91;/' + code + '&#93;'&#41;;
			&#125;
		&#125;
	&#125;

	function mozWrap&#40;txtarea, open, close&#41; &#123;
		var selLength = txtarea.textLength;
		var selStart = txtarea.selectionStart;
		var selEnd = txtarea.selectionEnd;
		if &#40;selEnd == 1 || selEnd == 2&#41;
			selEnd = selLength;

		var s1 = &#40;txtarea.value&#41;.substring&#40;0, selStart&#41;;
		var s2 = &#40;txtarea.value&#41;.substring&#40;selStart, selEnd&#41;
		var s3 = &#40;txtarea.value&#41;.substring&#40;selEnd, selLength&#41;;
		var sT = txtarea.scrollTop, sL = txtarea.scrollLeft;
		txtarea.value = s1 + open + s2 + close + s3;
		txtarea.focus&#40;&#41;;
		txtarea.scrollTop = sT;
		txtarea.scrollLeft = sL;
		return;
	&#125;

	language = 1;
	richtung = 1;
	var DOM = document.getElementById ? 1 &#58; 0,
		opera = window.opera && DOM ? 1 &#58; 0,
		IE = !opera && document.all ? 1 &#58; 0,
		NN6 = DOM && !IE && !opera ? 1 &#58; 0;
	var ablauf = new Date&#40;&#41;;
	var jahr = ablauf.getTime&#40;&#41; + &#40;365 * 24 * 60 * 60 * 1000&#41;;
	ablauf.setTime&#40;jahr&#41;;
	var richtung = 1;
	var isChat = false;
	NoHtml = true;
	NoScript = true;
	NoStyle = true;
	NoBBCode = true;
	NoBefehl = false;

	function setZustand&#40;&#41; &#123;
		transHtmlPause = false;
		transScriptPause = false;
		transStylePause = false;
		transBefehlPause = false;
		transBBPause = false;
	&#125;
	setZustand&#40;&#41;;
	function keks&#40;Name, Wert&#41; &#123;
		document.cookie = Name + "=" + Wert + "; expires=" + ablauf.toGMTString&#40;&#41;;
	&#125;
	function changeNoTranslit&#40;Nr&#41; &#123;
		if &#40;document.trans.No_translit_HTML.checked&#41;NoHtml = true; else &#123;
			NoHtml = false
		&#125;
		if &#40;document.trans.No_translit_BBCode.checked&#41;NoBBCode = true; else &#123;
			NoBBCode = false
		&#125;
		keks&#40;"NoHtml", NoHtml&#41;;
		keks&#40;"NoScript", NoScript&#41;;
		keks&#40;"NoStyle", NoStyle&#41;;
		keks&#40;"NoBBCode", NoBBCode&#41;;
	&#125;
	function changeRichtung&#40;r&#41; &#123;
		richtung = r;
		keks&#40;"TransRichtung", richtung&#41;;
		setFocus&#40;&#41;
	&#125;
	function changelanguage&#40;&#41; &#123;
		if &#40;language == 1&#41; &#123;
			language = 0;
		&#125;
		else &#123;
			language = 1;
		&#125;
		keks&#40;"autoTrans", language&#41;;
		setFocus&#40;&#41;;
		setZustand&#40;&#41;;
	&#125;
	function setFocus&#40;&#41; &#123;
		TxtFeld.focus&#40;&#41;;
	&#125;
	function repl&#40;t, a, b&#41; &#123;
		var w = t, i = 0, n = 0;
		while &#40;&#40;i = w.indexOf&#40;a, n&#41;&#41; >= 0&#41; &#123;
			t = t.substring&#40;0, i&#41; + b + t.substring&#40;i + a.length, t.length&#41;;
			w = w.substring&#40;0, i&#41; + b + w.substring&#40;i + a.length, w.length&#41;;
			n = i + b.length;
			if &#40;n >= w.length&#41; &#123;
				break;
			&#125;
		&#125;
		return t;
	&#125;
	var rus_lr2 = &#40;'Е-е-О-о-Ж-Ж-Ч-Ч-Ш-Ш-Щ-Щ-Ъ-Ь-Ю-Ю-Я-Я-Я-Я-ж-ч-ш-щ-ю-я-я'&#41;.split&#40;'-'&#41;;
	var lat_lr2 = &#40;'/E-/e-/O-/o-ЫO-Ыo-ЙO-Йo-ЗH-Зh-ЦH-Цh-СH-Сh-ШH-Шh-ъ' + String.fromCharCode&#40;35&#41; + '-ь' + String.fromCharCode&#40;39&#41; + '-ЙE-Йe-ЙU-Йu-ЙA-Йa-ЫA-Ыa-ыo-йo-зh-цh-сh-шh-йe-йu-йa-ыa'&#41;.split&#40;'-'&#41;;
	var rus_lr1 = &#40;'А-Б-В-Г-Д-Е-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Х-Ц-Щ-Я-а-б-в-г-д-е-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-х-ц-щ-ъ-ь-я'&#41;.split&#40;'-'&#41;;
	var lat_lr1 = &#40;'A-B-V-G-D-E-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-X-C-W-Y-Q-a-b-v-g-d-e-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-x-c-w-' + String.fromCharCode&#40;35&#41; + '-y-' + String.fromCharCode&#40;39&#41; + '-q'&#41;.split&#40;'-'&#41;;
	var rus_rl = &#40;'А-Б-В-Г-Д-Е-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ь-Ю-Я-а-б-в-г-д-е-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ь-ю-я'&#41;.split&#40;'-'&#41;;
	var lat_rl = &#40;'A-B-V-G-D-E-JO-ZH-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-C-CH-SH-SHH' + String.fromCharCode&#40;35&#41; + String.fromCharCode&#40;35&#41; + '-Y-' + String.fromCharCode&#40;39&#41; + String.fromCharCode&#40;39&#41; + '-JE-JU-JA-a-b-v-g-d-e-jo-zh-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-c-ch-sh-shh' + String.fromCharCode&#40;35&#41; + '-y-' + String.fromCharCode&#40;39&#41; + '-je-ju-ja'&#41;.split&#40;'-'&#41;;
	var transAN = true;
	function transliteText&#40;txt&#41; &#123;
		vorTxt = txt.length > 1 ? txt.substr&#40;txt.length - 2, 1&#41; &#58; "";
		buchstabe = txt.substr&#40;txt.length - 1, 1&#41;;
		txt = txt.substr&#40;0, txt.length - 2&#41;;
		return txt + translitBuchstabeCyr&#40;vorTxt, buchstabe&#41;;
	&#125;
	function translitBuchstabeCyr&#40;vorTxt, txt&#41; &#123;
		var zweiBuchstaben = vorTxt + txt;
		var code = txt.charCodeAt&#40;0&#41;;

		if &#40;txt == "<"&#41;transHtmlPause = true; else if &#40;txt == ">"&#41;transHtmlPause = false;
		if &#40;txt == "<script"&#41;transScriptPause = true; else if &#40;txt == "<" + "/script>"&#41;transScriptPause = false;
		if &#40;txt == "<style"&#41;transStylePause = true; else if &#40;txt == "<" + "/style>"&#41;transStylePause = false;
		if &#40;txt == "&#91;"&#41;transBBPause = true; else if &#40;txt == "&#93;"&#41;transBBPause = false;
		if &#40;txt == "/"&#41;transBefehlPause = true; else if &#40;txt == " "&#41;transBefehlPause = false;

		if &#40;
			&#40;transHtmlPause == true && NoHtml == true&#41; ||
				&#40;transScriptPause == true && NoScript == true&#41; ||
				&#40;transStylePause == true && NoStyle == true&#41; ||
				&#40;transBBPause == true && NoBBCode == true&#41; ||
				&#40;transBefehlPause == true && NoBefehl == true&#41; || !&#40;&#40;&#40;code >= 65&#41; && &#40;code <= 123&#41;&#41; || &#40;code == 35&#41; || &#40;code == 39&#41;&#41;&#41; return zweiBuchstaben;

		for &#40;x = 0; x < lat_lr2.length; x++&#41; &#123;
			if &#40;lat_lr2&#91;x&#93; == zweiBuchstaben&#41; return rus_lr2&#91;x&#93;;
		&#125;
		for &#40;x = 0; x < lat_lr1.length; x++&#41; &#123;
			if &#40;lat_lr1&#91;x&#93; == txt&#41; return vorTxt + rus_lr1&#91;x&#93;;
		&#125;
		return zweiBuchstaben;
	&#125;
	function translitBuchstabeLat&#40;buchstabe&#41; &#123;
		for &#40;x = 0; x < rus_rl.length; x++&#41; &#123;
			if &#40;rus_rl&#91;x&#93; == buchstabe&#41;
				return lat_rl&#91;x&#93;;
		&#125;
		return buchstabe;
	&#125;
	function translateAlltoLatin&#40;&#41; &#123;
		if &#40;!IE&#41; &#123;
			var txt = TxtFeld.value;
			var txtnew = "";
			var symb = "";
			for &#40;y = 0; y < txt.length; y++&#41; &#123;
				symb = translitBuchstabeLat&#40;txt.substr&#40;y, 1&#41;&#41;;
				txtnew += symb;
			&#125;
			TxtFeld.value = txtnew;
			setFocus&#40;&#41;
		&#125; else &#123;
			var is_selection_flag = 1;
			var userselection = document.selection.createRange&#40;&#41;;
			var txt = userselection.text;

			if &#40;userselection == null || userselection.text == null || userselection.parentElement == null || userselection.parentElement&#40;&#41;.type != "textarea"&#41; &#123;
				is_selection_flag = 0;
				txt = TxtFeld.value;
			&#125;
			txtnew = "";
			var symb = "";
			for &#40;y = 0; y < txt.length; y++&#41; &#123;
				symb = translitBuchstabeLat&#40;txt.substr&#40;y, 1&#41;&#41;;
				txtnew += symb;
			&#125;
			if &#40;is_selection_flag&#41; &#123;
				userselection.text = txtnew;
				userselection.collapse&#40;&#41;;
				userselection.select&#40;&#41;;
			&#125; else &#123;
				TxtFeld.value = txtnew;
				setFocus&#40;&#41;
			&#125;
		&#125;
		return;
	&#125;
	function TransliteFeld&#40;object, evnt&#41; &#123;
		if &#40;language == 1 || opera&#41; return;
		if &#40;NN6&#41; &#123;
			var code = void 0;
			var code = evnt.charCode;
			var textareafontsize = 14;
			var textreafontwidth = 7;
			if &#40;code == 13&#41; &#123;
				return;
			&#125;
			if &#40;code && &#40;!&#40;evnt.ctrlKey || evnt.altKey&#41;&#41;&#41; &#123;
				pXpix = object.scrollTop;
				pYpix = object.scrollLeft;
				evnt.preventDefault&#40;&#41;;
				txt = String.fromCharCode&#40;code&#41;;
				pretxt = object.value.substring&#40;0, object.selectionStart&#41;;
				result = transliteText&#40;pretxt + txt&#41;;
				object.value = result + object.value.substring&#40;object.selectionEnd&#41;;
				object.setSelectionRange&#40;result.length, result.length&#41;;
				object.scrollTop = 100000;
				object.scrollLeft = 0;

				cXpix = &#40;result.split&#40;"\n"&#41;.length&#41; * &#40;textareafontsize + 3&#41;;
				cYpix = &#40;result.length - result.lastIndexOf&#40;"\n"&#41; - 1&#41; * &#40;textreafontwidth + 1&#41;;
				taXpix = &#40;object.rows + 1&#41; * &#40;textareafontsize + 3&#41;;
				taYpix = object.clientWidth;

				if &#40;&#40;cXpix > pXpix&#41; && &#40;cXpix < &#40;pXpix + taXpix&#41;&#41;&#41; object.scrollTop = pXpix;
				if &#40;cXpix <= pXpix&#41; object.scrollTop = cXpix - &#40;textareafontsize + 3&#41;;
				if &#40;cXpix >= &#40;pXpix + taXpix&#41;&#41; object.scrollTop = cXpix - taXpix;

				if &#40;&#40;cYpix >= pYpix&#41; && &#40;cYpix < &#40;pYpix + taYpix&#41;&#41;&#41; object.scrollLeft = pYpix;
				if &#40;cYpix < pYpix&#41; object.scrollLeft = cYpix - &#40;textreafontwidth + 1&#41;;
				if &#40;cYpix >= &#40;pYpix + taYpix&#41;&#41; object.scrollLeft = cYpix - taYpix + 1;
			&#125;
			return true;
		&#125; else if &#40;IE&#41; &#123;
			if &#40;isChat&#41; &#123;
				var code = frames&#91;'input'&#93;.event.keyCode;
				if &#40;code == 13&#41; &#123;
					return;
				&#125;
				txt = String.fromCharCode&#40;code&#41;;
				cursor_pos_selection = frames&#91;'input'&#93;.document.selection.createRange&#40;&#41;;
				cursor_pos_selection.text = "";
				cursor_pos_selection.moveStart&#40;"character", -1&#41;;
				vorTxt = cursor_pos_selection.text;
				if &#40;vorTxt.length > 1&#41; &#123;
					vorTxt = "";
				&#125;
				frames&#91;'input'&#93;.event.keyCode = 0;
				if &#40;richtung == 2&#41; &#123;
					result = vorTxt + translitBuchstabeLat&#40;txt&#41;
				&#125; else &#123;
					result = translitBuchstabeCyr&#40;vorTxt, txt&#41;
				&#125;
				if &#40;vorTxt != ""&#41; &#123;
					cursor_pos_selection.select&#40;&#41;;
					cursor_pos_selection.collapse&#40;&#41;;
				&#125;
				with &#40;frames&#91;'input'&#93;.document.selection.createRange&#40;&#41;&#41; &#123;
					text = result;
					collapse&#40;&#41;;
					select&#40;&#41;
				&#125;
			&#125; else &#123;
				var code = event.keyCode;
				if &#40;code == 13&#41; &#123;
					return;
				&#125;
				txt = String.fromCharCode&#40;code&#41;;
				cursor_pos_selection = document.selection.createRange&#40;&#41;;
				cursor_pos_selection.text = "";
				cursor_pos_selection.moveStart&#40;"character", -1&#41;;
				vorTxt = cursor_pos_selection.text;
				if &#40;vorTxt.length > 1&#41; &#123;
					vorTxt = "";
				&#125;
				event.keyCode = 0;
				if &#40;richtung == 2&#41; &#123;
					result = vorTxt + translitBuchstabeLat&#40;txt&#41;
				&#125; else &#123;
					result = translitBuchstabeCyr&#40;vorTxt, txt&#41;
				&#125;
				if &#40;vorTxt != ""&#41; &#123;
					cursor_pos_selection.select&#40;&#41;;
					cursor_pos_selection.collapse&#40;&#41;;
				&#125;
				with &#40;document.selection.createRange&#40;&#41;&#41; &#123;
					text = result;
					collapse&#40;&#41;;
					select&#40;&#41;
				&#125;
			&#125;
			return;
		&#125;
	&#125;
	function translateAlltoCyrillic&#40;&#41; &#123;
		if &#40;!IE&#41; &#123;
			txt = TxtFeld.value;
			var txtnew = translitBuchstabeCyr&#40;"", txt.substr&#40;0, 1&#41;&#41;;
			var symb = "";
			for &#40;kk = 1; kk < txt.length; kk++&#41; &#123;
				symb = translitBuchstabeCyr&#40;txtnew.substr&#40;txtnew.length - 1, 1&#41;, txt.substr&#40;kk, 1&#41;&#41;;
				txtnew = txtnew.substr&#40;0, txtnew.length - 1&#41; + symb;
			&#125;
			TxtFeld.value = txtnew;
			setFocus&#40;&#41;
		&#125; else &#123;
			var is_selection_flag = 1;
			var userselection = document.selection.createRange&#40;&#41;;
			var txt = userselection.text;
			if &#40;userselection == null || userselection.text == null || userselection.parentElement == null || userselection.parentElement&#40;&#41;.type != "textarea"&#41; &#123;
				is_selection_flag = 0;
				txt = TxtFeld.value;
			&#125;
			var txtnew = translitBuchstabeCyr&#40;"", txt.substr&#40;0, 1&#41;&#41;;
			var symb = "";
			for &#40;kk = 1; kk < txt.length; kk++&#41; &#123;
				symb = translitBuchstabeCyr&#40;txtnew.substr&#40;txtnew.length - 1, 1&#41;, txt.substr&#40;kk, 1&#41;&#41;;
				txtnew = txtnew.substr&#40;0, txtnew.length - 1&#41; + symb;
			&#125;
			if &#40;is_selection_flag&#41; &#123;
				userselection.text = txtnew;
				userselection.collapse&#40;&#41;;
				userselection.select&#40;&#41;;
			&#125; else &#123;
				TxtFeld.value = txtnew;
				setFocus&#40;&#41;
			&#125;
		&#125;
		return;
	&#125;
	</script>
най много ме интересува тази част

Code: Select all

var rus_lr2 = &#40;'Е-е-О-о-Ж-Ж-Ч-Ч-Ш-Ш-Щ-Щ-Ъ-Ь-Ю-Ю-Я-Я-Я-Я-ж-ч-ш-щ-ю-я-я'&#41;.split&#40;'-'&#41;;
	var lat_lr2 = &#40;'/E-/e-/O-/o-ЫO-Ыo-ЙO-Йo-ЗH-Зh-ЦH-Цh-СH-Сh-ШH-Шh-ъ' + String.fromCharCode&#40;35&#41; + '-ь' + String.fromCharCode&#40;39&#41; + '-ЙE-Йe-ЙU-Йu-ЙA-Йa-ЫA-Ыa-ыo-йo-зh-цh-сh-шh-йe-йu-йa-ыa'&#41;.split&#40;'-'&#41;;
	var rus_lr1 = &#40;'А-Б-В-Г-Д-Е-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Х-Ц-Щ-Я-а-б-в-г-д-е-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-х-ц-щ-ъ-ь-я'&#41;.split&#40;'-'&#41;;
	var lat_lr1 = &#40;'A-B-V-G-D-E-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-X-C-W-Y-Q-a-b-v-g-d-e-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-x-c-w-' + String.fromCharCode&#40;35&#41; + '-y-' + String.fromCharCode&#40;39&#41; + '-q'&#41;.split&#40;'-'&#41;;
	var rus_rl = &#40;'А-Б-В-Г-Д-Е-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ь-Ю-Я-а-б-в-г-д-е-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ь-ю-я'&#41;.split&#40;'-'&#41;;
	var lat_rl = &#40;'A-B-V-G-D-E-JO-ZH-Z-I-J-K-L-M-N-O-P-R-S-T-U-F-H-C-CH-SH-SHH' + String.fromCharCode&#40;35&#41; + String.fromCharCode&#40;35&#41; + '-Y-' + String.fromCharCode&#40;39&#41; + String.fromCharCode&#40;39&#41; + '-JE-JU-JA-a-b-v-g-d-e-jo-zh-z-i-j-k-l-m-n-o-p-r-s-t-u-f-h-c-ch-sh-shh' + String.fromCharCode&#40;35&#41; + '-y-' + String.fromCharCode&#40;39&#41; + '-je-ju-ja'&#41;.split&#40;'-'&#41;;
	var transAN = true;
	function transliteText&#40;txt&#41; &#123;
		vorTxt = txt.length > 1 ? txt.substr&#40;txt.length - 2, 1&#41; &#58; "";
		buchstabe = txt.substr&#40;txt.length - 1, 1&#41;;
		txt = txt.substr&#40;0, txt.length - 2&#41;;
		return txt + translitBuchstabeCyr&#40;vorTxt, buchstabe&#41;;
	&#125;

Fakeheal
Гуру
Гуру
Posts: 2703
Joined: Sat Apr 17, 2010 6:37 am
Answers: 351
Location: /r/eyebleach
Contact:

Post by Fakeheal » Tue Jun 12, 2018 4:48 pm

Като човек, който е играл и PUBG и League of legends. Това е по-cancer от двете комбинирани заедно.

User avatar
Revelation
Web-tourist
Web-tourist
Posts: 861
Joined: Sun Mar 24, 2013 1:23 pm
Answers: 62

Post by Revelation » Tue Jun 12, 2018 9:13 pm

1. Това е JavaScript, който няма нищо общо с Java.
2. В този код няма нищо руско. Идеята е да конвертира латиница на кирилица.

User avatar
anonimen
Web-tourist
Web-tourist
Posts: 1562
Joined: Mon Jun 11, 2012 6:07 pm
Answers: 163
Location: Parse error: unexpected "}" in /home/index.php on line 26

Post by anonimen » Tue Jun 12, 2018 9:30 pm

Абе, хора, изрових тука от домашната библиотека един прашен речник. Само че е английско-руски; как да го оправя да е за български?

&#8209;&#8209;&#8209;&#8209;&#8209;&#8209;&#8209;&#8209;
Най-лесно [каквото изглежда е целта в случая] ще ти е да заместиш руското Ы с български еквивалент.. дори не виждам обърнатото Е.

Post Reply