Cyr to Lat enhanced - Version 3.3.1

Version Description

  • Added Georgian transliteration table
  • A problem with some letters causing apostrophes in slugs was resolved
Download this release

Release Info

Developer karevn
Plugin Icon wp plugin Cyr to Lat enhanced
Version 3.3.1
Comparing to
See all releases

Code changes from version 3.3 to 3.3.1

Files changed (2) hide show
  1. cyr-to-lat.php +14 -5
  2. readme.txt +8 -4
cyr-to-lat.php CHANGED
@@ -2,10 +2,10 @@
2
  /*
3
  Plugin Name: Cyr to Lat enhanced
4
  Plugin URI: http://wordpress.org/extend/plugins/cyr3lat/
5
- Description: Converts Cyrillic characters in post, term slugs and media file names to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
6
- Author: Sol, Sergey Biryukov, Nikolay Karev
7
  Author URI: http://karevn.com/
8
- Version: 3.3
9
  */
10
 
11
  function ctl_sanitize_title($title) {
@@ -30,7 +30,16 @@ function ctl_sanitize_title($title) {
30
  'у' => 'u', 'ў' => 'u`', 'ф' => 'f', 'х' => 'h', 'ц' => 'ts',
31
  'ч' => 'ch', 'џ' => 'dh', 'ш' => 'sh', 'щ' => 'shh', 'ъ' => '``',
32
  'ы' => 'y`', 'ь' => '`', 'э' => 'e`', 'ю' => 'yu', 'я' => 'ya'
33
- );
 
 
 
 
 
 
 
 
 
34
 
35
  $locale = get_locale();
36
  switch ( $locale ) {
@@ -58,7 +67,7 @@ function ctl_sanitize_title($title) {
58
  $term = $is_term ? $wpdb->get_var("SELECT slug FROM {$wpdb->terms} WHERE name = '$title'") : '';
59
  if ( empty($term) ) {
60
  $title = strtr($title, apply_filters('ctl_table', $iso9_table));
61
- $title = preg_replace("/[^A-Za-z0-9`'_\-\.]/", '-', $title);
62
  $title = preg_replace('/\-+/', '-', $title);
63
  $title = preg_replace('/^-+/', '', $title);
64
  $title = preg_replace('/-+$/', '', $title);
2
  /*
3
  Plugin Name: Cyr to Lat enhanced
4
  Plugin URI: http://wordpress.org/extend/plugins/cyr3lat/
5
+ Description: Converts Cyrillic and Georgian characters in post, term slugs and media file names to Latin characters. Useful for creating human-readable URLs. Based on the original plugin by Anton Skorobogatov.
6
+ Author: Sol, Sergey Biryukov, Nikolay Karev, Dmitri Gogelia
7
  Author URI: http://karevn.com/
8
+ Version: 3.3.1
9
  */
10
 
11
  function ctl_sanitize_title($title) {
30
  'у' => 'u', 'ў' => 'u`', 'ф' => 'f', 'х' => 'h', 'ц' => 'ts',
31
  'ч' => 'ch', 'џ' => 'dh', 'ш' => 'sh', 'щ' => 'shh', 'ъ' => '``',
32
  'ы' => 'y`', 'ь' => '`', 'э' => 'e`', 'ю' => 'yu', 'я' => 'ya'
33
+ );
34
+ $geo2lat = array(
35
+ 'ა' => 'a', 'ბ' => 'b', 'გ' => 'g', 'დ' => 'd', 'ე' => 'e', 'ვ' => 'v',
36
+ 'ზ' => 'z', 'თ' => 'th', 'ი' => 'i', 'კ' => 'k', 'ლ' => 'l', 'მ' => 'm',
37
+ 'ნ' => 'n', 'ო' => 'o', 'პ' => 'p','ჟ' => 'zh','რ' => 'r','ს' => 's',
38
+ 'ტ' => 't','უ' => 'u','ფ' => 'ph','ქ' => 'q','ღ' => 'gh','ყ' => 'qh',
39
+ 'შ' => 'sh','ჩ' => 'ch','ც' => 'ts','ძ' => 'dz','წ' => 'ts','ჭ' => 'tch',
40
+ 'ხ' => 'kh','ჯ' => 'j','ჰ' => 'h'
41
+ );
42
+ $iso9_table = array_merge($iso9_table, $geo2lat);
43
 
44
  $locale = get_locale();
45
  switch ( $locale ) {
67
  $term = $is_term ? $wpdb->get_var("SELECT slug FROM {$wpdb->terms} WHERE name = '$title'") : '';
68
  if ( empty($term) ) {
69
  $title = strtr($title, apply_filters('ctl_table', $iso9_table));
70
+ $title = preg_replace("/[^A-Za-z0-9'_\-\.]/", '-', $title);
71
  $title = preg_replace('/\-+/', '-', $title);
72
  $title = preg_replace('/^-+/', '', $title);
73
  $title = preg_replace('/-+$/', '', $title);
readme.txt CHANGED
@@ -1,15 +1,15 @@
1
  === Cyr to Lat enhanced ===
2
  Contributors: Atrax, SergeyBiryukov, karevn
3
- Tags: cyrillic, latin, l10n, russian, rustolat, slugs, translations, transliteration, media
4
  Requires at least: 2.3
5
  Tested up to: 3.2
6
- Stable tag: 3.3
7
 
8
- Converts Cyrillic characters in post, page and term slugs to Latin characters.
9
 
10
  == Description ==
11
 
12
- Converts Cyrillic characters in post, page and term slugs to Latin characters. Useful for creating human-readable URLs.
13
 
14
  This plugin is a fork of [cyr2lat](http://wordpress.org/extend/plugins/cyr2lat/) plugin.
15
 
@@ -43,6 +43,10 @@ add_filter('ctl_table', 'my_cyr_to_lat_table');
43
 
44
  == Changelog ==
45
 
 
 
 
 
46
  = 3.3 =
47
 
48
  = 3.2 =
1
  === Cyr to Lat enhanced ===
2
  Contributors: Atrax, SergeyBiryukov, karevn
3
+ Tags: cyrillic, latin, l10n, russian, rustolat, slugs, translations, transliteration, media, georgian
4
  Requires at least: 2.3
5
  Tested up to: 3.2
6
+ Stable tag: 3.3.1
7
 
8
+ Converts Cyrillic and Georgian characters in post, page and term slugs to Latin characters.
9
 
10
  == Description ==
11
 
12
+ Converts Cyrillic and Georgian characters in post, page and term slugs to Latin characters. Useful for creating human-readable URLs.
13
 
14
  This plugin is a fork of [cyr2lat](http://wordpress.org/extend/plugins/cyr2lat/) plugin.
15
 
43
 
44
  == Changelog ==
45
 
46
+ = 3.3.1 =
47
+ * Added Georgian transliteration table
48
+ * A problem with some letters causing apostrophes in slugs was resolved
49
+
50
  = 3.3 =
51
 
52
  = 3.2 =