Version Description
- Added regional trensliterations
Download this release
Release Info
Developer | YurchenkoEV |
Plugin | WP Translitera |
Version | 160306 |
Comparing to | |
See all releases |
Code changes from version 160128 to 160306
- readme.txt +4 -1
- wp-translitera.php +35 -14
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://yur4enko.com/
|
|
4 |
Tags: translate, rus-to-lat, Seo, tag, record, page
|
5 |
Requires at least: 2.9.0
|
6 |
Tested up to: 4.5
|
7 |
-
Stable tag:
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -24,6 +24,9 @@ Automatical from repository or unzip in plugins and activate in ACP.
|
|
24 |
|
25 |
== Changel
|
26 |
|
|
|
|
|
|
|
27 |
= 160128 =
|
28 |
* Added media files name transliterations
|
29 |
* Remove info.txt
|
4 |
Tags: translate, rus-to-lat, Seo, tag, record, page
|
5 |
Requires at least: 2.9.0
|
6 |
Tested up to: 4.5
|
7 |
+
Stable tag: 160306
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
24 |
|
25 |
== Changel
|
26 |
|
27 |
+
= 160306 =
|
28 |
+
* Added regional trensliterations
|
29 |
+
|
30 |
= 160128 =
|
31 |
* Added media files name transliterations
|
32 |
* Remove info.txt
|
wp-translitera.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: WP Translitera
|
4 |
Plugin URI: http://yur4enko.com/category/moi-proekty/wp-translitera
|
5 |
Description: Plug-in for transliteration permanent permalink records , pages, and tag
|
6 |
-
Version:
|
7 |
Author: Evgen Yurchenko
|
8 |
Text Domain: wp_translitera
|
9 |
Domain Path: /languages/
|
@@ -28,21 +28,42 @@ Author URI: http://yur4enko.com/
|
|
28 |
*/
|
29 |
|
30 |
class wp_translitera {//php 5.2.4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
//Процедура преобразования символов
|
32 |
public static function transliterate($title) {//wp=>0.0.0 php=>5.2.4
|
33 |
-
$
|
34 |
-
'А'=>'A','а'=>'a','Б'=>'B','б'=>'b','В'=>'V','в'=>'v','Г'=>'G',
|
35 |
-
'г'=>'g','Д'=>'D','д'=>'d','Е'=>'E','е'=>'e','Ё'=>'Jo','ё'=>'jo',
|
36 |
-
'Ж'=>'Zh','ж'=>'zh','З'=>'Z','з'=>'z','И'=>'I','и'=>'i','Й'=>'J',
|
37 |
-
'й'=>'j','К'=>'K','к'=>'k','Л'=>'L','л'=>'l','М'=>'M','м'=>'m',
|
38 |
-
'Н'=>'N','н'=>'n','О'=>'O','о'=>'o','П'=>'P','п'=>'p','Р'=>'R',
|
39 |
-
'р'=>'r','С'=>'S','с'=>'s','Т'=>'T','т'=>'t','У'=>'U','у'=>'u',
|
40 |
-
'Ф'=>'F','ф'=>'f','Х'=>'H','х'=>'h','Ц'=>'C','ц'=>'c','Ч'=>'Ch',
|
41 |
-
'ч'=>'ch','Ш'=>'Sh','ш'=>'sh','Щ'=>'Shh','щ'=>'shh','Ъ'=>'',
|
42 |
-
'ъ'=>'','Ы'=>'Y','ы'=>'y','Ь'=>'','ь'=>'','Э'=>'Je','э'=>'je',
|
43 |
-
'Ю'=>'Ju','ю'=>'ju','Я'=>'Ja','я'=>'ja'
|
44 |
-
);
|
45 |
-
return strtr($title, $to);
|
46 |
}
|
47 |
|
48 |
//Добавляем раздел в админку
|
3 |
Plugin Name: WP Translitera
|
4 |
Plugin URI: http://yur4enko.com/category/moi-proekty/wp-translitera
|
5 |
Description: Plug-in for transliteration permanent permalink records , pages, and tag
|
6 |
+
Version: 160306
|
7 |
Author: Evgen Yurchenko
|
8 |
Text Domain: wp_translitera
|
9 |
Domain Path: /languages/
|
28 |
*/
|
29 |
|
30 |
class wp_translitera {//php 5.2.4
|
31 |
+
|
32 |
+
protected static function createlocale() {//wp=>1.5.0 php=>5.2.4
|
33 |
+
$loc = get_locale();
|
34 |
+
if ($loc = 'ru_RU') {//Русская локализация
|
35 |
+
$ret = array(
|
36 |
+
'А'=>'A','а'=>'a','Б'=>'B','б'=>'b','В'=>'V','в'=>'v','Г'=>'G',
|
37 |
+
'г'=>'g','Д'=>'D','д'=>'d','Е'=>'E','е'=>'e','Ё'=>'Jo','ё'=>'jo',
|
38 |
+
'Ж'=>'Zh','ж'=>'zh','З'=>'Z','з'=>'z','И'=>'I','и'=>'i','Й'=>'J',
|
39 |
+
'й'=>'j','К'=>'K','к'=>'k','Л'=>'L','л'=>'l','М'=>'M','м'=>'m',
|
40 |
+
'Н'=>'N','н'=>'n','О'=>'O','о'=>'o','П'=>'P','п'=>'p','Р'=>'R',
|
41 |
+
'р'=>'r','С'=>'S','с'=>'s','Т'=>'T','т'=>'t','У'=>'U','у'=>'u',
|
42 |
+
'Ф'=>'F','ф'=>'f','Х'=>'H','х'=>'h','Ц'=>'C','ц'=>'c','Ч'=>'Ch',
|
43 |
+
'ч'=>'ch','Ш'=>'Sh','ш'=>'sh','Щ'=>'Shh','щ'=>'shh','Ъ'=>'',
|
44 |
+
'ъ'=>'','Ы'=>'Y','ы'=>'y','Ь'=>'','ь'=>'','Э'=>'Je','э'=>'je',
|
45 |
+
'Ю'=>'Ju','ю'=>'ju','Я'=>'Ja','я'=>'ja'
|
46 |
+
);
|
47 |
+
} else {//Глобальная локализация
|
48 |
+
$ret = array(
|
49 |
+
'А'=>'A','а'=>'a','Б'=>'B','б'=>'b','В'=>'V','в'=>'v','Г'=>'G',
|
50 |
+
'г'=>'g','Д'=>'D','д'=>'d','Е'=>'E','е'=>'e','Ё'=>'Jo','ё'=>'jo',
|
51 |
+
'Ж'=>'Zh','ж'=>'zh','З'=>'Z','з'=>'z','И'=>'I','и'=>'i','Й'=>'J',
|
52 |
+
'й'=>'j','К'=>'K','к'=>'k','Л'=>'L','л'=>'l','М'=>'M','м'=>'m',
|
53 |
+
'Н'=>'N','н'=>'n','О'=>'O','о'=>'o','П'=>'P','п'=>'p','Р'=>'R',
|
54 |
+
'р'=>'r','С'=>'S','с'=>'s','Т'=>'T','т'=>'t','У'=>'U','у'=>'u',
|
55 |
+
'Ф'=>'F','ф'=>'f','Х'=>'H','х'=>'h','Ц'=>'C','ц'=>'c','Ч'=>'Ch',
|
56 |
+
'ч'=>'ch','Ш'=>'Sh','ш'=>'sh','Щ'=>'Shh','щ'=>'shh','Ъ'=>'',
|
57 |
+
'ъ'=>'','Ы'=>'Y','ы'=>'y','Ь'=>'','ь'=>'','Э'=>'Je','э'=>'je',
|
58 |
+
'Ю'=>'Ju','ю'=>'ju','Я'=>'Ja','я'=>'ja'
|
59 |
+
);
|
60 |
+
}
|
61 |
+
return $ret;
|
62 |
+
}
|
63 |
+
|
64 |
//Процедура преобразования символов
|
65 |
public static function transliterate($title) {//wp=>0.0.0 php=>5.2.4
|
66 |
+
return strtr($title, wp_translitera::createlocale());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
//Добавляем раздел в админку
|