qTranslate X - Version 2.9.6

Version Description

  • more fixes for <!--more--> and <!--nextpage--> tags and parsing multilingual texts.
Download this release

Release Info

Developer johnclause
Plugin Icon wp plugin qTranslate X
Version 2.9.6
Comparing to
See all releases

Code changes from version 2.9.5 to 2.9.6

qtranslate.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: qTranslate-X
4
  Plugin URI: http://wordpress.org/plugins/qtranslate-x/
5
  Description: Adds user-friendly and database-friendly multilingual content support into WordPress.
6
- Version: 2.9.5
7
  Author: John Clause based on original code by Qian Qin
8
  Author URI: http://qtranslatexteam.wordpress.com/about
9
  Tags: multilingual, multi, language, admin, tinymce, Polyglot, bilingual, widget, switcher, professional, human, translation, service, qTranslate, zTranslate, mqTranslate, qTranslate Plus, WPML
3
  Plugin Name: qTranslate-X
4
  Plugin URI: http://wordpress.org/plugins/qtranslate-x/
5
  Description: Adds user-friendly and database-friendly multilingual content support into WordPress.
6
+ Version: 2.9.6
7
  Author: John Clause based on original code by Qian Qin
8
  Author URI: http://qtranslatexteam.wordpress.com/about
9
  Tags: multilingual, multi, language, admin, tinymce, Polyglot, bilingual, widget, switcher, professional, human, translation, service, qTranslate, zTranslate, mqTranslate, qTranslate Plus, WPML
qtranslate_configuration.php CHANGED
@@ -359,7 +359,6 @@ function qtranxf_array_compare($a,$b) {
359
  return empty($diff_a) && empty($diff_b);
360
  }
361
 
362
- //this is not in use?
363
  function qtranxf_language_columns($columns) {
364
  return array(
365
  'flag' => __('Flag', 'qtranslate'),
@@ -369,7 +368,7 @@ function qtranxf_language_columns($columns) {
369
  'status3' => ''
370
  );
371
  }
372
- //add_filter('manage_language_columns', 'qtranxf_language_columns');
373
 
374
  function qtranxf_useAdminTermLib($obj) {
375
  if ($_SERVER["SCRIPT_NAME"]==="/wp-admin/edit-tags.php" &&
359
  return empty($diff_a) && empty($diff_b);
360
  }
361
 
 
362
  function qtranxf_language_columns($columns) {
363
  return array(
364
  'flag' => __('Flag', 'qtranslate'),
368
  'status3' => ''
369
  );
370
  }
371
+ add_filter('manage_language_columns', 'qtranxf_language_columns');
372
 
373
  function qtranxf_useAdminTermLib($obj) {
374
  if ($_SERVER["SCRIPT_NAME"]==="/wp-admin/edit-tags.php" &&
qtranslate_core.php CHANGED
@@ -983,34 +983,31 @@ function qtranxf_split($text, $quicktags = true) {
983
  }
984
  // split text at all language comments and quick tags
985
  $blocks = preg_split($split_regex, $text, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
986
- if(count($blocks)==1){
987
- $block=$blocks[0];
988
- //no languages, put it in all languages then
989
- foreach($q_config['enabled_languages'] as $language) {
990
- $result[$language] = $block;
 
 
 
 
 
 
 
 
 
 
 
991
  }
992
- }else{
993
- $current_language = false;
994
- foreach($blocks as $block) {
995
- # detect language tags
996
- if(preg_match("#^<!--:([a-z]{2})-->$#ism", $block, $matches)) {
997
- $current_language = $matches[1];
998
- if(!qtranxf_isEnabled($current_language)) $current_language = false;
999
- continue;
1000
- // detect quicktags
1001
- } elseif($quicktags && preg_match("#^\[:([a-z]{2})\]$#ism", $block, $matches)) {
1002
- $current_language = $matches[1];
1003
- if(!qtranxf_isEnabled($current_language)) $current_language = false;
1004
- continue;
1005
- // detect ending tags
1006
- } elseif(preg_match("#^<!--:-->$#ism", $block, $matches)) {
1007
- $current_language = false;
1008
- continue;
1009
- }
1010
- // correctly categorize text block
1011
- if(!$current_language) continue;
1012
  $result[$current_language] .= $block;
1013
  $current_language = false;
 
 
 
 
1014
  }
1015
  }
1016
  return $result;
983
  }
984
  // split text at all language comments and quick tags
985
  $blocks = preg_split($split_regex, $text, -1, PREG_SPLIT_NO_EMPTY|PREG_SPLIT_DELIM_CAPTURE);
986
+ $current_language = false;
987
+ foreach($blocks as $block) {
988
+ # detect language tags
989
+ if(preg_match("#^<!--:([a-z]{2})-->$#ism", $block, $matches)) {
990
+ $current_language = $matches[1];
991
+ if(!qtranxf_isEnabled($current_language)) $current_language = false;
992
+ continue;
993
+ // detect quicktags
994
+ } elseif($quicktags && preg_match("#^\[:([a-z]{2})\]$#ism", $block, $matches)) {
995
+ $current_language = $matches[1];
996
+ if(!qtranxf_isEnabled($current_language)) $current_language = false;
997
+ continue;
998
+ // detect ending tags
999
+ } elseif(preg_match("#^<!--:-->$#ism", $block, $matches)) {
1000
+ $current_language = false;
1001
+ continue;
1002
  }
1003
+ // correctly categorize text block
1004
+ if($current_language){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1005
  $result[$current_language] .= $block;
1006
  $current_language = false;
1007
+ }else{
1008
+ foreach($q_config['enabled_languages'] as $language) {
1009
+ $result[$language] .= $block;
1010
+ }
1011
  }
1012
  }
1013
  return $result;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: johnclause, chineseleper, Vavooon
4
  Tags: multilingual, language, admin, tinymce, bilingual, widget, switcher, i18n, l10n, multilanguage, translation
5
  Requires at least: 3.9
6
  Tested up to: 4.1
7
- Stable tag: 2.9.5
8
  License: GPLv3 or later
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QEXEK3HX8AR6U
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -150,8 +150,11 @@ One can find the original qTranslate FAQ [here](https://wordpress.org/plugins/qt
150
 
151
  == Changelog ==
152
 
 
 
 
153
  = 2.9.5 =
154
- * more fixes for <!--more--> and <!--nextpage--> tags.
155
 
156
  = 2.9.4 =
157
  * fix for https://wordpress.org/support/topic/comment-shows-404-error
@@ -171,7 +174,7 @@ One can find the original qTranslate FAQ [here](https://wordpress.org/plugins/qt
171
  = 2.9 =
172
  * ability to enable "Custom Fields" by either "id" or "class" attribute.
173
  * ability to specify filters, which other theme or plugins define, to pass relevant data through the translation.
174
- * support for <!--more--> and <!--nextpage--> tags.
175
  * language cookie are renamed to minimize possible interference with other sites.
176
 
177
  = 2.8 =
4
  Tags: multilingual, language, admin, tinymce, bilingual, widget, switcher, i18n, l10n, multilanguage, translation
5
  Requires at least: 3.9
6
  Tested up to: 4.1
7
+ Stable tag: 2.9.6
8
  License: GPLv3 or later
9
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QEXEK3HX8AR6U
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
150
 
151
  == Changelog ==
152
 
153
+ = 2.9.6 =
154
+ * more fixes for `<!--more-->` and `<!--nextpage-->` tags and parsing multilingual texts.
155
+
156
  = 2.9.5 =
157
+ * more fixes for `<!--more-->` and `<!--nextpage-->` tags.
158
 
159
  = 2.9.4 =
160
  * fix for https://wordpress.org/support/topic/comment-shows-404-error
174
  = 2.9 =
175
  * ability to enable "Custom Fields" by either "id" or "class" attribute.
176
  * ability to specify filters, which other theme or plugins define, to pass relevant data through the translation.
177
+ * support for `<!--more-->` and `<!--nextpage-->` tags.
178
  * language cookie are renamed to minimize possible interference with other sites.
179
 
180
  = 2.8 =