TranslatePress – Translate Multilingual sites - Version 1.4.2

Version Description

  • Fixes the issue with not being able to publish pages when Use subdirectory for default language is set to yes and Gutenberg is installed
  • Fixed an issue with Elementor and Use subdirectory for default language set to yes
  • Fixed an issue with Yoast Premium and Use subdirectory for default language set to yes
  • Fixed missing spaces in translations for original gettext strings with untrimmed spaces
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 TranslatePress – Translate Multilingual sites
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

class-translate-press.php CHANGED
@@ -41,7 +41,7 @@ class TRP_Translate_Press{
41
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
42
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
43
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
44
- define( 'TRP_PLUGIN_VERSION', '1.4.1' );
45
 
46
  wp_cache_add_non_persistent_groups(array('trp'));
47
 
41
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
42
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
43
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
44
+ define( 'TRP_PLUGIN_VERSION', '1.4.2' );
45
 
46
  wp_cache_add_non_persistent_groups(array('trp'));
47
 
includes/class-query.php CHANGED
@@ -541,7 +541,7 @@ class TRP_Query{
541
  $values = array();
542
  foreach( $original_array as $string ){
543
  $placeholders[] = '%s';
544
- $values[] = trp_full_trim( $string );
545
  }
546
 
547
  $query .= "( " . implode ( ", ", $placeholders ) . " )";
541
  $values = array();
542
  foreach( $original_array as $string ){
543
  $placeholders[] = '%s';
544
+ $values[] = $string;
545
  }
546
 
547
  $query .= "( " . implode ( ", ", $placeholders ) . " )";
includes/class-translation-manager.php CHANGED
@@ -874,7 +874,7 @@ class TRP_Translation_Manager{
874
  $trp_translated_gettext_text = $trp_translated_gettext_texts[$domain . '::' . $text];
875
 
876
  if( !empty( $trp_translated_gettext_text['translated'] ) && $translation != $trp_translated_gettext_text['translated'] ) {
877
- $translation = $trp_translated_gettext_text['translated'];
878
  }
879
  $db_id = $trp_translated_gettext_text['id'];
880
  $found_in_db = true;
874
  $trp_translated_gettext_text = $trp_translated_gettext_texts[$domain . '::' . $text];
875
 
876
  if( !empty( $trp_translated_gettext_text['translated'] ) && $translation != $trp_translated_gettext_text['translated'] ) {
877
+ $translation = str_replace( trim($text), $trp_translated_gettext_text['translated'], $text );
878
  }
879
  $db_id = $trp_translated_gettext_text['id'];
880
  $found_in_db = true;
includes/class-url-converter.php CHANGED
@@ -67,6 +67,10 @@ class TRP_Url_Converter {
67
  $referrer = wp_unslash( $_SERVER['HTTP_REFERER'] );
68
  }
69
 
 
 
 
 
70
 
71
  /**
72
  * Check if this is a admin request. If true, it
67
  $referrer = wp_unslash( $_SERVER['HTTP_REFERER'] );
68
  }
69
 
70
+ //consider an admin request a call to the rest api that came from the admin area
71
+ if( false !== strpos( $current_url, '/wp-json/' ) && 0 === strpos( $referrer, $admin_url ) ){
72
+ return true;
73
+ }
74
 
75
  /**
76
  * Check if this is a admin request. If true, it
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: TranslatePress - Multilingual
4
  Plugin URI: https://translatepress.com/
5
  Description: Experience a better way of translating your WordPress site, with full support for WooCommerce and site builders.
6
- Version: 1.4.1
7
  Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
  Author URI: https://cozmoslabs.com/
9
  Text Domain: translatepress-multilingual
3
  Plugin Name: TranslatePress - Multilingual
4
  Plugin URI: https://translatepress.com/
5
  Description: Experience a better way of translating your WordPress site, with full support for WooCommerce and site builders.
6
+ Version: 1.4.2
7
  Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
  Author URI: https://cozmoslabs.com/
9
  Text Domain: translatepress-multilingual
languages/translatepress-multilingual.pot CHANGED
@@ -17,11 +17,11 @@ msgstr ""
17
  msgid "Error! Duplicate Url slug values."
18
  msgstr ""
19
 
20
- #: class-navigation-based-on-language.php:86
21
  msgid "Limit this menu item to the following languages"
22
  msgstr ""
23
 
24
- #: class-navigation-based-on-language.php:92, ../tp-add-on-extra-languages/partials/language-selector-pro.php:2, ../translatepress/partials/main-settings-language-selector.php:2
25
  msgid "All Languages"
26
  msgstr ""
27
 
@@ -29,51 +29,51 @@ msgstr ""
29
  msgid "The Yoast SEO Sitemaps will now contain the default language slug: example.com/en/sitemap_index.xml <br/> This works perfectly, just take it into account when you submit the sitemap to Google."
30
  msgstr ""
31
 
32
- #: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:37
33
  msgid "First by browser language, then IP address (recommended)"
34
  msgstr ""
35
 
36
- #: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:38
37
  msgid "First by IP address, then browser language"
38
  msgstr ""
39
 
40
- #: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:39
41
  msgid "Only by browser language"
42
  msgstr ""
43
 
44
- #: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:40
45
  msgid "Only by IP address"
46
  msgstr ""
47
 
48
- #: ../tp-add-on-automatic-language-detection/includes/class-ald-settings.php:110
49
  msgid "<div class=\"warning\">WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment.</div>"
50
  msgstr ""
51
 
52
- #: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:4, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:4, ../tp-add-on-extra-languages/partials/license-settings-page.php:4, partials/license-settings-page.php:4, ../tp-add-on-seo-pack/partials/license-settings-page.php:4, ../translatepress/partials/addons-settings-page.php:3, ../translatepress/partials/main-settings-page.php:5, ../translatepress/partials/test-google-key-settings-page.php:10, ../translatepress/partials/trp-remove-duplicate-rows.php:3, ../translatepress/partials/trp-update-database.php:3, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:4
53
  msgid "TranslatePress Settings"
54
  msgstr ""
55
 
56
- #: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:10, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:10, ../tp-add-on-extra-languages/partials/license-settings-page.php:10, partials/license-settings-page.php:10, ../tp-add-on-seo-pack/partials/license-settings-page.php:10, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:10
57
  msgid "License Key"
58
  msgstr ""
59
 
60
- #: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:15, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:15, ../tp-add-on-extra-languages/partials/license-settings-page.php:15, partials/license-settings-page.php:15, ../tp-add-on-seo-pack/partials/license-settings-page.php:15, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:15
61
  msgid "Enter your license key."
62
  msgstr ""
63
 
64
- #: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:22, ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:31, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:22, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:31, ../tp-add-on-extra-languages/partials/license-settings-page.php:22, ../tp-add-on-extra-languages/partials/license-settings-page.php:31, partials/license-settings-page.php:22, partials/license-settings-page.php:31, ../tp-add-on-seo-pack/partials/license-settings-page.php:22, ../tp-add-on-seo-pack/partials/license-settings-page.php:31, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:22, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:31
65
  msgid "Activate License"
66
  msgstr ""
67
 
68
- #: ../tp-add-on-automatic-language-detection/partials/license-settings-page.php:28, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:28, ../tp-add-on-extra-languages/partials/license-settings-page.php:28, partials/license-settings-page.php:28, ../tp-add-on-seo-pack/partials/license-settings-page.php:28, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:28
69
  msgid "Deactivate License"
70
  msgstr ""
71
 
72
- #: ../tp-add-on-automatic-language-detection/partials/settings-option.php:2
73
  msgid "Method of language detection"
74
  msgstr ""
75
 
76
- #: ../tp-add-on-automatic-language-detection/partials/settings-option.php:14
77
  msgid "Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies."
78
  msgstr ""
79
 
17
  msgid "Error! Duplicate Url slug values."
18
  msgstr ""
19
 
20
+ #: ../tp-add-on-navigation-based-on-language/class-navigation-based-on-language.php:86
21
  msgid "Limit this menu item to the following languages"
22
  msgstr ""
23
 
24
+ #: ../tp-add-on-navigation-based-on-language/class-navigation-based-on-language.php:92, ../tp-add-on-extra-languages/partials/language-selector-pro.php:2, ../translatepress/partials/main-settings-language-selector.php:2
25
  msgid "All Languages"
26
  msgstr ""
27
 
29
  msgid "The Yoast SEO Sitemaps will now contain the default language slug: example.com/en/sitemap_index.xml <br/> This works perfectly, just take it into account when you submit the sitemap to Google."
30
  msgstr ""
31
 
32
+ #: includes/class-ald-settings.php:37
33
  msgid "First by browser language, then IP address (recommended)"
34
  msgstr ""
35
 
36
+ #: includes/class-ald-settings.php:38
37
  msgid "First by IP address, then browser language"
38
  msgstr ""
39
 
40
+ #: includes/class-ald-settings.php:39
41
  msgid "Only by browser language"
42
  msgstr ""
43
 
44
+ #: includes/class-ald-settings.php:40
45
  msgid "Only by IP address"
46
  msgstr ""
47
 
48
+ #: includes/class-ald-settings.php:110
49
  msgid "<div class=\"warning\">WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment.</div>"
50
  msgstr ""
51
 
52
+ #: partials/license-settings-page.php:4, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:4, ../tp-add-on-extra-languages/partials/license-settings-page.php:4, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:4, ../tp-add-on-seo-pack/partials/license-settings-page.php:4, ../translatepress/partials/addons-settings-page.php:3, ../translatepress/partials/main-settings-page.php:5, ../translatepress/partials/test-google-key-settings-page.php:10, ../translatepress/partials/trp-remove-duplicate-rows.php:3, ../translatepress/partials/trp-update-database.php:3, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:4
53
  msgid "TranslatePress Settings"
54
  msgstr ""
55
 
56
+ #: partials/license-settings-page.php:10, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:10, ../tp-add-on-extra-languages/partials/license-settings-page.php:10, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:10, ../tp-add-on-seo-pack/partials/license-settings-page.php:10, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:10
57
  msgid "License Key"
58
  msgstr ""
59
 
60
+ #: partials/license-settings-page.php:15, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:15, ../tp-add-on-extra-languages/partials/license-settings-page.php:15, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:15, ../tp-add-on-seo-pack/partials/license-settings-page.php:15, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:15
61
  msgid "Enter your license key."
62
  msgstr ""
63
 
64
+ #: partials/license-settings-page.php:22, partials/license-settings-page.php:31, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:22, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:31, ../tp-add-on-extra-languages/partials/license-settings-page.php:22, ../tp-add-on-extra-languages/partials/license-settings-page.php:31, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:22, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:31, ../tp-add-on-seo-pack/partials/license-settings-page.php:22, ../tp-add-on-seo-pack/partials/license-settings-page.php:31, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:22, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:31
65
  msgid "Activate License"
66
  msgstr ""
67
 
68
+ #: partials/license-settings-page.php:28, ../tp-add-on-browse-as-other-roles/partials/license-settings-page.php:28, ../tp-add-on-extra-languages/partials/license-settings-page.php:28, ../tp-add-on-navigation-based-on-language/partials/license-settings-page.php:28, ../tp-add-on-seo-pack/partials/license-settings-page.php:28, ../trp-add-on-translator-accounts-add-on/partials/license-settings-page.php:28
69
  msgid "Deactivate License"
70
  msgstr ""
71
 
72
+ #: partials/settings-option.php:2
73
  msgid "Method of language detection"
74
  msgstr ""
75
 
76
+ #: partials/settings-option.php:14
77
  msgid "Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies."
78
  msgstr ""
79
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.cozmoslabs.com/
4
  Tags: translate, translation, multilingual, automatic translation, bilingual, front-end translation, google translate, language
5
  Requires at least: 3.1.0
6
  Tested up to: 5.0.3
7
- Stable tag: 1.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -125,6 +125,12 @@ For more information please check out [TranslatePress - Multilingual plugin docu
125
  6. Menu Language Switcher
126
 
127
  == Changelog ==
 
 
 
 
 
 
128
  = 1.4.1 =
129
  * Added PHP 7.3 support
130
  * Performance improvements
4
  Tags: translate, translation, multilingual, automatic translation, bilingual, front-end translation, google translate, language
5
  Requires at least: 3.1.0
6
  Tested up to: 5.0.3
7
+ Stable tag: 1.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
125
  6. Menu Language Switcher
126
 
127
  == Changelog ==
128
+ = 1.4.2 =
129
+ * Fixes the issue with not being able to publish pages when Use subdirectory for default language is set to yes and Gutenberg is installed
130
+ * Fixed an issue with Elementor and Use subdirectory for default language set to yes
131
+ * Fixed an issue with Yoast Premium and Use subdirectory for default language set to yes
132
+ * Fixed missing spaces in translations for original gettext strings with untrimmed spaces
133
+
134
  = 1.4.1 =
135
  * Added PHP 7.3 support
136
  * Performance improvements