TranslatePress – Translate Multilingual sites - Version 2.0.9

Version Description

  • Security improvements
  • Added option to translate content restricted by language in Elementor
  • Added filter to disable independent region hreflang tags
  • Improved notices in TP Settings
Download this release

Release Info

Developer razvan.mo
Plugin Icon 128x128 TranslatePress – Translate Multilingual sites
Version 2.0.9
Comparing to
See all releases

Code changes from version 2.0.8 to 2.0.9

assets/css/trp-back-end-style.css CHANGED
@@ -164,7 +164,7 @@ input.trp-translation-published{
164
 
165
  .warning,
166
  .trp-upsell-multiple-languages{
167
- border: 1px solid #a00;
168
  padding: 1rem;
169
  background: #fff;
170
  max-width:800px;
164
 
165
  .warning,
166
  .trp-upsell-multiple-languages{
167
+ border: 1px solid #FFEF00;
168
  padding: 1rem;
169
  background: #fff;
170
  max-width:800px;
class-translate-press.php CHANGED
@@ -58,7 +58,7 @@ class TRP_Translate_Press{
58
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
59
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
60
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
61
- define( 'TRP_PLUGIN_VERSION', '2.0.7' );
62
 
63
  wp_cache_add_non_persistent_groups(array('trp'));
64
 
58
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
59
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
60
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
61
+ define( 'TRP_PLUGIN_VERSION', '2.0.9' );
62
 
63
  wp_cache_add_non_persistent_groups(array('trp'));
64
 
includes/class-elementor-language-for-blocks.php CHANGED
@@ -127,6 +127,14 @@ class TRP_Elementor {
127
  )
128
  );
129
 
 
 
 
 
 
 
 
 
130
  $element->add_control(
131
  'trp_language_restriction_heading', array(
132
  'label' => __( 'Select language', 'translatepress-multilingual' ),
@@ -257,7 +265,7 @@ class TRP_Elementor {
257
 
258
  $settings = $element->get_settings();
259
 
260
- if( isset( $settings['trp_language_restriction'] ) && $settings['trp_language_restriction'] == 'yes' && !empty( $settings['trp_restricted_languages'] ) )
261
  $element->add_render_attribute( '_wrapper', 'data-no-translation' );
262
 
263
  }
127
  )
128
  );
129
 
130
+ $element->add_control(
131
+ 'trp_language_restriction_automatic_translation', array(
132
+ 'label' => __( 'Enable translation', 'translatepress-multilingual' ),
133
+ 'type' => Controls_Manager::SWITCHER,
134
+ 'description' => __( 'Allow translation to the corresponding language only if the content is written in the default language.', 'translatepress-multilingual' ),
135
+ )
136
+ );
137
+
138
  $element->add_control(
139
  'trp_language_restriction_heading', array(
140
  'label' => __( 'Select language', 'translatepress-multilingual' ),
265
 
266
  $settings = $element->get_settings();
267
 
268
+ if( isset( $settings['trp_language_restriction'] ) && $settings['trp_language_restriction'] == 'yes' && !empty( $settings['trp_restricted_languages'] ) && isset( $settings['trp_language_restriction_automatic_translation'] ) && $settings['trp_language_restriction_automatic_translation'] != 'yes')
269
  $element->add_render_attribute( '_wrapper', 'data-no-translation' );
270
 
271
  }
includes/class-error-manager.php CHANGED
@@ -120,7 +120,7 @@ class TRP_Error_Manager{
120
 
121
  $link = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
122
 
123
- if($link = 'trp_error_manager') {
124
  $this->clear_notification_from_db('disable_automatic_translations', null);
125
  }
126
 
120
 
121
  $link = isset( $_GET['page'] ) ? sanitize_text_field( $_GET['page'] ) : '';
122
 
123
+ if($link === 'trp_error_manager') {
124
  $this->clear_notification_from_db('disable_automatic_translations', null);
125
  }
126
 
includes/class-translation-manager.php CHANGED
@@ -822,7 +822,7 @@ class TRP_Translation_Manager
822
  $trp_translated_gettext_text = $trp_translated_gettext_texts[$domain . '::' . $text];
823
 
824
  if (!empty($trp_translated_gettext_text['translated']) && $translation != $trp_translated_gettext_text['translated']) {
825
- $translation = str_replace(trim($text), $trp_translated_gettext_text['translated'], $text);
826
  }
827
  $db_id = $trp_translated_gettext_text['id'];
828
  $found_in_db = true;
822
  $trp_translated_gettext_text = $trp_translated_gettext_texts[$domain . '::' . $text];
823
 
824
  if (!empty($trp_translated_gettext_text['translated']) && $translation != $trp_translated_gettext_text['translated']) {
825
+ $translation = trp_sanitize_string(str_replace(trim($text), $trp_translated_gettext_text['translated'], $text));
826
  }
827
  $db_id = $trp_translated_gettext_text['id'];
828
  $found_in_db = true;
includes/class-translation-render.php CHANGED
@@ -785,7 +785,7 @@ class TRP_Translation_Render{
785
  do_action( 'trp_set_translation_for_attribute', $nodes[$i]['node'], $accessor, $translated_strings[$i] );
786
  }else{
787
  $translateable_string = $this->maybe_correct_translatable_string( $translateable_string, $nodes[$i]['node']->$accessor );
788
- $nodes[$i]['node']->$accessor = str_replace( $translateable_string, $translated_strings[$i], $nodes[$i]['node']->$accessor );
789
  }
790
 
791
  }
785
  do_action( 'trp_set_translation_for_attribute', $nodes[$i]['node'], $accessor, $translated_strings[$i] );
786
  }else{
787
  $translateable_string = $this->maybe_correct_translatable_string( $translateable_string, $nodes[$i]['node']->$accessor );
788
+ $nodes[$i]['node']->$accessor = trp_sanitize_string( str_replace( $translateable_string, $translated_strings[$i], $nodes[$i]['node']->$accessor ) );
789
  }
790
 
791
  }
includes/class-upgrade.php CHANGED
@@ -769,7 +769,9 @@ class TRP_Upgrade {
769
 
770
  $notification_id = 'trp_add_ons_removal';
771
 
772
- $message = '<p style="padding-right:30px;">' . __( 'All individual TranslatePress add-on plugins have been discontinued and have been replaced with new Personal, Business and Developer versions of TranslatePress. Please log into the account page at <a href="https://translatepress.com/account/" target="_blank">translatepress.com</a> and download the new plugin and install it. Individual Add-ons will not receive updates anymore' , 'translatepress-multilingual' ) . '</p>';
 
 
773
  //make sure to use the trp_dismiss_admin_notification arg
774
  $message .= '<a href="' . add_query_arg(array('trp_dismiss_admin_notification' => $notification_id)) . '" type="button" class="notice-dismiss" style="text-decoration: none;z-index:100;"><span class="screen-reader-text">' . esc_html__('Dismiss this notice.', 'translatepress-multilingual') . '</span></a>';
775
 
769
 
770
  $notification_id = 'trp_add_ons_removal';
771
 
772
+ $url_info = 'https://translatepress.com/docs/installation/upgrade-to-version-2-0-5-or-newer/';
773
+ $url_account = 'https://translatepress.com/account/';
774
+ $message = '<p style="padding-right:30px;">' . sprintf(__( 'All individual TranslatePress add-on plugins <a href="%1$s" target="_blank">have been discontinued</a> and are now included in the premium Personal, Business and Developer versions of TranslatePress. Please log into your <a href="%2$s" target="_blank">account page</a>, download the new premium version and install it. Your individual addons settings will be ported over.' , 'translatepress-multilingual' ), esc_url($url_info), esc_url($url_account)) . '</p>';
775
  //make sure to use the trp_dismiss_admin_notification arg
776
  $message .= '<a href="' . add_query_arg(array('trp_dismiss_admin_notification' => $notification_id)) . '" type="button" class="notice-dismiss" style="text-decoration: none;z-index:100;"><span class="screen-reader-text">' . esc_html__('Dismiss this notice.', 'translatepress-multilingual') . '</span></a>';
777
 
includes/class-url-converter.php CHANGED
@@ -148,41 +148,44 @@ class TRP_Url_Converter {
148
  /**
149
  * Add Hreflang entries for each language to Header.
150
  */
151
- public function add_hreflang_to_head(){
152
 
153
- // exclude hreflang for URL
154
- $default_language= $this->settings["default-language"];
155
- $original_url = str_replace('#TRPLINKPROCESSED', '', $this->get_url_for_language( $default_language ) ) ;
156
- if ( apply_filters('trp-exclude-hreflang', false, $original_url) ){
157
- return;
158
- }
159
 
160
  $languages = $this->settings['publish-languages'];
161
  if ( isset( $_GET['trp-edit-translation'] ) && $_GET['trp-edit-translation'] == 'preview' ) {
162
  $languages = $this->settings['translation-languages'];
163
  }
164
 
165
- $region_independent_languages = array();
166
- foreach ( $languages as $language ) {
167
- // hreflang should have - instead of _ . For example: en-EN, not en_EN like the locale
168
- $hreflang = str_replace('_', '-', $language);
169
- $hreflang = apply_filters('trp_hreflang', $hreflang, $language);
170
- echo '<link rel="alternate" hreflang="' . esc_attr( $hreflang ). '" href="' . esc_url( $this->get_url_for_language( $language ) ) . '"/>' . "\n";
171
 
172
- if ( strpos( $language, '_' ) !== false ){
173
- $language_independent_hreflang = strtok($language, '_');
174
- if( !empty( $language_independent_hreflang ) && !in_array( $language_independent_hreflang, $region_independent_languages ) ) {
175
- $region_independent_languages[] = $language_independent_hreflang;
176
- echo '<link rel="alternate" hreflang="' . esc_attr( $language_independent_hreflang ) . '" href="' . esc_url( $this->get_url_for_language( $language ) ) . '"/>' . "\n";
 
 
 
177
  }
178
  }
179
- }
180
 
181
- if( isset($this->settings['trp_advanced_settings']['enable_hreflang_xdefault']) && $this->settings['trp_advanced_settings']['enable_hreflang_xdefault'] != 'disabled' ){
182
- $default_lang = $this->settings['trp_advanced_settings']['enable_hreflang_xdefault'];
183
- echo '<link rel="alternate" hreflang="x-default" href="' . esc_url( $this->get_url_for_language( $default_lang ) ) . '"/>' . "\n";
 
184
  }
185
- }
186
 
187
  /**
188
  * Function that changes the lang attribute in the html tag to the current language.
148
  /**
149
  * Add Hreflang entries for each language to Header.
150
  */
151
+ public function add_hreflang_to_head() {
152
 
153
+ // exclude hreflang for URL
154
+ $default_language = $this->settings["default-language"];
155
+ $original_url = str_replace( '#TRPLINKPROCESSED', '', $this->get_url_for_language( $default_language ) );
156
+ if ( apply_filters( 'trp-exclude-hreflang', false, $original_url ) ) {
157
+ return;
158
+ }
159
 
160
  $languages = $this->settings['publish-languages'];
161
  if ( isset( $_GET['trp-edit-translation'] ) && $_GET['trp-edit-translation'] == 'preview' ) {
162
  $languages = $this->settings['translation-languages'];
163
  }
164
 
165
+ $region_independent_languages = array();
166
+ foreach ( $languages as $language ) {
167
+ // hreflang should have - instead of _ . For example: en-EN, not en_EN like the locale
168
+ $hreflang = str_replace( '_', '-', $language );
169
+ $hreflang = apply_filters( 'trp_hreflang', $hreflang, $language );
170
+ echo '<link rel="alternate" hreflang="' . esc_attr( $hreflang ) . '" href="' . esc_url( $this->get_url_for_language( $language ) ) . '"/>' . "\n";
171
 
172
+ if ( apply_filters( 'trp_add_region_independent_hreflang_tags', true ) ) {
173
+ if ( strpos( $language, '_' ) !== false ) {
174
+ $language_independent_hreflang = strtok( $language, '_' );
175
+ if ( !empty( $language_independent_hreflang ) && !in_array( $language_independent_hreflang, $region_independent_languages ) ) {
176
+ $region_independent_languages[] = $language_independent_hreflang;
177
+ echo '<link rel="alternate" hreflang="' . esc_attr( $language_independent_hreflang ) . '" href="' . esc_url( $this->get_url_for_language( $language ) ) . '"/>' . "\n";
178
+ }
179
+ }
180
  }
181
  }
 
182
 
183
+ if ( isset( $this->settings['trp_advanced_settings']['enable_hreflang_xdefault'] ) && $this->settings['trp_advanced_settings']['enable_hreflang_xdefault'] != 'disabled' ) {
184
+ $default_lang = $this->settings['trp_advanced_settings']['enable_hreflang_xdefault'];
185
+ echo '<link rel="alternate" hreflang="x-default" href="' . esc_url( $this->get_url_for_language( $default_lang ) ) . '"/>' . "\n";
186
+ }
187
  }
188
+
189
 
190
  /**
191
  * Function that changes the lang attribute in the html tag to the current language.
includes/functions.php CHANGED
@@ -166,7 +166,14 @@ function trp_sanitize_string( $filtered ){
166
  $filtered = trim( preg_replace('/ +/', ' ', $filtered) );
167
  }
168
 
169
- return $filtered;
 
 
 
 
 
 
 
170
  }
171
 
172
  /**
166
  $filtered = trim( preg_replace('/ +/', ' ', $filtered) );
167
  }
168
 
169
+ return trp_wp_kses( $filtered );
170
+ }
171
+
172
+ function trp_wp_kses($string){
173
+ if ( apply_filters('trp_apply_wp_kses_on_strings', true) ){
174
+ $string = wp_kses_post($string);
175
+ }
176
+ return $string;
177
  }
178
 
179
  /**
index.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: TranslatePress - Multilingual
4
  Plugin URI: https://translatepress.com/
5
  Description: Experience a better way of translating your WordPress site using a visual front-end translation editor, with full support for WooCommerce and site builders.
6
- Version: 2.0.8
7
  Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
  Author URI: https://cozmoslabs.com/
9
  Text Domain: translatepress-multilingual
10
  Domain Path: /languages
11
  License: GPL2
12
  WC requires at least: 2.5.0
13
- WC tested up to: 5.5.2
14
 
15
  == Copyright ==
16
  Copyright 2017 Cozmoslabs (www.cozmoslabs.com)
3
  Plugin Name: TranslatePress - Multilingual
4
  Plugin URI: https://translatepress.com/
5
  Description: Experience a better way of translating your WordPress site using a visual front-end translation editor, with full support for WooCommerce and site builders.
6
+ Version: 2.0.9
7
  Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
  Author URI: https://cozmoslabs.com/
9
  Text Domain: translatepress-multilingual
10
  Domain Path: /languages
11
  License: GPL2
12
  WC requires at least: 2.5.0
13
+ WC tested up to: 5.6.0
14
 
15
  == Copyright ==
16
  Copyright 2017 Cozmoslabs (www.cozmoslabs.com)
languages/translatepress-multilingual.catalog.php CHANGED
@@ -27,6 +27,8 @@
27
  <?php __("Exclude from Language", "translatepress-multilingual"); ?>
28
  <?php __("Restrict element to language", "translatepress-multilingual"); ?>
29
  <?php __("Show this element only in one language.", "translatepress-multilingual"); ?>
 
 
30
  <?php __("Select language", "translatepress-multilingual"); ?>
31
  <?php __("Choose in which language to show this element.", "translatepress-multilingual"); ?>
32
  <?php __("Exclude element from language", "translatepress-multilingual"); ?>
@@ -206,7 +208,7 @@
206
  <?php __("If the page does not redirect automatically", "translatepress-multilingual"); ?>
207
  <?php __("click here", "translatepress-multilingual"); ?>
208
  <?php __("Recreated original strings table.", "translatepress-multilingual"); ?>
209
- <?php __("All individual TranslatePress add-on plugins have been discontinued and have been replaced with new Personal, Business and Developer versions of TranslatePress. Please log into the account page at <a href=\"https://translatepress.com/account/\" target=\"_blank\">translatepress.com</a> and download the new plugin and install it. Individual Add-ons will not receive updates anymore", "translatepress-multilingual"); ?>
210
  <?php __("TranslatePress", "translatepress-multilingual"); ?>
211
  <?php __("<strong>TranslatePress</strong> requires <strong><a href=\"http://php.net/manual/en/book.mbstring.php\">Multibyte String PHP library</a></strong>. Please contact your server administrator to install it on your server.", "translatepress-multilingual"); ?>
212
  <?php __("Detected long query limitation on WPEngine hosting. Some large pages may appear untranslated. You can remove limitation by adding the following to your site’s wp-config.php: define( 'WPE_GOVERNOR', false ); ", "translatepress-multilingual"); ?>
@@ -241,7 +243,7 @@
241
  <?php __("Save Changes", "translatepress-multilingual"); ?>
242
  <?php __("TranslatePress Errors", "translatepress-multilingual"); ?>
243
  <?php __("There are no logged errors.", "translatepress-multilingual"); ?>
244
- <?php __("If you purchased a premium version, first install and activate any of the <a href=\"%s\">Advanced or Pro Addons</a>. After this you will be prompted with an input to enter your license key.", "translatepress-multilingual"); ?>
245
  <?php __("License Key", "translatepress-multilingual"); ?>
246
  <?php __("Activate License", "translatepress-multilingual"); ?>
247
  <?php __("Deactivate License", "translatepress-multilingual"); ?>
@@ -254,9 +256,11 @@
254
  <?php __("Enable or disable the automatic translation of the site. To minimize translation costs, each untranslated string is automatically translated only once, then stored in the database.", "translatepress-multilingual"); ?>
255
  <?php __("Translation Engine", "translatepress-multilingual"); ?>
256
  <?php __("Choose which engine you want to use in order to automatically translate your website.", "translatepress-multilingual"); ?>
 
257
  <?php __("<strong>DeepL</strong> automatic translation is available as a <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>.", "translatepress-multilingual"); ?>
258
- <?php __("TranslatePress Pro Add-on", "translatepress-multilingual"); ?>
259
  <?php __("By upgrading you'll get access to all paid add-ons, premium support and help fund the future development of TranslatePress.", "translatepress-multilingual"); ?>
 
 
260
  <?php __("Please note that DeepL API usage is paid separately. See <a href=\"https://www.deepl.com/pro.html#developer\">DeepL pricing information</a>.", "translatepress-multilingual"); ?>
261
  <?php __("TranslatePress Pro Add-ons", "translatepress-multilingual"); ?>
262
  <?php __("Test API credentials", "translatepress-multilingual"); ?>
27
  <?php __("Exclude from Language", "translatepress-multilingual"); ?>
28
  <?php __("Restrict element to language", "translatepress-multilingual"); ?>
29
  <?php __("Show this element only in one language.", "translatepress-multilingual"); ?>
30
+ <?php __("Enable translation", "translatepress-multilingual"); ?>
31
+ <?php __("Allow translation to the corresponding language only if the content is written in the default language.", "translatepress-multilingual"); ?>
32
  <?php __("Select language", "translatepress-multilingual"); ?>
33
  <?php __("Choose in which language to show this element.", "translatepress-multilingual"); ?>
34
  <?php __("Exclude element from language", "translatepress-multilingual"); ?>
208
  <?php __("If the page does not redirect automatically", "translatepress-multilingual"); ?>
209
  <?php __("click here", "translatepress-multilingual"); ?>
210
  <?php __("Recreated original strings table.", "translatepress-multilingual"); ?>
211
+ <?php __("All individual TranslatePress add-on plugins <a href=\"%1$s\" target=\"_blank\">have been discontinued</a> and are now included in the premium Personal, Business and Developer versions of TranslatePress. Please log into your <a href=\"%2$s\" target=\"_blank\">account page</a>, download the new premium version and install it. Your individual addons settings will be ported over.", "translatepress-multilingual"); ?>
212
  <?php __("TranslatePress", "translatepress-multilingual"); ?>
213
  <?php __("<strong>TranslatePress</strong> requires <strong><a href=\"http://php.net/manual/en/book.mbstring.php\">Multibyte String PHP library</a></strong>. Please contact your server administrator to install it on your server.", "translatepress-multilingual"); ?>
214
  <?php __("Detected long query limitation on WPEngine hosting. Some large pages may appear untranslated. You can remove limitation by adding the following to your site’s wp-config.php: define( 'WPE_GOVERNOR', false ); ", "translatepress-multilingual"); ?>
243
  <?php __("Save Changes", "translatepress-multilingual"); ?>
244
  <?php __("TranslatePress Errors", "translatepress-multilingual"); ?>
245
  <?php __("There are no logged errors.", "translatepress-multilingual"); ?>
246
+ <?php __("If you purchased a <a href=\"%s\">premium version</a>, first install and activate it. After this you will be prompted with an input to enter your license key.", "translatepress-multilingual"); ?>
247
  <?php __("License Key", "translatepress-multilingual"); ?>
248
  <?php __("Activate License", "translatepress-multilingual"); ?>
249
  <?php __("Deactivate License", "translatepress-multilingual"); ?>
256
  <?php __("Enable or disable the automatic translation of the site. To minimize translation costs, each untranslated string is automatically translated only once, then stored in the database.", "translatepress-multilingual"); ?>
257
  <?php __("Translation Engine", "translatepress-multilingual"); ?>
258
  <?php __("Choose which engine you want to use in order to automatically translate your website.", "translatepress-multilingual"); ?>
259
+ <?php __("To use <strong>DeepL</strong> for automatic translation, activate this Pro add-on from the <a href=\"%1$s\" target=\"_self\" title=\"%2$s\">%2$s</a>.", "translatepress-multilingual"); ?>
260
  <?php __("<strong>DeepL</strong> automatic translation is available as a <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>.", "translatepress-multilingual"); ?>
 
261
  <?php __("By upgrading you'll get access to all paid add-ons, premium support and help fund the future development of TranslatePress.", "translatepress-multilingual"); ?>
262
+ <?php __("TranslatePress Pro Add-on", "translatepress-multilingual"); ?>
263
+ <?php __("Addons tab", "translatepress-multilingual"); ?>
264
  <?php __("Please note that DeepL API usage is paid separately. See <a href=\"https://www.deepl.com/pro.html#developer\">DeepL pricing information</a>.", "translatepress-multilingual"); ?>
265
  <?php __("TranslatePress Pro Add-ons", "translatepress-multilingual"); ?>
266
  <?php __("Test API credentials", "translatepress-multilingual"); ?>
languages/translatepress-multilingual.pot CHANGED
@@ -37,7 +37,7 @@ msgstr ""
37
  msgid "Settings saved."
38
  msgstr ""
39
 
40
- #: includes/class-advanced-tab.php:307, includes/class-error-manager.php:172, partials/machine-translation-settings-page.php:13, partials/machine-translation-settings-page.php:88, partials/machine-translation-settings-page.php:121, partials/main-settings-page.php:41, partials/main-settings-page.php:54, partials/main-settings-page.php:67
41
  msgid "Yes"
42
  msgstr ""
43
 
@@ -125,35 +125,43 @@ msgstr ""
125
  msgid "Show this element only in one language."
126
  msgstr ""
127
 
128
- #: includes/class-elementor-language-for-blocks.php:132, includes/class-wp-bakery-language-for-blocks.php:106
 
 
 
 
 
 
 
 
129
  msgid "Select language"
130
  msgstr ""
131
 
132
- #: includes/class-elementor-language-for-blocks.php:149, includes/class-wp-bakery-language-for-blocks.php:110
133
  msgid "Choose in which language to show this element."
134
  msgstr ""
135
 
136
- #: includes/class-elementor-language-for-blocks.php:161
137
  msgid "Exclude element from language"
138
  msgstr ""
139
 
140
- #: includes/class-elementor-language-for-blocks.php:163, includes/class-wp-bakery-language-for-blocks.php:141
141
  msgid "Exclude this element from specific languages."
142
  msgstr ""
143
 
144
- #: includes/class-elementor-language-for-blocks.php:169, includes/class-wp-bakery-language-for-blocks.php:158
145
  msgid "Select languages"
146
  msgstr ""
147
 
148
- #: includes/class-elementor-language-for-blocks.php:187, includes/class-wp-bakery-language-for-blocks.php:162
149
  msgid "Choose from which languages to exclude this element."
150
  msgstr ""
151
 
152
- #: includes/class-elementor-language-for-blocks.php:191, includes/class-wp-bakery-language-for-blocks.php:146
153
  msgid "This element will still be visible when you are translating your website through the Translation Editor."
154
  msgstr ""
155
 
156
- #: includes/class-elementor-language-for-blocks.php:192, includes/class-wp-bakery-language-for-blocks.php:153
157
  msgid "The content of this element should be written in the default language."
158
  msgstr ""
159
 
@@ -165,7 +173,7 @@ msgstr ""
165
  msgid "Automatic translation has been disabled."
166
  msgstr ""
167
 
168
- #: includes/class-error-manager.php:146, includes/class-plugin-notices.php:341, includes/class-plugin-notices.php:392, includes/class-plugin-notices.php:373, includes/class-plugin-notices.php:406, includes/class-plugin-notices.php:431, includes/class-plugin-notices.php:455, includes/class-reviews.php:119, includes/class-reviews.php:122, includes/class-upgrade.php:774
169
  msgid "Dismiss this notice."
170
  msgstr ""
171
 
@@ -841,8 +849,8 @@ msgstr ""
841
  msgid "Recreated original strings table."
842
  msgstr ""
843
 
844
- #: includes/class-upgrade.php:772
845
- msgid "All individual TranslatePress add-on plugins have been discontinued and have been replaced with new Personal, Business and Developer versions of TranslatePress. Please log into the account page at <a href=\"https://translatepress.com/account/\" target=\"_blank\">translatepress.com</a> and download the new plugin and install it. Individual Add-ons will not receive updates anymore"
846
  msgstr ""
847
 
848
  #: includes/class-wp-bakery-language-for-blocks.php:179
@@ -969,7 +977,7 @@ msgstr ""
969
  msgid "TranslatePress Advanced Settings"
970
  msgstr ""
971
 
972
- #: partials/advanced-settings-page.php:16, partials/machine-translation-settings-page.php:132, partials/main-settings-page.php:123
973
  msgid "Save Changes"
974
  msgstr ""
975
 
@@ -982,7 +990,7 @@ msgid "There are no logged errors."
982
  msgstr ""
983
 
984
  #: partials/license-settings-page.php:48
985
- msgid "If you purchased a premium version, first install and activate any of the <a href=\"%s\">Advanced or Pro Addons</a>. After this you will be prompted with an input to enter your license key."
986
  msgstr ""
987
 
988
  #: partials/license-settings-page.php:14
@@ -1033,61 +1041,70 @@ msgstr ""
1033
  msgid "Choose which engine you want to use in order to automatically translate your website."
1034
  msgstr ""
1035
 
1036
- #. translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
1037
- #: partials/machine-translation-settings-page.php:49
1038
- msgid "<strong>DeepL</strong> automatic translation is available as a <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>."
1039
  msgstr ""
1040
 
1041
  #: partials/machine-translation-settings-page.php:51
 
 
 
 
 
 
 
 
 
1042
  msgctxt "Verbiage for the DeepL Pro Add-on"
1043
  msgid "TranslatePress Pro Add-on"
1044
  msgstr ""
1045
 
1046
- #: partials/machine-translation-settings-page.php:53
1047
- msgid "By upgrading you'll get access to all paid add-ons, premium support and help fund the future development of TranslatePress."
 
1048
  msgstr ""
1049
 
1050
- #: partials/machine-translation-settings-page.php:54
1051
  msgid "Please note that DeepL API usage is paid separately. See <a href=\"https://www.deepl.com/pro.html#developer\">DeepL pricing information</a>."
1052
  msgstr ""
1053
 
1054
- #: partials/machine-translation-settings-page.php:58
1055
  msgid "TranslatePress Pro Add-ons"
1056
  msgstr ""
1057
 
1058
- #: partials/machine-translation-settings-page.php:73
1059
  msgid "Test API credentials"
1060
  msgstr ""
1061
 
1062
- #: partials/machine-translation-settings-page.php:75
1063
  msgid "Click here to check if the selected translation engine is configured correctly."
1064
  msgstr ""
1065
 
1066
- #: partials/machine-translation-settings-page.php:84
1067
  msgid "Block Crawlers"
1068
  msgstr ""
1069
 
1070
- #: partials/machine-translation-settings-page.php:91
1071
  msgid "Block crawlers from triggering automatic translations on your website."
1072
  msgstr ""
1073
 
1074
- #: partials/machine-translation-settings-page.php:97
1075
  msgid "Limit machine translation / characters per day"
1076
  msgstr ""
1077
 
1078
- #: partials/machine-translation-settings-page.php:103
1079
  msgid "Add a limit to the number of automatically translated characters so you can better budget your project."
1080
  msgstr ""
1081
 
1082
- #: partials/machine-translation-settings-page.php:109
1083
  msgid "Today's character count:"
1084
  msgstr ""
1085
 
1086
- #: partials/machine-translation-settings-page.php:117
1087
  msgid "Log machine translation queries."
1088
  msgstr ""
1089
 
1090
- #: partials/machine-translation-settings-page.php:124
1091
  msgid "Only enable for testing purposes. Can impact performance.<br>All records are stored in the wp_trp_machine_translation_log database table. Use a plugin like <a href=\"https://wordpress.org/plugins/wp-data-access/\">WP Data Access</a> to browse the logs or directly from your database manager (PHPMyAdmin, etc.)"
1092
  msgstr ""
1093
 
37
  msgid "Settings saved."
38
  msgstr ""
39
 
40
+ #: includes/class-advanced-tab.php:307, includes/class-error-manager.php:172, partials/machine-translation-settings-page.php:13, partials/machine-translation-settings-page.php:117, partials/machine-translation-settings-page.php:150, partials/main-settings-page.php:41, partials/main-settings-page.php:54, partials/main-settings-page.php:67
41
  msgid "Yes"
42
  msgstr ""
43
 
125
  msgid "Show this element only in one language."
126
  msgstr ""
127
 
128
+ #: includes/class-elementor-language-for-blocks.php:132
129
+ msgid "Enable translation"
130
+ msgstr ""
131
+
132
+ #: includes/class-elementor-language-for-blocks.php:134
133
+ msgid "Allow translation to the corresponding language only if the content is written in the default language."
134
+ msgstr ""
135
+
136
+ #: includes/class-elementor-language-for-blocks.php:140, includes/class-wp-bakery-language-for-blocks.php:106
137
  msgid "Select language"
138
  msgstr ""
139
 
140
+ #: includes/class-elementor-language-for-blocks.php:157, includes/class-wp-bakery-language-for-blocks.php:110
141
  msgid "Choose in which language to show this element."
142
  msgstr ""
143
 
144
+ #: includes/class-elementor-language-for-blocks.php:169
145
  msgid "Exclude element from language"
146
  msgstr ""
147
 
148
+ #: includes/class-elementor-language-for-blocks.php:171, includes/class-wp-bakery-language-for-blocks.php:141
149
  msgid "Exclude this element from specific languages."
150
  msgstr ""
151
 
152
+ #: includes/class-elementor-language-for-blocks.php:177, includes/class-wp-bakery-language-for-blocks.php:158
153
  msgid "Select languages"
154
  msgstr ""
155
 
156
+ #: includes/class-elementor-language-for-blocks.php:195, includes/class-wp-bakery-language-for-blocks.php:162
157
  msgid "Choose from which languages to exclude this element."
158
  msgstr ""
159
 
160
+ #: includes/class-elementor-language-for-blocks.php:199, includes/class-wp-bakery-language-for-blocks.php:146
161
  msgid "This element will still be visible when you are translating your website through the Translation Editor."
162
  msgstr ""
163
 
164
+ #: includes/class-elementor-language-for-blocks.php:200, includes/class-wp-bakery-language-for-blocks.php:153
165
  msgid "The content of this element should be written in the default language."
166
  msgstr ""
167
 
173
  msgid "Automatic translation has been disabled."
174
  msgstr ""
175
 
176
+ #: includes/class-error-manager.php:146, includes/class-plugin-notices.php:341, includes/class-plugin-notices.php:392, includes/class-plugin-notices.php:373, includes/class-plugin-notices.php:406, includes/class-plugin-notices.php:431, includes/class-plugin-notices.php:455, includes/class-reviews.php:119, includes/class-reviews.php:122, includes/class-upgrade.php:776
177
  msgid "Dismiss this notice."
178
  msgstr ""
179
 
849
  msgid "Recreated original strings table."
850
  msgstr ""
851
 
852
+ #: includes/class-upgrade.php:774
853
+ msgid "All individual TranslatePress add-on plugins <a href=\"%1$s\" target=\"_blank\">have been discontinued</a> and are now included in the premium Personal, Business and Developer versions of TranslatePress. Please log into your <a href=\"%2$s\" target=\"_blank\">account page</a>, download the new premium version and install it. Your individual addons settings will be ported over."
854
  msgstr ""
855
 
856
  #: includes/class-wp-bakery-language-for-blocks.php:179
977
  msgid "TranslatePress Advanced Settings"
978
  msgstr ""
979
 
980
+ #: partials/advanced-settings-page.php:16, partials/machine-translation-settings-page.php:161, partials/main-settings-page.php:123
981
  msgid "Save Changes"
982
  msgstr ""
983
 
990
  msgstr ""
991
 
992
  #: partials/license-settings-page.php:48
993
+ msgid "If you purchased a <a href=\"%s\">premium version</a>, first install and activate it. After this you will be prompted with an input to enter your license key."
994
  msgstr ""
995
 
996
  #: partials/license-settings-page.php:14
1041
  msgid "Choose which engine you want to use in order to automatically translate your website."
1042
  msgstr ""
1043
 
1044
+ #: partials/machine-translation-settings-page.php:58
1045
+ msgid "To use <strong>DeepL</strong> for automatic translation, activate this Pro add-on from the <a href=\"%1$s\" target=\"_self\" title=\"%2$s\">%2$s</a>."
 
1046
  msgstr ""
1047
 
1048
  #: partials/machine-translation-settings-page.php:51
1049
+ msgid "<strong>DeepL</strong> automatic translation is available as a <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>."
1050
+ msgstr ""
1051
+
1052
+ #: partials/machine-translation-settings-page.php:52
1053
+ msgid "By upgrading you'll get access to all paid add-ons, premium support and help fund the future development of TranslatePress."
1054
+ msgstr ""
1055
+
1056
+ #. translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
1057
+ #: partials/machine-translation-settings-page.php:73
1058
  msgctxt "Verbiage for the DeepL Pro Add-on"
1059
  msgid "TranslatePress Pro Add-on"
1060
  msgstr ""
1061
 
1062
+ #: partials/machine-translation-settings-page.php:67
1063
+ msgctxt "Verbiage for the DeepL Pro Add-on"
1064
+ msgid "Addons tab"
1065
  msgstr ""
1066
 
1067
+ #: partials/machine-translation-settings-page.php:80
1068
  msgid "Please note that DeepL API usage is paid separately. See <a href=\"https://www.deepl.com/pro.html#developer\">DeepL pricing information</a>."
1069
  msgstr ""
1070
 
1071
+ #: partials/machine-translation-settings-page.php:85
1072
  msgid "TranslatePress Pro Add-ons"
1073
  msgstr ""
1074
 
1075
+ #: partials/machine-translation-settings-page.php:102
1076
  msgid "Test API credentials"
1077
  msgstr ""
1078
 
1079
+ #: partials/machine-translation-settings-page.php:104
1080
  msgid "Click here to check if the selected translation engine is configured correctly."
1081
  msgstr ""
1082
 
1083
+ #: partials/machine-translation-settings-page.php:113
1084
  msgid "Block Crawlers"
1085
  msgstr ""
1086
 
1087
+ #: partials/machine-translation-settings-page.php:120
1088
  msgid "Block crawlers from triggering automatic translations on your website."
1089
  msgstr ""
1090
 
1091
+ #: partials/machine-translation-settings-page.php:126
1092
  msgid "Limit machine translation / characters per day"
1093
  msgstr ""
1094
 
1095
+ #: partials/machine-translation-settings-page.php:132
1096
  msgid "Add a limit to the number of automatically translated characters so you can better budget your project."
1097
  msgstr ""
1098
 
1099
+ #: partials/machine-translation-settings-page.php:138
1100
  msgid "Today's character count:"
1101
  msgstr ""
1102
 
1103
+ #: partials/machine-translation-settings-page.php:146
1104
  msgid "Log machine translation queries."
1105
  msgstr ""
1106
 
1107
+ #: partials/machine-translation-settings-page.php:153
1108
  msgid "Only enable for testing purposes. Can impact performance.<br>All records are stored in the wp_trp_machine_translation_log database table. Use a plugin like <a href=\"https://wordpress.org/plugins/wp-data-access/\">WP Data Access</a> to browse the logs or directly from your database manager (PHPMyAdmin, etc.)"
1109
  msgstr ""
1110
 
partials/license-settings-page.php CHANGED
@@ -45,5 +45,5 @@ if( !empty( $trp->active_pro_addons ) ){//if we have any Advanced or Pro addons
45
  <?php } else{ ?>
46
  <h1> <?php esc_html_e( 'TranslatePress Settings', 'translatepress-multilingual' );?></h1>
47
  <?php do_action ( 'trp_settings_navigation_tabs' ); ?>
48
- <h4><?php printf( __( 'If you purchased a premium version, first install and activate any of the <a href="%s">Advanced or Pro Addons</a>. After this you will be prompted with an input to enter your license key.', 'translatepress-multilingual' ), admin_url('/admin.php?page=trp_addons_page') ); //phpcs:ignore ?></h4>
49
  <?php } ?>
45
  <?php } else{ ?>
46
  <h1> <?php esc_html_e( 'TranslatePress Settings', 'translatepress-multilingual' );?></h1>
47
  <?php do_action ( 'trp_settings_navigation_tabs' ); ?>
48
+ <h4><?php printf( __( 'If you purchased a <a href="%s">premium version</a>, first install and activate it. After this you will be prompted with an input to enter your license key.', 'translatepress-multilingual' ), 'https://translatepress.com/pricing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=license-page&utm_campaign=TRP' ); //phpcs:ignore ?></h4>
49
  <?php } ?>
partials/machine-translation-settings-page.php CHANGED
@@ -37,26 +37,54 @@
37
  </td>
38
  </tr>
39
 
 
40
  <?php if( !class_exists( 'TRP_DeepL' ) && !class_exists( 'TRP_IN_DeepL' ) ) : ?>
41
  <tr style="display:none;">
42
  <th scope="row"></th>
43
  <td>
44
  <p class="trp-upsell-multiple-languages" id="trp-upsell-deepl">
 
45
  <?php
46
- $url = trp_add_affiliate_id_to_link('https://translatepress.com/?utm_source=wpbackend&utm_medium=clientsite&utm_content=deepl_upsell&utm_campaign=tpfree');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  $lnk = sprintf(
48
- // Translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
49
- __( '<strong>DeepL</strong> automatic translation is available as a <a href="%1$s" target="_blank" title="%2$s">%2$s</a>.', 'translatepress-multilingual' ),
50
- esc_url( $url ),
51
  _x( 'TranslatePress Pro Add-on', 'Verbiage for the DeepL Pro Add-on', 'translatepress-multilingual' )
52
  );
53
- $lnk .= '<br/><br />' . __( 'By upgrading you\'ll get access to all paid add-ons, premium support and help fund the future development of TranslatePress.', 'translatepress-multilingual' );
 
 
 
 
54
  $lnk .= '<br/><br />' . __( 'Please note that DeepL API usage is paid separately. See <a href="https://www.deepl.com/pro.html#developer">DeepL pricing information</a>.', 'translatepress-multilingual' );
55
- $lnk .= sprintf(
56
- '<br /><br />' . '<a href="%1$s" class="button button-primary" target="_blank" title="%2$s">%2$s</a>',
57
- esc_url( $url ),
58
- __( 'TranslatePress Pro Add-ons', 'translatepress-multilingual' )
59
- );
 
 
60
  echo wp_kses_post( $lnk ); // Post kses for more generalized output that is more forgiving and has late escaping.
61
  ?>
62
  </p>
@@ -64,6 +92,7 @@
64
  </tr>
65
  <?php endif; ?>
66
 
 
67
  <?php do_action ( 'trp_machine_translation_extra_settings_middle', $this->settings['trp_machine_translation_settings'] ); ?>
68
 
69
  <?php if( !empty( $machine_translator->get_api_key() ) ) : ?>
37
  </td>
38
  </tr>
39
 
40
+
41
  <?php if( !class_exists( 'TRP_DeepL' ) && !class_exists( 'TRP_IN_DeepL' ) ) : ?>
42
  <tr style="display:none;">
43
  <th scope="row"></th>
44
  <td>
45
  <p class="trp-upsell-multiple-languages" id="trp-upsell-deepl">
46
+
47
  <?php
48
+ //link and message in case the user has the free version of TranslatePress
49
+ if(( !class_exists('TRP_Handle_Included_Addons')) || (( defined('TRANSLATE_PRESS') && (TRANSLATE_PRESS !== 'TranslatePress - Developer' && TRANSLATE_PRESS !=='TranslatePress - Business' && TRANSLATE_PRESS !=='TranslatePress - Dev') )) ) :
50
+ $url = trp_add_affiliate_id_to_link('https://translatepress.com/pricing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=deepl_upsell&utm_campaign=tpfree');
51
+ $message = __( '<strong>DeepL</strong> automatic translation is available as a <a href="%1$s" target="_blank" title="%2$s">%2$s</a>.', 'translatepress-multilingual' );
52
+ $message_upgrade = __( 'By upgrading you\'ll get access to all paid add-ons, premium support and help fund the future development of TranslatePress.', 'translatepress-multilingual' );
53
+ ?>
54
+ <?php
55
+ //link and message in case the user has the pro version of TranslatePress
56
+ else:
57
+ $url = 'admin.php?page=trp_addons_page' ;
58
+ $message = __( 'To use <strong>DeepL</strong> for automatic translation, activate this Pro add-on from the <a href="%1$s" target="_self" title="%2$s">%2$s</a>.', 'translatepress-multilingual' );
59
+ $message_upgrade= "";
60
+ ?>
61
+ <?php endif; ?>
62
+ <?php
63
+ if(empty($message_upgrade)) {
64
+ $lnk = sprintf(
65
+ // Translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
66
+ $message, esc_url( $url ),
67
+ _x( 'Addons tab', 'Verbiage for the DeepL Pro Add-on', 'translatepress-multilingual' )
68
+ );
69
+ }else{
70
  $lnk = sprintf(
71
+ // Translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
72
+ $message, esc_url( $url ),
 
73
  _x( 'TranslatePress Pro Add-on', 'Verbiage for the DeepL Pro Add-on', 'translatepress-multilingual' )
74
  );
75
+ }
76
+
77
+ if(!empty($message_upgrade)) {
78
+ $lnk .= '<br/><br />' . $message_upgrade;
79
+ }
80
  $lnk .= '<br/><br />' . __( 'Please note that DeepL API usage is paid separately. See <a href="https://www.deepl.com/pro.html#developer">DeepL pricing information</a>.', 'translatepress-multilingual' );
81
+ if(!empty($message_upgrade)) {
82
+ $lnk .= sprintf(
83
+ '<br /><br />' . '<a href="%1$s" class="button button-primary" target="_blank" title="%2$s">%2$s</a>',
84
+ esc_url( $url ),
85
+ __( 'TranslatePress Pro Add-ons', 'translatepress-multilingual' )
86
+ );
87
+ }
88
  echo wp_kses_post( $lnk ); // Post kses for more generalized output that is more forgiving and has late escaping.
89
  ?>
90
  </p>
92
  </tr>
93
  <?php endif; ?>
94
 
95
+
96
  <?php do_action ( 'trp_machine_translation_extra_settings_middle', $this->settings['trp_machine_translation_settings'] ); ?>
97
 
98
  <?php if( !empty( $machine_translator->get_api_key() ) ) : ?>
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: translate, translation, multilingual, automatic translation, bilingual, fr
5
  Requires at least: 3.1.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6.20
8
- Stable tag: 2.0.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -140,6 +140,12 @@ For more information please check out our [documentation](https://translatepress
140
 
141
 
142
  == Changelog ==
 
 
 
 
 
 
143
  = 2.0.8 =
144
  * Corrected plugin name
145
 
5
  Requires at least: 3.1.0
6
  Tested up to: 5.8
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.0.9
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
140
 
141
 
142
  == Changelog ==
143
+ = 2.0.9 =
144
+ * Security improvements
145
+ * Added option to translate content restricted by language in Elementor
146
+ * Added filter to disable independent region hreflang tags
147
+ * Improved notices in TP Settings
148
+
149
  = 2.0.8 =
150
  * Corrected plugin name
151