#include <Array.au3>
Opt('MustDeclareVars', 1)
Global $aRU_EN = StringSplit('All|Aleks|Boris|Fedor|farm|Sindy|Sophie|Zoom|Yashied|Stop|Автомобиль|Борис|Бабушкин|Федор|Семь|яблоко|зверь|шип|щит|чум|цепь', '|')
_ArrayDisplay($aRU_EN, 'До')
_Sort_1D_Array_Ru_En($aRU_EN, 0, 1, 3)
_ArrayDisplay($aRU_EN, 'После')
Func _Sort_1D_Array_Ru_En(ByRef $a_Array, $i_Descending = 0, $i_Start = 0, $i_CountFirstLetters = 1)
Local $i_Ub, $s_Tmp
If UBound($a_Array, 0) <> 1 Then Return 0
Switch $i_CountFirstLetters
Case 1 To 3
Case Else
$i_CountFirstLetters = 1
EndSwitch
$i_Ub = UBound($a_Array)
Local $a_Tmp[$i_Ub][2]
For $i = 0 To $i_Ub - 1
$a_Tmp[$i][0] = $a_Array[$i]
For $j = 1 To $i_CountFirstLetters
$s_Tmp = StringMid($a_Array[$i], $j, 1)
If Not $s_Tmp Then ExitLoop
__Replace_Letter_Ru_To_En($s_Tmp)
$a_Tmp[$i][1] &= $s_Tmp
Next
Next
_ArraySort($a_Tmp, $i_Descending, $i_Start, 0, 1)
For $i = 0 To $i_Ub - 1
$a_Array[$i] = $a_Tmp[$i][0]
Next
Return 1
EndFunc ;==>_Sort_1D_Array_Ru_En
Func __Replace_Letter_Ru_To_En(ByRef $s_Letter)
Local Const $s_Ru = 'АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ', $a_En[34] = [33, 'A', 'B', 'V', 'G', 'D', 'E', 'YO', 'ZH', 'Z', 'I', 'Y', 'K', 'L', 'M', _
'N', 'O', 'P', 'R', 'S', 'T', 'U', 'F', 'KH', 'TC', 'CH', 'SH', 'SHC', '''', 'Y', '''', 'E''', 'YU', 'YA']
Local $i_Ind = StringInStr($s_Ru, $s_Letter)
If $i_Ind Then $s_Letter = $a_En[$i_Ind]
EndFunc ;==>__Replace_Letter_Ru_To_En