Qtranslate Slug - Version 1.1.11

Version Description

= 1.0 = Major version, the plugin has been rewritten. Better performance, and some enhancements.

= 0.9 = This version fix some bugs and allow multilanguage in nav-menus.

= 0.8 = A lot of slugs content allowed

= 0.7 = This version allows TLD domain option for a different Qtranslate fork maded by Zappo

Download this release

Release Info

Developer pedroghandi
Plugin Icon wp plugin Qtranslate Slug
Version 1.1.11
Comparing to
See all releases

Code changes from version 1.1.10 to 1.1.11

assets/js/qts-nav-menu-min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(t){function e(){regexp=new RegExp("&lt;!--:"+u+"--&gt;(.*?)&lt;!--:--&gt;","i"),t(".item-title").each(function(){void 0==t(this).data("qt-value")&&t(this).data("qt-value",t(this).html()),(matches=t(this).data("qt-value").match(regexp))&&(t(this).html(matches[1]),t(this).closest("li").find(".link-to-original a").text(matches[1]))}),regexp=new RegExp("<!--:"+u+"-->(.*?)<!--:-->","i"),t("input.edit-menu-item-title").each(function(){void 0==t(this).data("qt-value")&&t(this).data("qt-value",t(this).val()),(matches=t(this).data("qt-value").match(regexp))&&t(this).val(matches[1])}),t("label.menu-item-title").each(function(){var e=t(this).contents().get(1);void 0==t(this).data("qt-value")&&t(this).data("qt-value",e.nodeValue),(matches=t(this).data("qt-value").match(regexp))&&(e.nodeValue=" "+matches[1])})}function a(){t("input.edit-menu-item-title").each(function(){t(this).val(t(this).data("qt-value"))})}var i=wpNavMenu.addMenuItemToBottom;wpNavMenu.addMenuItemToBottom=function(t,a){i(t,a),e()};var n=wpNavMenu.addMenuItemToTop;wpNavMenu.addMenuItemToTop=function(t,a){n(t,a),e()};var u=t("#qt-languages :radio:checked").val();e(),t(document).ajaxComplete(function(){u=t("#qt-languages :radio:checked").val(),e()}),t("#qt-languages :radio").change(function(){u=t("#qt-languages :radio:checked").val(),e()}),t(".submit-add-to-menu").click(function(){u=t("#qt-languages :radio:checked").val(),e()}),t(document.body).on("change","input.edit-menu-item-title",null,function(){regexp=new RegExp("(<!--:"+u+"-->)(.*?)(<!--:-->)","i"),regexp.test(t(this).data("qt-value"))?t(this).data("qt-value",t(this).data("qt-value").replace(regexp,"$1"+t(this).val()+"$3")):t(this).data("qt-value",t(this).val())}),t(".menu-save").click(function(){a()}),window.onbeforeunload=function(){a()}});
1
+ jQuery(document).ready(function(t){function i(){t(".item-title").each(function(){n[t(this).closest("li").attr("id")]=[],n[t(this).closest("li").attr("id")].Title=t(this).find("span").html(),"undefined"==typeof n[t(this).closest("li").attr("id")].Original&&(n[t(this).closest("li").attr("id")].Original=n[t(this).closest("li").attr("id")].Title)}),t(".menu-item").each(function(){this_label=t(this).find("input.edit-menu-item-title"),this_title=t(this).find("input.edit-menu-item-attr-title"),n[t(this).attr("id")][this_label.attr("id")]=this_label.val(),n[t(this).attr("id")][this_title.attr("id")]=this_title.val()})}function e(){regexp=new RegExp("<!--:"+d+"-->(.*?)<!--:-->","i"),t(".item-title").each(function(){(matches=n[t(this).closest("li").attr("id")].Original.match(regexp))&&t(this).closest("li").find(".link-to-original a").text(matches[1])}),regexp2=new RegExp("<!--:"+d+"-->(.*?)<!--:-->","i"),t(".menu-item").each(function(){this_label=t(this).find("input.edit-menu-item-title"),this_title=t(this).find("input.edit-menu-item-attr-title"),"all"===d?(this_label.val(n[t(this).attr("id")][this_label.attr("id")]),this_title.val(n[t(this).attr("id")][this_title.attr("id")])):((matches=n[t(this).attr("id")][this_label.attr("id")].match(regexp2))&&this_label.val(matches[1]),(matches2=n[t(this).attr("id")][this_title.attr("id")].match(regexp2))&&this_title.val(matches2[1]))})}function a(){t(".menu-item").each(function(){this_label=t(this).find("input.edit-menu-item-title"),this_title=t(this).find("input.edit-menu-item-attr-title"),this_label.val(n[t(this).attr("id")][this_label.attr("id")]),this_title.val(n[t(this).attr("id")][this_title.attr("id")]),t(this).find(".link-to-original a").text(n[t(this).closest("li").attr("id")].Original)})}var n=[],s=wpNavMenu.addMenuItemToBottom;wpNavMenu.addMenuItemToBottom=function(t,a){s(t,a),i(),e()};var l=wpNavMenu.addMenuItemToTop;wpNavMenu.addMenuItemToTop=function(t,a){l(t,a),i(),e()};var d=t("#qt-languages :radio:checked").val();i(),e(),t(document).ajaxComplete(function(){d=t("#qt-languages :radio:checked").val(),e()}),t("#qt-languages :radio").change(function(){d=t("#qt-languages :radio:checked").val(),e()}),t(".submit-add-to-menu").click(function(){d=t("#qt-languages :radio:checked").val(),e()}),t(document.body).on("change","input.edit-menu-item-title",null,function(){regexp=new RegExp("<!--:"+d+"-->(.*?)<!--:-->","i");var i=n[t(this).closest("li").attr("id")][t(this).attr("id")],e=t(this).val();regexp.test(i)&&(n[t(this).closest("li").attr("id")][t(this).attr("id")]=i.replace(regexp,"<!--:"+d+"-->"+e+"<!--:-->"))}),t(document.body).on("change","input.edit-menu-item-attr-title",null,function(){regexp=new RegExp("<!--:"+d+"-->(.*?)<!--:-->","i");var i=n[t(this).closest("li").attr("id")][t(this).attr("id")],e=t(this).val();qts_new_string="<!--:"+d+"-->"+e+"<!--:-->","undefined"==typeof i||""==i?(n[t(this).closest("li").attr("id")][t(this).attr("id")]=qts_new_string,t(this).val(qts_new_string)):regexp.test(i)?n[t(this).closest("li").attr("id")][t(this).attr("id")]=i.replace(regexp,qts_new_string):(t(this).val(i+qts_new_string),n[t(this).closest("li").attr("id")][t(this).attr("id")]=i+qts_new_string)}),t(".menu-save").click(function(){a()}),window.onbeforeunload=function(){a()}});
assets/js/qts-nav-menu.js CHANGED
@@ -1,35 +1,39 @@
1
  jQuery(document).ready(function($){
2
-
3
  // Change titles (and values) when user add new item to the menu:
4
  var oldAddMenuItemToBottom = wpNavMenu.addMenuItemToBottom;
5
  wpNavMenu.addMenuItemToBottom = function( menuMarkup, req ) {
6
  oldAddMenuItemToBottom( menuMarkup, req );
 
7
  changeTitles();
8
  };
9
  var oldAddMenuItemToTop = wpNavMenu.addMenuItemToTop;
10
  wpNavMenu.addMenuItemToTop = function( menuMarkup, req ) {
11
  oldAddMenuItemToTop( menuMarkup, req );
 
12
  changeTitles();
13
  };
14
 
15
  // Change titles (and values) when document is ready:
16
  var lang = $('#qt-languages :radio:checked').val();
 
17
  changeTitles();
18
 
19
- /**
20
- * Change titles when there is a click on pagination
21
- * on show all pages tab.
22
- *
23
- * It happens when there are a large number of pages.
24
- */
25
- $( document ).ajaxComplete(function() {
26
- lang = $('#qt-languages :radio:checked').val();
27
- changeTitles();
28
- });
29
 
30
  // Change titles (and values) when language is changed:
31
  $('#qt-languages :radio').change( function() {
32
  lang = $('#qt-languages :radio:checked').val();
 
33
  changeTitles();
34
  });
35
 
@@ -41,49 +45,112 @@ jQuery(document).ready(function($){
41
 
42
  // Update original value when user changed a value:
43
  $(document.body).on('change', 'input.edit-menu-item-title', null, function() {
44
- regexp = new RegExp('(<!--:' + lang + '-->)(.*?)(<!--:-->)', 'i');
45
- if( regexp.test( $(this).data( 'qt-value' ) ) )
46
- $(this).data( 'qt-value', $(this).data('qt-value').replace( regexp, '$1' + $(this).val() + '$3' ) );
47
- else
48
- $(this).data( 'qt-value', $(this).val() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  });
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  // Change titles (and values):
52
  function changeTitles() {
53
  // Change menu item titles and links (on the right side):
54
- regexp = new RegExp('&lt;!--:' + lang + '--&gt;(.*?)&lt;!--:--&gt;', 'i');
 
55
  $('.item-title').each( function() {
56
- if ($(this).data('qt-value') == undefined) $(this).data('qt-value', $(this).html());
57
- if (matches = $(this).data('qt-value').match(regexp)) {
58
- $(this).html( matches[1] );
59
- $(this).closest('li').find('.link-to-original a').text( matches[1] );
60
- }
61
  });
62
-
63
- // Change menu item title inputs (on the right side):
64
- regexp = new RegExp('<!--:' + lang + '-->(.*?)<!--:-->', 'i');
65
- $('input.edit-menu-item-title').each( function() {
66
- if ($(this).data('qt-value') == undefined) $(this).data('qt-value', $(this).val());
67
- if (matches = $(this).data('qt-value').match(regexp)) {
68
- $(this).val( matches[1] );
 
 
 
 
 
 
 
 
 
 
69
  }
70
  });
71
 
72
  // Change menu item checkbox labels (on the left side):
73
- $('label.menu-item-title').each( function() {
 
74
  var textNode = $(this).contents().get(1);
75
- if ($(this).data('qt-value') == undefined) $(this).data('qt-value', textNode.nodeValue);
76
- if (matches = $(this).data('qt-value').match(regexp)) {
77
- textNode.nodeValue = ' ' + matches[1];
78
- }
79
- });
80
  }
81
 
82
  // Restore the original input values:
83
  function restoreValues(){
84
- $('input.edit-menu-item-title').each( function() {
85
- $(this).val( $(this).data( 'qt-value') );
86
- });
 
 
 
 
 
 
 
87
  }
88
 
89
  // Just before saving restore the original input values:
1
  jQuery(document).ready(function($){
2
+ var qts_menuitemlang = [];
3
  // Change titles (and values) when user add new item to the menu:
4
  var oldAddMenuItemToBottom = wpNavMenu.addMenuItemToBottom;
5
  wpNavMenu.addMenuItemToBottom = function( menuMarkup, req ) {
6
  oldAddMenuItemToBottom( menuMarkup, req );
7
+ saveLang();
8
  changeTitles();
9
  };
10
  var oldAddMenuItemToTop = wpNavMenu.addMenuItemToTop;
11
  wpNavMenu.addMenuItemToTop = function( menuMarkup, req ) {
12
  oldAddMenuItemToTop( menuMarkup, req );
13
+ saveLang();
14
  changeTitles();
15
  };
16
 
17
  // Change titles (and values) when document is ready:
18
  var lang = $('#qt-languages :radio:checked').val();
19
+ saveLang();
20
  changeTitles();
21
 
22
+ /**
23
+ * Change titles when there is a click on pagination
24
+ * on show all pages tab.
25
+ *
26
+ * It happens when there are a large number of pages.
27
+ */
28
+ $( document ).ajaxComplete(function() {
29
+ lang = $('#qt-languages :radio:checked').val();
30
+ changeTitles();
31
+ });
32
 
33
  // Change titles (and values) when language is changed:
34
  $('#qt-languages :radio').change( function() {
35
  lang = $('#qt-languages :radio:checked').val();
36
+
37
  changeTitles();
38
  });
39
 
45
 
46
  // Update original value when user changed a value:
47
  $(document.body).on('change', 'input.edit-menu-item-title', null, function() {
48
+ regexp = new RegExp('<!--:' + lang + '-->(.*?)<!--:-->', 'i');
49
+
50
+
51
+ var qts_old_value = qts_menuitemlang[ $(this).closest("li").attr("id") ][ $(this).attr("id")],
52
+ qts_new_value = $(this).val();
53
+
54
+ if( regexp.test(qts_old_value ) ) {
55
+ qts_menuitemlang[ $(this).closest("li").attr("id") ][ $(this).attr("id")] = qts_old_value.replace( regexp,'<!--:' + lang + '-->' + qts_new_value + '<!--:-->');
56
+ }
57
+
58
+ });
59
+
60
+
61
+
62
+
63
+ // Update original title="" value when user changed a value:
64
+ $(document.body).on('change', 'input.edit-menu-item-attr-title', null, function() {
65
+ regexp = new RegExp('<!--:' + lang + '-->(.*?)<!--:-->', 'i');
66
+ var qts_old_value = qts_menuitemlang[ $(this).closest("li").attr("id") ][ $(this).attr("id")],
67
+ qts_new_value = $(this).val();
68
+ qts_new_string = '<!--:' + lang + '-->'+ qts_new_value + '<!--:-->';
69
+ if(typeof qts_old_value === "undefined" || qts_old_value == "" ) {
70
+ qts_menuitemlang[ $(this).closest("li").attr("id") ][ $(this).attr("id")] = qts_new_string;
71
+ $(this).val( qts_new_string );
72
+ } else if( regexp.test(qts_old_value ) ) {
73
+ qts_menuitemlang[ $(this).closest("li").attr("id") ][ $(this).attr("id")] = qts_old_value.replace( regexp,qts_new_string);
74
+ } else {
75
+ $(this).val( qts_old_value + qts_new_string );
76
+ qts_menuitemlang[ $(this).closest("li").attr("id") ][ $(this).attr("id")] = qts_old_value + qts_new_string;
77
+ }
78
+
79
  });
80
 
81
+
82
+
83
+ // Change titles (and values):
84
+ function saveLang() {
85
+ $('.item-title').each( function() {
86
+ qts_menuitemlang[ $(this).closest("li").attr("id") ] = [];
87
+ qts_menuitemlang[ $(this).closest("li").attr("id") ]['Title'] = $(this).find("span").html();
88
+
89
+ if( typeof qts_menuitemlang[ $(this).closest("li").attr("id") ]['Original'] === "undefined" ) {
90
+ qts_menuitemlang[ $(this).closest("li").attr("id") ]['Original'] = qts_menuitemlang[ $(this).closest("li").attr("id") ]['Title'];
91
+ }
92
+ });
93
+ $('.menu-item').each( function() {
94
+
95
+ this_label = $(this).find('input.edit-menu-item-title');
96
+ this_title = $(this).find('input.edit-menu-item-attr-title');
97
+
98
+ qts_menuitemlang[ $(this).attr("id") ][this_label.attr("id") ] = this_label.val();
99
+ qts_menuitemlang[ $(this).attr("id") ][this_title.attr("id") ] = this_title.val();
100
+
101
+ });
102
+
103
+ }
104
  // Change titles (and values):
105
  function changeTitles() {
106
  // Change menu item titles and links (on the right side):
107
+ // TODO: review, and dump
108
+ regexp = new RegExp('<!--:' + lang + '-->(.*?)<!--:-->', 'i');
109
  $('.item-title').each( function() {
110
+ if (matches = qts_menuitemlang[ $(this).closest("li").attr("id") ]['Original'].match(regexp)) {
111
+ $(this).closest('li').find('.link-to-original a').text( matches[1] );
112
+ }
113
+
 
114
  });
115
+ // Change menu item title inputs (on the right side): Navigation Label, Title Attribute...
116
+ regexp2 = new RegExp('<!--:' + lang + '-->(.*?)<!--:-->', 'i');
117
+ $('.menu-item').each( function() {
118
+ this_label = $(this).find('input.edit-menu-item-title');
119
+ this_title = $(this).find('input.edit-menu-item-attr-title');
120
+ if( lang === "all") {
121
+ this_label.val(qts_menuitemlang[ $(this).attr("id") ][this_label.attr("id") ] );
122
+ this_title.val(qts_menuitemlang[ $(this).attr("id") ][this_title.attr("id") ] );
123
+ } else {
124
+
125
+ if (matches = qts_menuitemlang[ $(this).attr("id") ][this_label.attr("id") ].match(regexp2)) {
126
+ this_label.val( matches[1] );
127
+ }
128
+
129
+ if (matches2 = qts_menuitemlang[ $(this).attr("id") ][this_title.attr("id") ].match(regexp2)) {
130
+ this_title.val( matches2[1] );
131
+ }
132
  }
133
  });
134
 
135
  // Change menu item checkbox labels (on the left side):
136
+ // TODO: fix this, not a show stopper
137
+ /*$('label.menu-item-title').each( function() {
138
  var textNode = $(this).contents().get(1);
139
+ });*/
 
 
 
 
140
  }
141
 
142
  // Restore the original input values:
143
  function restoreValues(){
144
+
145
+ $('.menu-item').each( function() {
146
+
147
+ this_label = $(this).find('input.edit-menu-item-title');
148
+ this_title = $(this).find('input.edit-menu-item-attr-title');
149
+
150
+ this_label.val( qts_menuitemlang[ $(this).attr("id") ][this_label.attr("id") ] );
151
+ this_title.val( qts_menuitemlang[ $(this).attr("id") ][this_title.attr("id") ] );
152
+ $(this).find('.link-to-original a').text( qts_menuitemlang[ $(this).closest("li").attr("id") ]['Original']);
153
+ });
154
  }
155
 
156
  // Just before saving restore the original input values:
includes/class-qtranslate-slug-widget.php CHANGED
@@ -8,7 +8,7 @@
8
  class QtranslateSlugWidget extends WP_Widget {
9
 
10
  function QtranslateSlugWidget() {
11
- $widget_ops = array('classname' => 'qts_widget', 'description' => __('Allows your visitors to choose a Language.','qtranslate') );
12
  $this->WP_Widget('qtranslateslug', __('Language selector', 'qts'), $widget_ops);
13
  }
14
 
8
  class QtranslateSlugWidget extends WP_Widget {
9
 
10
  function QtranslateSlugWidget() {
11
+ $widget_ops = array('classname' => 'qts_widget', 'description' => __('Allows your visitors to choose a Language.','qts') );
12
  $this->WP_Widget('qtranslateslug', __('Language selector', 'qts'), $widget_ops);
13
  }
14
 
includes/class-qtranslate-slug.php CHANGED
@@ -49,7 +49,29 @@ class QtranslateSlug {
49
  * @since 1.0
50
  */
51
  private $lang = false;
 
 
 
 
 
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
 
55
  /**
@@ -73,7 +95,16 @@ class QtranslateSlug {
73
  private $current_url = array();
74
 
75
 
76
-
 
 
 
 
 
 
 
 
 
77
  /**
78
  * return the current / temp language
79
  *
@@ -84,7 +115,33 @@ class QtranslateSlug {
84
 
85
  return ($this->lang) ? $this->lang : $q_config['language'];
86
  }
87
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
 
89
 
90
  /**
@@ -96,7 +153,17 @@ class QtranslateSlug {
96
  $this->set_options();
97
  return $this->options;
98
  }
99
-
 
 
 
 
 
 
 
 
 
 
100
 
101
 
102
  /**
@@ -119,7 +186,36 @@ class QtranslateSlug {
119
  }
120
  }
121
 
122
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  /**
125
  * setter: options | permalink_structure
@@ -170,10 +266,16 @@ class QtranslateSlug {
170
 
171
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
172
 
173
- return ( version_compare($wp_version, "3.3", "<" ) || (!is_plugin_active('qtranslate/qtranslate.php') && !is_plugin_active('mqtranslate/mqtranslate.php')) );
 
 
 
 
 
174
  }
175
 
176
 
 
177
 
178
  /**
179
  * check if exists qtranslate and do the installation, support multisite
@@ -381,7 +483,7 @@ class QtranslateSlug {
381
  */
382
  function init() {
383
 
384
- load_plugin_textdomain( 'qts', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
385
 
386
  // checking plugin activate
387
  if ( self::block_activate() ) {
@@ -394,9 +496,18 @@ class QtranslateSlug {
394
  // caching qts options
395
  $this->set_options();
396
 
 
 
 
 
 
 
 
 
397
  if ( is_admin() ) {
398
 
399
  $this->check_old_versions();
 
400
 
401
  // add filters
402
  add_filter( 'qts_validate_post_slug', array(&$this, 'validate_post_slug'), 0, 3 );
@@ -440,15 +551,15 @@ class QtranslateSlug {
440
 
441
  // remove from qtranslate the discouraged meta http-equiv, inline styles
442
  // (including flag URLs) and wrong hreflang links
443
- remove_action('wp_head','qtrans_header');
444
  // add proper hreflang links
445
  add_action('wp_head',array(&$this, 'qtranslate_slug_header_extended'));
446
 
447
  // remove some Qtranslate filters
448
- remove_filter( 'page_link', 'qtrans_convertURL' );
449
- remove_filter( 'post_link', 'qtrans_convertURL' );
450
- remove_filter( 'category_link', 'qtrans_convertURL' );
451
- remove_filter( 'tag_link', 'qtrans_convertURL' );
452
 
453
  add_filter( 'qts_permastruct' , array(&$this, 'get_extra_permastruct'), 0, 2);
454
  add_filter( 'qts_url_args', array(&$this, 'parse_url_args'), 0, 1);
@@ -458,13 +569,26 @@ class QtranslateSlug {
458
  add_filter( '_get_page_link', array(&$this, '_get_page_link'), 0, 2 );
459
  add_filter( 'term_link', array(&$this, 'term_link'), 600, 3 );
460
 
461
- add_filter( 'single_term_title', 'qtrans_useTermLib', 805 );
462
  add_filter( 'get_blogs_of_user', array(&$this, 'blog_names'), 1 );
463
  add_action( 'widgets_init', array(&$this, 'widget_init'), 100 );
464
  // Add specific CSS class to body class based on current lang
465
  add_filter('body_class', array($this, 'qts_body_class'), 600, 1 );
466
- }
467
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
 
469
  /**
470
  * Adds proper links to the content with available translations.
@@ -476,13 +600,12 @@ class QtranslateSlug {
476
  * @since 1.1.8
477
  */
478
  public function qtranslate_slug_header_extended(){
479
- global $qtranslate_slug;
480
- global $q_config;
481
- if(is_404()) return;
482
-
483
- foreach($q_config['enabled_languages'] as $language) {
484
- if($language != $q_config['language'] )
485
- echo '<link hreflang="'.$language.'" href="'.$qtranslate_slug->get_current_url($language).'" rel="alternate" />'."\n";
486
  }
487
  }
488
 
@@ -493,12 +616,131 @@ class QtranslateSlug {
493
  */
494
  public function qts_body_class( $classes ) {
495
  // add 'class-name' to the $classes array
496
- $classes[] = qtrans_getLanguage();
497
 
498
  // return the $classes array
499
  return $classes;
500
  }
501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
  /**
503
  * Adds news rules to translate the URL bases,
504
  * this function must be called on flush_rewrite or 'flush_rewrite_rules'
@@ -508,7 +750,8 @@ class QtranslateSlug {
508
  * @since 1.0
509
  */
510
  public function modify_rewrite_rules() {
511
- global $wp_rewrite;
 
512
 
513
  // post types rules
514
  $post_types = get_post_types( array('_builtin' => false ), 'objects');
@@ -534,9 +777,9 @@ class QtranslateSlug {
534
  * @since 1.0
535
  */
536
  private function generate_extra_rules( $name = false ) {
537
- global $wp_rewrite, $q_config;
538
 
539
- foreach ($q_config['enabled_languages'] as $lang):
540
 
541
  if ( $base = $this->get_base_slug( $name, $lang) ):
542
 
@@ -590,10 +833,8 @@ class QtranslateSlug {
590
  return false;
591
  }
592
 
593
- $option = $qts_options[$option_name][$lang];
594
-
595
- if (isset($option)) {
596
- return $option;
597
  }
598
 
599
  return false;
@@ -705,7 +946,7 @@ class QtranslateSlug {
705
  $req_uri = trim($req_uri, '/');
706
  $req_uri = preg_replace("|^$home_path|", '', $req_uri);
707
  $req_uri = trim($req_uri, '/');
708
- if ($GLOBALS['q_config']['url_mode'] == QT_URL_PATH) {
709
  $req_uri = preg_replace("/^{$GLOBALS['q_config']['language']}(\/|$)/", '', $req_uri);
710
  }
711
  $pathinfo = trim($pathinfo, '/');
@@ -808,8 +1049,7 @@ class QtranslateSlug {
808
  * @since 1.0
809
  */
810
  function filter_request( $query ) {
811
- global $q_config, $wp_query, $wp;
812
-
813
  if ((isset($wp->matched_query) || empty($query)) && ! isset($query['s']) ) {
814
  $query = wp_parse_args($wp->matched_query);
815
  }
@@ -931,7 +1171,7 @@ class QtranslateSlug {
931
  if ( isset($function) ) {
932
 
933
  // parse all languages links
934
- foreach( $q_config['enabled_languages'] as $lang ) {
935
 
936
  $this->lang = $lang;
937
  $this->current_url[$lang] = apply_filters('qts_url_args', call_user_func($function, $id));
@@ -954,7 +1194,6 @@ class QtranslateSlug {
954
  * @since 1.0
955
  */
956
  public function get_current_url( $lang = false ) {
957
- global $q_config;
958
 
959
  if (!$lang) {
960
  $lang = $this->get_lang();
@@ -1141,7 +1380,7 @@ class QtranslateSlug {
1141
  }
1142
 
1143
  if ( !$ignore_caller ) {
1144
- $url = qtrans_convertURL($url, $this->get_lang(), true);
1145
  }
1146
 
1147
  return $url;
@@ -1627,25 +1866,27 @@ class QtranslateSlug {
1627
 
1628
  global $pagenow;
1629
 
1630
- // Although in post edit page the tags in 'most
1631
- // used' list are translated, but when saving the
1632
- // post Wordpress considers the translated tags as
1633
- // new tags. Due to this issue I skip this 'hack'
1634
- // for tags in post edit page.
1635
  if ( $pagenow != 'admin-ajax.php' ) {
1636
 
1637
  $meta = get_option('qtranslate_term_name');
1638
- $lang = qtrans_getLanguage();
 
1639
 
1640
  if ( !empty( $terms ) ) {
1641
- foreach ($terms as $term) {
1642
- if( isset( $meta[$term->name][$lang] ) ) {
1643
- $term->name = $meta[$term->name][$lang];
 
 
 
 
 
 
1644
  }
1645
  };
1646
  };
1647
  }
1648
-
1649
  return $terms;
1650
  }
1651
 
@@ -1680,7 +1921,7 @@ class QtranslateSlug {
1680
  $tax = str_replace("'", "", $taxonomy);
1681
 
1682
  $meta = get_option('qtranslate_term_name');
1683
- $lang = qtrans_getLanguage();
1684
 
1685
  if ( !empty( $terms ) ) {
1686
  foreach ($terms as $term) {
@@ -1697,14 +1938,14 @@ class QtranslateSlug {
1697
 
1698
 
1699
  /**
1700
- * hide quickedit button ( functionality not supported by qTranslate )
1701
  *
1702
  * @since 1.0
1703
  */
1704
  public function hide_quick_edit() {
1705
  echo "<!-- QTS remove quick edit box -->" . PHP_EOL;
1706
  echo "<style type=\"text/css\" media=\"screen\">" . PHP_EOL;
1707
- echo " .row-actions .inline.inline.hide-if-no-js { display: none !important }" . PHP_EOL;
1708
  echo "</style>" . PHP_EOL;
1709
  }
1710
 
@@ -1805,7 +2046,7 @@ class QtranslateSlug {
1805
  */
1806
  public function validate_post_slug( $slug, $post, $lang ) {
1807
 
1808
- $post_title = trim(qtrans_use($lang, $_POST['post_title']));
1809
  $post_name = get_post_meta($post->ID, $this->get_meta_key($lang), true);
1810
  if (!$post_name) {
1811
  $post_name = $post->post_name;
@@ -1921,7 +2162,6 @@ class QtranslateSlug {
1921
  * @since 1.0
1922
  */
1923
  public function save_postdata( $post_id, $post ) {
1924
- global $q_config;
1925
 
1926
  $post_type_object = get_post_type_object( $post->post_type);
1927
 
@@ -1933,7 +2173,7 @@ class QtranslateSlug {
1933
  return $post_id;
1934
  }
1935
 
1936
- foreach ($q_config['enabled_languages'] as $lang) {
1937
 
1938
  $meta_name = $this->get_meta_key($lang);
1939
  $meta_value = apply_filters( 'qts_validate_post_slug', $_POST["qts_{$lang}_slug"], $post, $lang);
@@ -2092,28 +2332,29 @@ class QtranslateSlug {
2092
  * @since 1.0
2093
  */
2094
  public function save_term( $term_id, $tt_id, $taxonomy ) {
2095
- global $q_config;
2096
-
2097
- if ( (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) // check autosave
2098
- || ( !current_user_can('edit_posts') ) ) { // check permission
 
 
2099
  return $term_id;
2100
  }
2101
 
2102
  $term = get_term( $term_id, $taxonomy);
2103
-
2104
- foreach( $q_config['enabled_languages'] as $lang ) {
2105
 
2106
  $meta_name = $this->get_meta_key($lang);
2107
 
2108
- //LC43: when at the post edit screen and creating a new tag
2109
  // the $slug comes from $_POST with the value of the post slug,
2110
  // not with the term slug.
2111
- if ($_POST['action'] == "editpost") {
2112
  // so we use the slug wp gave it
2113
  $term_slug = $term->slug;
2114
  } else {
2115
  // otherwise, its the edit term screen
2116
- $term_slug = $_POST["qts_term_{$lang}_slug"];
2117
  }
2118
 
2119
  $meta_value = apply_filters( 'qts_validate_term_slug', $term_slug, $term, $lang);
@@ -2149,8 +2390,8 @@ class QtranslateSlug {
2149
 
2150
  if ($taxonomies) {
2151
  foreach ($taxonomies as $taxonomy ) {
2152
- add_action( $taxonomy->name.'_add_form', 'qtrans_modifyTermFormFor');
2153
- add_action( $taxonomy->name.'_edit_form', 'qtrans_modifyTermFormFor');
2154
  add_action( $taxonomy->name.'_add_form', array(&$this, 'show_term_fields'));
2155
  add_action( $taxonomy->name.'_edit_form_fields', array(&$this, 'show_term_fields') );
2156
  add_filter('manage_edit-'.$taxonomy->name.'_columns', array(&$this, 'taxonomy_columns'));
@@ -2225,6 +2466,13 @@ class QtranslateSlug {
2225
  if (class_exists('mqTranslateWidget')) {
2226
  unregister_widget('mqTranslateWidget');
2227
  }
 
 
 
 
 
 
 
2228
 
2229
  register_widget('QtranslateSlugWidget');
2230
  }
@@ -2277,6 +2525,10 @@ class QtranslateSlug {
2277
  echo __($q_config['language_name'][$language], 'qtranslate');
2278
  echo '</label></p>';
2279
  }
 
 
 
 
2280
  echo '</p>';
2281
  }
2282
 
@@ -2301,7 +2553,7 @@ class QtranslateSlug {
2301
  );
2302
  $args = wp_parse_args( $args, $defaults );
2303
 
2304
- $languages = qtrans_getSortedLanguages();
2305
 
2306
  // every type
2307
  switch ( $type ) {
@@ -2336,6 +2588,7 @@ class QtranslateSlug {
2336
  } else {
2337
  $link_class = '';
2338
  $link_content = $language_name;
 
2339
  }
2340
  if( $type == 'image' || $type == 'both' ) {
2341
  $link_flag_url = $baseurl . '/'.$q_config['flag_location'].$q_config['flag'][$lang];
49
  * @since 1.0
50
  */
51
  private $lang = false;
52
+
53
+ /**
54
+ * variable for current language
55
+ */
56
+ private $current_lang = false;
57
 
58
+ /**
59
+ * Array of enabled languages
60
+ *
61
+ * @var array
62
+ *
63
+ * @since 1.0
64
+ */
65
+ private $enabled_languages = array();
66
+ /**
67
+ * Array of enabled languages
68
+ *
69
+ * @var array
70
+ *
71
+ * @since 1.0
72
+ */
73
+ private $url_path_mode = "";
74
+
75
 
76
 
77
  /**
95
  private $current_url = array();
96
 
97
 
98
+ /**
99
+ * Variable that contains the prefix for base plugin function names (qtranslate/qtranslate-x)
100
+ *
101
+ * @var string
102
+ *
103
+ * @since ?
104
+ */
105
+ private $plugin_prefix = "";
106
+
107
+
108
  /**
109
  * return the current / temp language
110
  *
115
 
116
  return ($this->lang) ? $this->lang : $q_config['language'];
117
  }
118
+ /**
119
+ * return the current / temp language
120
+ * we store and use it all the way!
121
+ *
122
+ * @since 1.1.9
123
+ */
124
+ private function get_currentlang() {
125
+ return $this->current_lang;
126
+ }
127
+ /**
128
+ * return the enabled languages
129
+ * we store and use it all the way!
130
+ *
131
+ * @since 1.1.9
132
+ */
133
+ private function get_enabled_languages() {
134
+ return $this->enabled_languages;
135
+ }
136
+ /**
137
+ * return the enabled languages
138
+ * we store and use it all the way!
139
+ *
140
+ * @since 1.1.9
141
+ */
142
+ private function get_url_path_mode() {
143
+ return $this->url_path_mode;
144
+ }
145
 
146
 
147
  /**
153
  $this->set_options();
154
  return $this->options;
155
  }
156
+ /**
157
+ * Returns the correct prefix for the function names of the different supported translation plugins.
158
+ * Will return 'qtranxf_' if qtranslate-x is used, 'qtrans_' otherwise.
159
+ *
160
+ * @return string the function name prefix for translation functions from other plugins
161
+ * @since 1.1.9
162
+ */
163
+ private function get_plugin_prefix(){
164
+
165
+ return $this->plugin_prefix;
166
+ }
167
 
168
 
169
  /**
186
  }
187
  }
188
 
189
+ /**
190
+ * Sets the prefix for the active fork. See get_plugin_prefix
191
+ * @since 1.1.9
192
+ *
193
+ */
194
+ private function set_plugin_prefix(){
195
+ if ('' === $this->plugin_prefix){
196
+ if (is_plugin_active('qtranslate-x/qtranslate.php')){
197
+ $this->plugin_prefix = 'qtranxf_';
198
+ } else {
199
+ $this->plugin_prefix = 'qtrans_';
200
+ }
201
+ }
202
+ }
203
+ /**
204
+ * Returns the correct prefix for the function names of the different supported translation plugins.
205
+ * Will return 'qtranxf_' if qtranslate-x is used, 'qtrans_' otherwise.
206
+ *
207
+ * @return string the function name prefix for translation functions from other plugins
208
+ * @since 1.1.9
209
+ */
210
+ private function set_url_path_mode(){
211
+ if ('' === $this->url_path_mode){
212
+ if (is_plugin_active('qtranslate-x/qtranslate.php')){
213
+ $this->url_path_mode = QTX_URL_PATH;
214
+ } else {
215
+ $this->url_path_mode = QT_URL_PATH;
216
+ }
217
+ }
218
+ }
219
 
220
  /**
221
  * setter: options | permalink_structure
266
 
267
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
268
 
269
+ return (
270
+ version_compare($wp_version, "3.3", "<" ) ||
271
+ ( !is_plugin_active('qtranslate/qtranslate.php') &&
272
+ !is_plugin_active('mqtranslate/mqtranslate.php') &&
273
+ !is_plugin_active('qtranslate-x/qtranslate.php'))
274
+ );
275
  }
276
 
277
 
278
+
279
 
280
  /**
281
  * check if exists qtranslate and do the installation, support multisite
483
  */
484
  function init() {
485
 
486
+ load_plugin_textdomain( 'qts', false, basename( plugin_dir_path( dirname( __FILE__ ) ) ) . '/languages' );
487
 
488
  // checking plugin activate
489
  if ( self::block_activate() ) {
496
  // caching qts options
497
  $this->set_options();
498
 
499
+ global $q_config;
500
+
501
+ // until we get a proper function, this will make it for it.
502
+ $this->current_lang = $q_config['language'];
503
+ $this->enabled_languages = $q_config['enabled_languages'];
504
+ $this->set_plugin_prefix();
505
+ $this->set_url_path_mode();
506
+
507
  if ( is_admin() ) {
508
 
509
  $this->check_old_versions();
510
+
511
 
512
  // add filters
513
  add_filter( 'qts_validate_post_slug', array(&$this, 'validate_post_slug'), 0, 3 );
551
 
552
  // remove from qtranslate the discouraged meta http-equiv, inline styles
553
  // (including flag URLs) and wrong hreflang links
554
+ remove_action('wp_head', $this->get_plugin_prefix() . 'header');
555
  // add proper hreflang links
556
  add_action('wp_head',array(&$this, 'qtranslate_slug_header_extended'));
557
 
558
  // remove some Qtranslate filters
559
+ remove_filter( 'page_link', $this->get_plugin_prefix() . 'convertURL' );
560
+ remove_filter( 'post_link', $this->get_plugin_prefix() . 'convertURL' );
561
+ remove_filter( 'category_link', $this->get_plugin_prefix() . 'convertURL' );
562
+ remove_filter( 'tag_link', $this->get_plugin_prefix() . 'convertURL' );
563
 
564
  add_filter( 'qts_permastruct' , array(&$this, 'get_extra_permastruct'), 0, 2);
565
  add_filter( 'qts_url_args', array(&$this, 'parse_url_args'), 0, 1);
569
  add_filter( '_get_page_link', array(&$this, '_get_page_link'), 0, 2 );
570
  add_filter( 'term_link', array(&$this, 'term_link'), 600, 3 );
571
 
572
+ add_filter( 'single_term_title', $this->get_plugin_prefix() . 'useTermLib', 805 );
573
  add_filter( 'get_blogs_of_user', array(&$this, 'blog_names'), 1 );
574
  add_action( 'widgets_init', array(&$this, 'widget_init'), 100 );
575
  // Add specific CSS class to body class based on current lang
576
  add_filter('body_class', array($this, 'qts_body_class'), 600, 1 );
 
577
 
578
+ add_filter( 'nav_menu_attr_title', array($this, 'qts_filter_attr_title'), 0, 3 );
579
+
580
+
581
+ }
582
+
583
+ /**
584
+ * Filters menu link attribute
585
+ *
586
+ * @since 1.1.9
587
+ */
588
+ function qts_filter_attr_title( $attr_title ) {
589
+ return $this->qts_quickuse($attr_title);
590
+ }
591
+
592
 
593
  /**
594
  * Adds proper links to the content with available translations.
600
  * @since 1.1.8
601
  */
602
  public function qtranslate_slug_header_extended(){
603
+ if(is_404()) return;
604
+
605
+
606
+ foreach($this->get_enabled_languages() as $language) {
607
+ if($language != $this->get_currentlang() )
608
+ echo '<link hreflang="'.$language.'" href="'.$this->get_current_url($language).'" rel="alternate" />'."\n";
 
609
  }
610
  }
611
 
616
  */
617
  public function qts_body_class( $classes ) {
618
  // add 'class-name' to the $classes array
619
+ $classes[] = call_user_func($this->get_plugin_prefix() . 'getLanguage');
620
 
621
  // return the $classes array
622
  return $classes;
623
  }
624
 
625
+ // TODO: properly test this
626
+ /**
627
+ * Get text in $lang, or in the current lang
628
+ *
629
+ * @package Qtranslate Slug
630
+ * @since 1.1.9
631
+ * @param string $text the whole text
632
+ * @param string $lang (optional) get the text in this language, or if empty, the current
633
+ * @return array the text in the required language
634
+ */
635
+ public function qts_quickuse( $text,$lang='' ){
636
+ global $q_config;
637
+ $lang = '' == $lang ? $q_config['language'] : $lang;
638
+ $parsed_text = $this->qts_split($text);
639
+ if( !empty($parsed_text[$lang])){
640
+ return $parsed_text[$lang];
641
+ }
642
+ }
643
+ /**
644
+ * Quickly splits text in the different languages, either by
645
+ * long tags "<!--:en-->text<!--:-->", or
646
+ * ~short tags "[:en]text"~ <- dont support any more.
647
+ * NOTE: this is different behaviour from qtrans_split. don't mix long and short
648
+ * ANOTHER NOTE: don't mix <!--:en-->text<!--:-->more text.
649
+ * @param $text the whole text
650
+ * @param bool $quicktag
651
+ *
652
+ * @package Qtranslate Slug
653
+ * @since 1.1.9
654
+ */
655
+ public function qts_split($text, $quicktags = false ) {
656
+
657
+ $result = array();
658
+ /* if( $quicktags ) {
659
+ $split_regex = "#\[(:[a-z]{2})\]#ism";
660
+ $split_texts = preg_split($split_regex, $text, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
661
+ $max = count( $split_texts);
662
+ for( $i=0 ; $i < $max; $i+=2) {
663
+ $result[$split_texts[$i]] = $split_texts[$i+1];
664
+ }
665
+ return $result;
666
+ } else {*/
667
+ $split_texts = explode('<!--:-->', $text);
668
+ foreach ($split_texts as $split_text) {
669
+ if(preg_match("#<!--:([a-z]{2})-->(.*)#i", $split_text, $matches)) {
670
+ $result[$matches[1]] = $matches[2];
671
+ }
672
+ }
673
+ //}
674
+ return $result;
675
+ }
676
+
677
+
678
+ /**
679
+ *
680
+ * Splits and returns the text in the right language.
681
+ * Based on https://github.com/xhaleera/mqtranslate
682
+ * and https://wordpress.org/support/topic/evidence-on-how-slow-and-inefficient-qtranslate-is-please-do-something
683
+ * @param string $lang the language to extr
684
+ */
685
+ public function qts_use($lang, $text, $show_available=false) {
686
+ if (empty($text) || !call_user_func($this->get_plugin_prefix() . 'isEnabled',$lang))
687
+ return $text;
688
+
689
+ $re = '/<!--:[a-z]{2}-->/i';
690
+ // dropping quicktags like a boss
691
+ if (is_string($text) && !preg_match($re, $text))
692
+ return $text;
693
+
694
+ if (is_array($text) || is_object($text)) {
695
+ foreach ($text as &$t)
696
+ if ($t && ((is_string($t) && preg_match($re, $t)) || is_array($t) || is_object($t)))
697
+ $t = $this->qts_use($lang, $t, $show_available);
698
+ return $text;
699
+ }
700
+
701
+
702
+
703
+ // get content
704
+ $content = $this->qts_split($text);
705
+ // find available languages
706
+ $available_languages = array();
707
+ foreach($content as $language => $lang_text) {
708
+ $lang_text = trim($lang_text);
709
+ if(!empty($lang_text)) {
710
+ $available_languages[] = $language;
711
+ }
712
+ }
713
+ // if no languages available show full text
714
+ if (empty($available_languages))
715
+ return $text;
716
+
717
+ // if content is available, show the content in the requested language
718
+ if (!empty($content[$lang]))
719
+ return $content[$lang];
720
+ if( $show_available ) {
721
+ global $q_config;
722
+ // display selection for available languages
723
+ $language_list = "";
724
+ // Not Available Message + separators
725
+ $language_notavailable = explode(":", $q_config['not_available'][$lang] );
726
+ if (empty($language_notavailable )) {
727
+ $language_url = get_the_permalink();
728
+ $normal_separator = $language_notavailable[1];
729
+ $end_separator = $language_notavailable[2];
730
+ // build available languages string backward
731
+ foreach ($available_languages as $k => $language) {
732
+ if ($k == 1)
733
+ $language_list = $end_separator.$language_list;
734
+ else if ($k > 1)
735
+ $language_list = $normal_separator.$language_list;
736
+ $language_list = "<a href=\"". call_user_func($this->get_plugin_prefix() . 'convertURL',$language_url, $language)."\">".$q_config['language_name'][$language]."</a>".$language_list;
737
+ }
738
+ }//TODO: fix this! the link isn't updated.
739
+ return "<p>".sprintf( $q_config['not_available'][$lang], $language_list)."</p>";
740
+ }
741
+ return "";
742
+
743
+ }
744
  /**
745
  * Adds news rules to translate the URL bases,
746
  * this function must be called on flush_rewrite or 'flush_rewrite_rules'
750
  * @since 1.0
751
  */
752
  public function modify_rewrite_rules() {
753
+ // do we need this global?
754
+ //global $wp_rewrite;
755
 
756
  // post types rules
757
  $post_types = get_post_types( array('_builtin' => false ), 'objects');
777
  * @since 1.0
778
  */
779
  private function generate_extra_rules( $name = false ) {
780
+ global $wp_rewrite;
781
 
782
+ foreach ($this->get_enabled_languages() as $lang):
783
 
784
  if ( $base = $this->get_base_slug( $name, $lang) ):
785
 
833
  return false;
834
  }
835
 
836
+ if (isset($qts_options[$option_name][$lang])) {
837
+ return $qts_options[$option_name][$lang];
 
 
838
  }
839
 
840
  return false;
946
  $req_uri = trim($req_uri, '/');
947
  $req_uri = preg_replace("|^$home_path|", '', $req_uri);
948
  $req_uri = trim($req_uri, '/');
949
+ if ($GLOBALS['q_config']['url_mode'] == $this->get_url_path_mode()) {
950
  $req_uri = preg_replace("/^{$GLOBALS['q_config']['language']}(\/|$)/", '', $req_uri);
951
  }
952
  $pathinfo = trim($pathinfo, '/');
1049
  * @since 1.0
1050
  */
1051
  function filter_request( $query ) {
1052
+ global $wp_query, $wp;
 
1053
  if ((isset($wp->matched_query) || empty($query)) && ! isset($query['s']) ) {
1054
  $query = wp_parse_args($wp->matched_query);
1055
  }
1171
  if ( isset($function) ) {
1172
 
1173
  // parse all languages links
1174
+ foreach( $this->get_enabled_languages() as $lang ) {
1175
 
1176
  $this->lang = $lang;
1177
  $this->current_url[$lang] = apply_filters('qts_url_args', call_user_func($function, $id));
1194
  * @since 1.0
1195
  */
1196
  public function get_current_url( $lang = false ) {
 
1197
 
1198
  if (!$lang) {
1199
  $lang = $this->get_lang();
1380
  }
1381
 
1382
  if ( !$ignore_caller ) {
1383
+ $url = call_user_func($this->get_plugin_prefix() . 'convertURL', $url, $this->get_lang(), true);
1384
  }
1385
 
1386
  return $url;
1866
 
1867
  global $pagenow;
1868
 
1869
+
 
 
 
 
1870
  if ( $pagenow != 'admin-ajax.php' ) {
1871
 
1872
  $meta = get_option('qtranslate_term_name');
1873
+ $lang = call_user_func($this->get_plugin_prefix() . 'getLanguage');
1874
+
1875
 
1876
  if ( !empty( $terms ) ) {
1877
+ foreach ($terms as $term_index => $term) {
1878
+ // after saving, dont do anything
1879
+ if( ( isset($_POST['action'] ) && $_POST['action'] == "editedtag") ||
1880
+ !is_object( $term ) ) {
1881
+ return $terms;
1882
+ }
1883
+ $termname = $term->name;
1884
+ if( isset( $meta[$termname][$lang] ) ) {
1885
+ $term->name = $meta[$termname][$lang];
1886
  }
1887
  };
1888
  };
1889
  }
 
1890
  return $terms;
1891
  }
1892
 
1921
  $tax = str_replace("'", "", $taxonomy);
1922
 
1923
  $meta = get_option('qtranslate_term_name');
1924
+ $lang = call_user_func($this->get_plugin_prefix() . 'getLanguage');
1925
 
1926
  if ( !empty( $terms ) ) {
1927
  foreach ($terms as $term) {
1938
 
1939
 
1940
  /**
1941
+ * hide quickedit slug
1942
  *
1943
  * @since 1.0
1944
  */
1945
  public function hide_quick_edit() {
1946
  echo "<!-- QTS remove quick edit box -->" . PHP_EOL;
1947
  echo "<style type=\"text/css\" media=\"screen\">" . PHP_EOL;
1948
+ echo " .inline-edit-row fieldset.inline-edit-col-left .inline-edit-col *:first-child + label + label { display: none !important }" . PHP_EOL;
1949
  echo "</style>" . PHP_EOL;
1950
  }
1951
 
2046
  */
2047
  public function validate_post_slug( $slug, $post, $lang ) {
2048
 
2049
+ $post_title = trim($this->qts_use($lang, $_POST['post_title']));
2050
  $post_name = get_post_meta($post->ID, $this->get_meta_key($lang), true);
2051
  if (!$post_name) {
2052
  $post_name = $post->post_name;
2162
  * @since 1.0
2163
  */
2164
  public function save_postdata( $post_id, $post ) {
 
2165
 
2166
  $post_type_object = get_post_type_object( $post->post_type);
2167
 
2173
  return $post_id;
2174
  }
2175
 
2176
+ foreach ($this->get_enabled_languages() as $lang) {
2177
 
2178
  $meta_name = $this->get_meta_key($lang);
2179
  $meta_value = apply_filters( 'qts_validate_post_slug', $_POST["qts_{$lang}_slug"], $post, $lang);
2332
  * @since 1.0
2333
  */
2334
  public function save_term( $term_id, $tt_id, $taxonomy ) {
2335
+
2336
+ $cur_screen = get_current_screen();
2337
+ if ( (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) // check autosave
2338
+ || ( !current_user_can('edit_posts') ) // check permission
2339
+ || ( $cur_screen->id === "nav-menus")
2340
+ ) {
2341
  return $term_id;
2342
  }
2343
 
2344
  $term = get_term( $term_id, $taxonomy);
2345
+ foreach( $this->get_enabled_languages() as $lang ) {
 
2346
 
2347
  $meta_name = $this->get_meta_key($lang);
2348
 
2349
+ //43LC: when at the post edit screen and creating a new tag
2350
  // the $slug comes from $_POST with the value of the post slug,
2351
  // not with the term slug.
2352
+ if ($_POST['action'] == "editpost") {
2353
  // so we use the slug wp gave it
2354
  $term_slug = $term->slug;
2355
  } else {
2356
  // otherwise, its the edit term screen
2357
+ $term_slug = $_POST["qts_{$lang}_slug"];
2358
  }
2359
 
2360
  $meta_value = apply_filters( 'qts_validate_term_slug', $term_slug, $term, $lang);
2390
 
2391
  if ($taxonomies) {
2392
  foreach ($taxonomies as $taxonomy ) {
2393
+ add_action( $taxonomy->name.'_add_form', $this->get_plugin_prefix() . 'modifyTermFormFor');
2394
+ add_action( $taxonomy->name.'_edit_form', $this->get_plugin_prefix() . 'modifyTermFormFor');
2395
  add_action( $taxonomy->name.'_add_form', array(&$this, 'show_term_fields'));
2396
  add_action( $taxonomy->name.'_edit_form_fields', array(&$this, 'show_term_fields') );
2397
  add_filter('manage_edit-'.$taxonomy->name.'_columns', array(&$this, 'taxonomy_columns'));
2466
  if (class_exists('mqTranslateWidget')) {
2467
  unregister_widget('mqTranslateWidget');
2468
  }
2469
+ if (class_exists('ppqTranslateWidget')) {
2470
+ unregister_widget('ppqTranslateWidget');
2471
+ }
2472
+
2473
+ if (class_exists('qTranslateXWidget')) {
2474
+ unregister_widget('qTranslateXWidget');
2475
+ }
2476
 
2477
  register_widget('QtranslateSlugWidget');
2478
  }
2525
  echo __($q_config['language_name'][$language], 'qtranslate');
2526
  echo '</label></p>';
2527
  }
2528
+ echo '<p style="margin:0 0 5px 0"><input type="radio" style="margin-right:5px" name="wa_qt_lang" value="all" id="wa_gt_lang_999" />';
2529
+ echo '<label for="wa_gt_lang_999">';
2530
+ echo __('All languages', 'qts');
2531
+ echo '</label></p>';
2532
  echo '</p>';
2533
  }
2534
 
2553
  );
2554
  $args = wp_parse_args( $args, $defaults );
2555
 
2556
+ $languages = call_user_func($this->get_plugin_prefix() . 'getSortedLanguages');
2557
 
2558
  // every type
2559
  switch ( $type ) {
2588
  } else {
2589
  $link_class = '';
2590
  $link_content = $language_name;
2591
+ $link_flag ='';
2592
  }
2593
  if( $type == 'image' || $type == 'both' ) {
2594
  $link_flag_url = $baseurl . '/'.$q_config['flag_location'].$q_config['flag'][$lang];
includes/qtranslate-slug-settings-options.php CHANGED
@@ -55,8 +55,6 @@ function get_multi_txt_choices($name = false) {
55
  * @return array
56
  */
57
  function qts_options_page_styles() {
58
- global $q_config;
59
-
60
 
61
 
62
  $options[] = array(
@@ -72,10 +70,10 @@ function qts_options_page_styles() {
72
  "type" => "multi-radio",
73
  'class' => 'qts-style',
74
  "choices" => array(
75
- "file",
76
- "minified",
77
- "inline",
78
- "none"
79
  ),
80
  "std" => "file"
81
  );
@@ -95,7 +93,6 @@ function qts_options_page_styles() {
95
  * @return array
96
  */
97
  function qts_options_page_fields() {
98
- global $q_config;
99
 
100
  $post_types = get_post_types( array('_builtin' => false, 'public' => true ), 'objects');
101
 
55
  * @return array
56
  */
57
  function qts_options_page_styles() {
 
 
58
 
59
 
60
  $options[] = array(
70
  "type" => "multi-radio",
71
  'class' => 'qts-style',
72
  "choices" => array(
73
+ __("file", "qts"),
74
+ __("minified", "qts"),
75
+ __("inline", "qts"),
76
+ __("none", "qts")
77
  ),
78
  "std" => "file"
79
  );
93
  * @return array
94
  */
95
  function qts_options_page_fields() {
 
96
 
97
  $post_types = get_post_types( array('_builtin' => false, 'public' => true ), 'objects');
98
 
includes/qtranslate-slug-settings.php CHANGED
@@ -583,7 +583,7 @@ function qts_show_settings_page() {
583
 
584
 
585
  ?>
586
- <p>If you selected "none", copy and use these styles as you see fit:</p>
587
  <textarea name="textarea" rows="10" cols="80"><?php echo $file_styles; ?></textarea>;
588
  <p class="submit">
589
  <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes','qts'); ?>" />
583
 
584
 
585
  ?>
586
+ <p><?php _e('If you selected "none", copy and use these styles as you see fit:','qts'); ?> </p>
587
  <textarea name="textarea" rows="10" cols="80"><?php echo $file_styles; ?></textarea>;
588
  <p class="submit">
589
  <input name="Submit" type="submit" class="button-primary" value="<?php esc_attr_e('Save Changes','qts'); ?>" />
languages/qts-pt_PT.mo CHANGED
Binary file
languages/qts-pt_PT.po CHANGED
@@ -2,17 +2,17 @@
2
  # This file is distributed under the same license as the qTranslate slug package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: qTranslate slug 1.0\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/qtranslate-slug\n"
7
  "POT-Creation-Date: 2012-05-27 20:27:55+00:00\n"
8
- "PO-Revision-Date: 2014-05-22 12:29-0000\n"
9
  "Last-Translator: Pedro Mendonça <ped.gaspar@gmail.com>\n"
10
  "Language-Team: Pedro Mendonça <ped.gaspar@gmail.com>\n"
11
  "Language: pt_PT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
- "X-Generator: Poedit 1.6.4\n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
 
@@ -113,8 +113,8 @@ msgstr "Actualize os seus dados"
113
 
114
  #: qtranslate-slug-settings.php
115
  msgid ""
116
- "There are slugs stored with old data system. Please upgrade your data "
117
- "pressing upgrade button:"
118
  msgstr ""
119
  "Existem URLs com sistema de dados antigo. Por favor actualize os seus dados "
120
  "através do botão actualizar:"
@@ -153,31 +153,29 @@ msgstr ""
153
  #: qtranslate-slug-settings.php
154
  msgid ""
155
  "If you activated previously the <a href=\"options-permalink.php\">pretty "
156
- "permalinks</a>, in this section you can translate the <abbr title=\"en "
157
- "inglés, Universal Resource Locator\">URLs</abbr> <strong>bases</strong> for "
158
- "<a href=\"http://codex.wordpress.org/Function_Reference/"
159
- "register_post_type#Arguments\">public</a> post_types, categories, tags and "
160
- "taxonomies."
161
  msgstr ""
162
  "Se activou previamente as <a href=\"options-permalink.php\">ligações "
163
  "permanentes</a>, nesta secção poderá traduzir as <strong>bases</strong> das "
164
  "<abbr title=\"em inglês, Universal Resource Locator\">URLs</abbr> para tipos "
165
- "de artigo, categorias, etiquetas e taxonomias <a href=\"http://codex."
166
- "wordpress.org/Function_Reference/register_post_type#Arguments\">públicas</a>."
167
 
168
  #: qtranslate-slug-settings.php
169
  msgid ""
170
- "For example, the post_type <kbd>books</kbd>, in Spanish would be displayed "
171
- "as <code>http://example.org/es/libros/post-type-name/</code>. If you leave "
172
- "this blank will use the default option when you <a href=\"http://codex."
173
- "wordpress.org/Function_Reference/register_post_type\">registered</a> the "
174
- "post_type."
175
  msgstr ""
176
  "Por exemplo, o tipo de artigo <kbd>livros</kbd>, em português seria mostrado "
177
  "como <code>http://exemplo.org/pt/livros/nome-de-tipo-de-artigo/</code>. Se "
178
  "deixar isto em branco, será usada a opção por omissão <a href=\"http://codex."
179
- "wordpress.org/Function_Reference/register_post_type\">registada</a> no tipo "
180
- "de artigo."
181
 
182
  #: qtranslate-slug-settings.php
183
  msgid ""
@@ -185,15 +183,70 @@ msgid ""
185
  "as <code>http://example.org/es/categoria/taxonomy-name/</code>. If you leave "
186
  "this blank will use the default option when you <a href=\"http://codex."
187
  "wordpress.org/Function_Reference/register_taxonomy\">registered</a> the "
188
- "taxonomy (if you previously setup a base permastruct for <u>categories</u> "
189
- "or <u>tags</u> in <a href=\"options-permalink.php\">permalinks</a> page, "
190
- "these bases will be overwritten by the translated ones)."
191
  msgstr ""
192
  "Por exemplo, a taxonomia <kbd>categoria</kbd>, em português seria mostrado "
193
  "como <code>http://exemplo.org/pt/categoria/nome-de-taxonomia/</code>. Se "
194
  "deixar isto em branco, será usada a opção por omissão <a href=\"http://codex."
195
  "wordpress.org/Function_Reference/register_taxonomy\">registada</a> na "
196
  "taxonomia (se previamente configurou a base das ligações permanentes para "
197
- "<u>categorias</u> ou <u>etiquetas</u> na página <a href=\"options-permalink."
198
- "php\">ligações permanentes</a>, estas bases serão sobrepostas pelas "
199
- "traduzidas)."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  # This file is distributed under the same license as the qTranslate slug package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: qTranslate slug\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/qtranslate-slug\n"
7
  "POT-Creation-Date: 2012-05-27 20:27:55+00:00\n"
8
+ "PO-Revision-Date: 2015-01-07 13:02-0000\n"
9
  "Last-Translator: Pedro Mendonça <ped.gaspar@gmail.com>\n"
10
  "Language-Team: Pedro Mendonça <ped.gaspar@gmail.com>\n"
11
  "Language: pt_PT\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.7.1\n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "X-Poedit-SourceCharset: UTF-8\n"
18
 
113
 
114
  #: qtranslate-slug-settings.php
115
  msgid ""
116
+ "There are slugs stored with old data system. Please upgrade your data pressing "
117
+ "upgrade button:"
118
  msgstr ""
119
  "Existem URLs com sistema de dados antigo. Por favor actualize os seus dados "
120
  "através do botão actualizar:"
153
  #: qtranslate-slug-settings.php
154
  msgid ""
155
  "If you activated previously the <a href=\"options-permalink.php\">pretty "
156
+ "permalinks</a>, in this section you can translate the <abbr title=\"en inglés, "
157
+ "Universal Resource Locator\">URLs</abbr> <strong>bases</strong> for <a href="
158
+ "\"http://codex.wordpress.org/Function_Reference/register_post_type#Arguments"
159
+ "\">public</a> post_types, categories, tags and taxonomies."
 
160
  msgstr ""
161
  "Se activou previamente as <a href=\"options-permalink.php\">ligações "
162
  "permanentes</a>, nesta secção poderá traduzir as <strong>bases</strong> das "
163
  "<abbr title=\"em inglês, Universal Resource Locator\">URLs</abbr> para tipos "
164
+ "de artigo, categorias, etiquetas e taxonomias <a href=\"http://codex.wordpress."
165
+ "org/Function_Reference/register_post_type#Arguments\">públicas</a>."
166
 
167
  #: qtranslate-slug-settings.php
168
  msgid ""
169
+ "For example, the post_type <kbd>books</kbd>, in Spanish would be displayed as "
170
+ "<code>http://example.org/es/libros/post-type-name/</code>. If you leave this "
171
+ "blank will use the default option when you <a href=\"http://codex.wordpress."
172
+ "org/Function_Reference/register_post_type\">registered</a> the post_type."
 
173
  msgstr ""
174
  "Por exemplo, o tipo de artigo <kbd>livros</kbd>, em português seria mostrado "
175
  "como <code>http://exemplo.org/pt/livros/nome-de-tipo-de-artigo/</code>. Se "
176
  "deixar isto em branco, será usada a opção por omissão <a href=\"http://codex."
177
+ "wordpress.org/Function_Reference/register_post_type\">registada</a> no tipo de "
178
+ "artigo."
179
 
180
  #: qtranslate-slug-settings.php
181
  msgid ""
183
  "as <code>http://example.org/es/categoria/taxonomy-name/</code>. If you leave "
184
  "this blank will use the default option when you <a href=\"http://codex."
185
  "wordpress.org/Function_Reference/register_taxonomy\">registered</a> the "
186
+ "taxonomy (if you previously setup a base permastruct for <u>categories</u> or "
187
+ "<u>tags</u> in <a href=\"options-permalink.php\">permalinks</a> page, these "
188
+ "bases will be overwritten by the translated ones)."
189
  msgstr ""
190
  "Por exemplo, a taxonomia <kbd>categoria</kbd>, em português seria mostrado "
191
  "como <code>http://exemplo.org/pt/categoria/nome-de-taxonomia/</code>. Se "
192
  "deixar isto em branco, será usada a opção por omissão <a href=\"http://codex."
193
  "wordpress.org/Function_Reference/register_taxonomy\">registada</a> na "
194
  "taxonomia (se previamente configurou a base das ligações permanentes para "
195
+ "<u>categorias</u> ou <u>etiquetas</u> na página <a href=\"options-permalink.php"
196
+ "\">ligações permanentes</a>, estas bases serão sobrepostas pelas traduzidas)."
197
+
198
+ #: qtranslate-slug-settings-options.php
199
+ msgid "Styles"
200
+ msgstr "Estilos"
201
+
202
+ #: qtranslate-slug-settings.php
203
+ msgid "The default styles are very minimal, and you can include them or not."
204
+ msgstr "Os estilos padrão são mínimos, pode incluí-los ou não."
205
+
206
+ #: qtranslate-slug-settings-options.php
207
+ msgid "Change styles type"
208
+ msgstr "Alterar o tipo de estilos"
209
+
210
+ #: qtranslate-slug-settings-options.php
211
+ msgid "file"
212
+ msgstr "ficheiro"
213
+
214
+ #: qtranslate-slug-settings-options.php
215
+ msgid "minified"
216
+ msgstr "minimizado"
217
+
218
+ #: qtranslate-slug-settings-options.php
219
+ msgid "inline"
220
+ msgstr "em linha"
221
+
222
+ #: qtranslate-slug-settings-options.php
223
+ msgid "none"
224
+ msgstr "nenhum"
225
+
226
+ #: qtranslate-slug-settings-options.php
227
+ msgid "adds a file (qts-default.css) to the theme's header."
228
+ msgstr "adiciona um ficheiro (qts-default.css) ao cabeçalho do tema."
229
+
230
+ #: qtranslate-slug-settings-options.php
231
+ msgid ""
232
+ "adds a minified ( slighlty faster) file (qts-default.min.css) to the theme's "
233
+ "header."
234
+ msgstr ""
235
+ "adiciona um ficheiro minimizado (qts-default.min.css), ligeiramente mais "
236
+ "rápido, ao cabeçalho do tema."
237
+
238
+ #: qtranslate-slug-settings-options.php
239
+ msgid "prints the styles directly into the theme's header."
240
+ msgstr "exibe os estilos directamente no cabeçalho do tema."
241
+
242
+ #: qtranslate-slug-settings-options.php
243
+ msgid "neither include not print the default style."
244
+ msgstr "nem incluir nem exibir o estilo padrão."
245
+
246
+ #: qtranslate-slug-settings.php
247
+ msgid "If you selected \"none\", copy and use these styles as you see fit:"
248
+ msgstr "Se escolher \"nenhum\", copie e utilize estes estilos como entender:"
249
+
250
+ #: class-qtranslate-slug-widget.php
251
+ msgid "Allows your visitors to choose a Language."
252
+ msgstr "Permite aos visitantes escolher o seu Idioma."
languages/qts.pot CHANGED
@@ -143,3 +143,55 @@ msgstr ""
143
  #: qtranslate-slug-settings.php
144
  msgid "For example, the taxonomy <kbd>category</kbd>, in Spanish would be displayed as <code>http://example.org/es/categoria/taxonomy-name/</code>. If you leave this blank will use the default option when you <a href=\"http://codex.wordpress.org/Function_Reference/register_taxonomy\">registered</a> the taxonomy (if you previously setup a base permastruct for <u>categories</u> or <u>tags</u> in <a href=\"options-permalink.php\">permalinks</a> page, these bases will be overwritten by the translated ones)."
145
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  #: qtranslate-slug-settings.php
144
  msgid "For example, the taxonomy <kbd>category</kbd>, in Spanish would be displayed as <code>http://example.org/es/categoria/taxonomy-name/</code>. If you leave this blank will use the default option when you <a href=\"http://codex.wordpress.org/Function_Reference/register_taxonomy\">registered</a> the taxonomy (if you previously setup a base permastruct for <u>categories</u> or <u>tags</u> in <a href=\"options-permalink.php\">permalinks</a> page, these bases will be overwritten by the translated ones)."
145
  msgstr ""
146
+
147
+ #: qtranslate-slug-settings-options.php
148
+ msgid "Styles"
149
+ msgstr ""
150
+
151
+ #: qtranslate-slug-settings.php
152
+ msgid "The default styles are very minimal, and you can include them or not."
153
+ msgstr ""
154
+
155
+ #: qtranslate-slug-settings-options.php
156
+ msgid "Change styles type"
157
+ msgstr ""
158
+
159
+ #: qtranslate-slug-settings-options.php
160
+ msgid "file"
161
+ msgstr ""
162
+
163
+ #: qtranslate-slug-settings-options.php
164
+ msgid "minified"
165
+ msgstr ""
166
+
167
+ #: qtranslate-slug-settings-options.php
168
+ msgid "inline"
169
+ msgstr ""
170
+
171
+ #: qtranslate-slug-settings-options.php
172
+ msgid "none"
173
+ msgstr ""
174
+
175
+ #: qtranslate-slug-settings-options.php
176
+ msgid "adds a file (qts-default.css) to the theme's header."
177
+ msgstr ""
178
+
179
+ #: qtranslate-slug-settings-options.php
180
+ msgid "adds a minified ( slighlty faster) file (qts-default.min.css) to the theme's header."
181
+ msgstr ""
182
+
183
+ #: qtranslate-slug-settings-options.php
184
+ msgid "prints the styles directly into the theme's header."
185
+ msgstr ""
186
+
187
+ #: qtranslate-slug-settings-options.php
188
+ msgid "neither include not print the default style."
189
+ msgstr ""
190
+
191
+ #: qtranslate-slug-settings.php
192
+ msgid "If you selected \"none\", copy and use these styles as you see fit:"
193
+ msgstr ""
194
+
195
+ #: class-qtranslate-slug-widget.php
196
+ msgid "Allows your visitors to choose a Language."
197
+ msgstr ""
qtranslate-slug.php CHANGED
@@ -3,8 +3,8 @@
3
  Plugin Name: qTranslate slug
4
  Plugin URI: http://not-only-code.github.com/qtranslate-slug/
5
  Description: Allows to define a slug for each language and some qTranslate bug fixes
6
- Version: 1.1.10
7
- Author: Carlos Sanz Garcia, Pedro Carvalho
8
  Author URI: http://github.com/not-only-code
9
  */
10
 
3
  Plugin Name: qTranslate slug
4
  Plugin URI: http://not-only-code.github.com/qtranslate-slug/
5
  Description: Allows to define a slug for each language and some qTranslate bug fixes
6
+ Version: 1.1.11
7
+ Author: Carlos Sanz Garcia, Pedro Carvalho
8
  Author URI: http://github.com/not-only-code
9
  */
10
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Qtranslate Slug ===
2
- Contributors: carlos_a_sanz, pedroghandi
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SYC46KSLRC4Q8
4
- Tags: qtranslate, slug, multilanguage
5
  Requires at least: 3.3
6
  Tested up to: 4.1
7
- Stable tag: 1.1.10
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,16 +12,20 @@ Adds support for permalink translations and fix some QTranslate deficiencies sin
12
 
13
  == Description ==
14
 
15
- [Qtranslate](http://wordpress.org/extend/plugins/qtranslate/) is a nice plugin but unfortunately today is **outdated**. **Qtranslate Slug** is an addon to QTranslate, which adds support for permalinks translations and fix some QTranslate deficiencies since wordpress 3.0.
16
 
17
  **Version 1.0** has been written from scratch using OOP. The code has been structured better, the functions have been marked and commented and everything is better integrated with Wordpress API.
18
 
19
  = Requirements: =
20
 
21
- * Wordpress 3.3 (PHP 5.2 and MySQL 5)
22
  * mQtranslate 2.6.2.4 or Qtranslate 2.5.8 ( soon qtranslate-x too )
23
 
24
- = New in Version 1.1.9 and 1.1.10 =
 
 
 
 
25
 
26
  Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
27
 
1
  === Qtranslate Slug ===
2
+ Contributors: carlos_a_sanz, pedroghandi
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SYC46KSLRC4Q8
4
+ Tags: qtranslate, slug, multilanguage, widget
5
  Requires at least: 3.3
6
  Tested up to: 4.1
7
+ Stable tag: 1.1.11
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ [Qtranslate](http://wordpress.org/extend/plugins/qtranslate/) is a nice plugin but unfortunately today is **outdated**. **Qtranslate Slug** is an addon to QTranslate, which adds support for permalinks translations and fix some QTranslate deficiencies since wordpress 3.0. Check out all the new forks from qtranslate!
16
 
17
  **Version 1.0** has been written from scratch using OOP. The code has been structured better, the functions have been marked and commented and everything is better integrated with Wordpress API.
18
 
19
  = Requirements: =
20
 
21
+ * Wordpress 3.3 (PHP 5.4 and MySQL 5)
22
  * mQtranslate 2.6.2.4 or Qtranslate 2.5.8 ( soon qtranslate-x too )
23
 
24
+ = New in Versions 1.1.10 and 1.1.11 =
25
+
26
+ * Fixing wrong commit to wp.org
27
+ * Clean deleted files
28
+ = New in Version 1.1.9 =
29
 
30
  Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
31
 
version.txt CHANGED
@@ -1,6 +1,8 @@
1
- = 1.1.10 =
 
 
2
 
3
- = 1.1.9 =
4
 
5
  Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
6
 
1
+ = 1.1.10 and 1.1.11 =
2
+ * Fixing wrong commit to wp.org
3
+ * Clean deleted files
4
 
5
+ = 1.1.9 and 1.1.10 =
6
 
7
  Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
8