TranslatePress – Translate Multilingual sites - Version 2.2.3

Version Description

  • Fixed XSS security vulnerability
  • Fixed sitemap containing urls with language slugs linking to paths excluded from translation
  • Fixed issue affecting translation of some particular JSON requests
  • Fixed edge case error regarding MO objects
  • Moved Automatic translate slugs option to Automatic Translation tab
Download this release

Release Info

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

Code changes from version 2.2.2 to 2.2.3

assets/css/trp-back-end-style.css CHANGED
@@ -165,7 +165,8 @@ input.trp-translation-published{
165
 
166
 
167
  .warning,
168
- .trp-upsell-multiple-languages{
 
169
  border: 1px solid #FFEF00;
170
  padding: 1rem;
171
  background: #fff;
@@ -220,7 +221,7 @@ table.trp-adst-list-option th{
220
  }
221
 
222
  #trp_advanced_tab_content_table{
223
- margin-top: 25px;
224
  font-size: 15px;
225
  }
226
 
165
 
166
 
167
  .warning,
168
+ .trp-upsell-multiple-languages,
169
+ .trp-upsell-auto-translate-slugs{
170
  border: 1px solid #FFEF00;
171
  padding: 1rem;
172
  background: #fff;
221
  }
222
 
223
  #trp_advanced_tab_content_table{
224
+ margin-top: 40px;
225
  font-size: 15px;
226
  }
227
 
assets/css/trp-language-switcher.css CHANGED
@@ -87,14 +87,20 @@
87
  overflow: hidden;
88
  visibility: hidden;
89
  z-index: 1;
 
 
 
 
 
 
90
  }
91
 
92
  .trp-language-switcher:focus .trp-ls-shortcode-language,
93
  .trp-language-switcher:hover .trp-ls-shortcode-language{
 
94
  max-height: 250px;
95
  height: auto;
96
  overflow-y: auto;
97
- visibility:visible;
98
  position: absolute;
99
  left: 0;
100
  top: 0;
87
  overflow: hidden;
88
  visibility: hidden;
89
  z-index: 1;
90
+
91
+ max-height: 250px;
92
+ overflow-y: auto;
93
+ left: 0;
94
+ top: 0;
95
+ min-height: auto;
96
  }
97
 
98
  .trp-language-switcher:focus .trp-ls-shortcode-language,
99
  .trp-language-switcher:hover .trp-ls-shortcode-language{
100
+ visibility: visible;
101
  max-height: 250px;
102
  height: auto;
103
  overflow-y: auto;
 
104
  position: absolute;
105
  left: 0;
106
  top: 0;
assets/js/trp-clickable-ls.js CHANGED
@@ -1,23 +1,23 @@
1
- jQuery('.trp-ls-shortcode-current-language').click(function () {
2
- jQuery( '.trp-ls-shortcode-current-language' ).addClass('trp-ls-clicked');
3
- jQuery( '.trp-ls-shortcode-language' ).addClass('trp-ls-clicked');
4
  });
5
 
6
- jQuery('.trp-ls-shortcode-language').click(function () {
7
- jQuery( '.trp-ls-shortcode-current-language' ).removeClass('trp-ls-clicked');
8
- jQuery( '.trp-ls-shortcode-language' ).removeClass('trp-ls-clicked');
9
  });
10
 
11
  jQuery(document).keyup(function(e) {
12
  if (e.key === "Escape") {
13
- jQuery( '.trp-ls-shortcode-current-language' ).removeClass('trp-ls-clicked');
14
- jQuery( '.trp-ls-shortcode-language' ).removeClass('trp-ls-clicked');
15
  }
16
  });
17
 
18
  jQuery(document).on("click", function(event){
19
- if(!jQuery(event.target).closest(".trp-ls-shortcode-current-language").length){
20
- jQuery( '.trp-ls-shortcode-current-language' ).removeClass('trp-ls-clicked');
21
- jQuery( '.trp-ls-shortcode-language' ).removeClass('trp-ls-clicked');
22
  }
23
  });
1
+ jQuery('.trp_language_switcher_shortcode .trp-ls-shortcode-current-language').click(function () {
2
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-current-language' ).addClass('trp-ls-clicked');
3
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-language' ).addClass('trp-ls-clicked');
4
  });
5
 
6
+ jQuery('.trp_language_switcher_shortcode .trp-ls-shortcode-language').click(function () {
7
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-current-language' ).removeClass('trp-ls-clicked');
8
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-language' ).removeClass('trp-ls-clicked');
9
  });
10
 
11
  jQuery(document).keyup(function(e) {
12
  if (e.key === "Escape") {
13
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-current-language' ).removeClass('trp-ls-clicked');
14
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-language' ).removeClass('trp-ls-clicked');
15
  }
16
  });
17
 
18
  jQuery(document).on("click", function(event){
19
+ if(!jQuery(event.target).closest(".trp_language_switcher_shortcode .trp-ls-shortcode-current-language").length){
20
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-current-language' ).removeClass('trp-ls-clicked');
21
+ jQuery( '.trp_language_switcher_shortcode .trp-ls-shortcode-language' ).removeClass('trp-ls-clicked');
22
  }
23
  });
assets/lib/simplehtmldom/simple_html_dom.php CHANGED
@@ -509,15 +509,13 @@ class simple_html_dom_node
509
  {
510
  case TRP_HDOM_QUOTE_DOUBLE: $quote = '"'; break;
511
  case TRP_HDOM_QUOTE_SINGLE: $quote = '\''; break;
512
- default: $quote = '';
513
  /*
514
  * TranslatePress modifications
515
  * We changed the default $quote from '' to ' " ' to avoid JS security issue. There is a filter applied on this global, $TRP_HDOM_QUOTE_DEFAULT,
516
  * so it can be changed in case there is a problem for some clients.
517
-
518
  default: { global $TRP_HDOM_QUOTE_DEFAULT; $quote = $TRP_HDOM_QUOTE_DEFAULT; };
519
- */
520
- }
521
 
522
  $ret .= $key
523
  . $this->_[TRP_HDOM_INFO_SPACE][$i][1]
509
  {
510
  case TRP_HDOM_QUOTE_DOUBLE: $quote = '"'; break;
511
  case TRP_HDOM_QUOTE_SINGLE: $quote = '\''; break;
 
512
  /*
513
  * TranslatePress modifications
514
  * We changed the default $quote from '' to ' " ' to avoid JS security issue. There is a filter applied on this global, $TRP_HDOM_QUOTE_DEFAULT,
515
  * so it can be changed in case there is a problem for some clients.
516
+ */
517
  default: { global $TRP_HDOM_QUOTE_DEFAULT; $quote = $TRP_HDOM_QUOTE_DEFAULT; };
518
+ }
 
519
 
520
  $ret .= $key
521
  . $this->_[TRP_HDOM_INFO_SPACE][$i][1]
class-translate-press.php CHANGED
@@ -60,7 +60,7 @@ class TRP_Translate_Press{
60
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
61
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
62
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
63
- define( 'TRP_PLUGIN_VERSION', '2.2.2' );
64
 
65
  wp_cache_add_non_persistent_groups(array('trp'));
66
 
@@ -161,7 +161,7 @@ class TRP_Translate_Press{
161
  $this->install_plugins = new TRP_Install_Plugins();
162
  $this->reviews = new TRP_Reviews( $this->settings->get_settings() );
163
  $this->rewrite_rules = new TRP_Rewrite_Rules( $this->settings->get_settings() );
164
- $this->check_invalid_text = new TRP_Check_Invalid_Text();
165
  }
166
 
167
  /**
60
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
61
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
62
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
63
+ define( 'TRP_PLUGIN_VERSION', '2.2.3' );
64
 
65
  wp_cache_add_non_persistent_groups(array('trp'));
66
 
161
  $this->install_plugins = new TRP_Install_Plugins();
162
  $this->reviews = new TRP_Reviews( $this->settings->get_settings() );
163
  $this->rewrite_rules = new TRP_Rewrite_Rules( $this->settings->get_settings() );
164
+ $this->check_invalid_text = new TRP_Check_Invalid_Text( );
165
  }
166
 
167
  /**
includes/advanced-settings/do-not-translate-certain-paths.php CHANGED
@@ -191,6 +191,7 @@ function trp_exclude_include_do_not_redirect_on_excluded_pages( $redirect, $lang
191
  $replace = trailingslashit( home_url() );
192
 
193
  $current_slug = str_replace( $replace, '', trailingslashit( $url ) );
 
194
  $paths = explode("\n", str_replace("\r", "", $advanced_settings['translateable_content']['paths'] ) );
195
 
196
  // $array_slugs contains each part of $curent_slug split on "/"
@@ -343,7 +344,7 @@ function trp_exclude_include_filter_custom_links( $new_url, $url, $TRP_LANGUAGE,
343
 
344
  add_action( 'init', 'trp_exclude_include_add_sitemap_filter' );
345
  function trp_exclude_include_add_sitemap_filter(){
346
- if( defined( 'TRP_SP_PLUGIN_VERSION' ) && version_compare( TRP_SP_PLUGIN_VERSION, '1.3.6', '>=' ) )
347
  add_filter( 'trp_xml_sitemap_output_for_url', 'trp_exclude_include_filter_sitemap_links', 10, 6 );
348
  }
349
 
191
  $replace = trailingslashit( home_url() );
192
 
193
  $current_slug = str_replace( $replace, '', trailingslashit( $url ) );
194
+
195
  $paths = explode("\n", str_replace("\r", "", $advanced_settings['translateable_content']['paths'] ) );
196
 
197
  // $array_slugs contains each part of $curent_slug split on "/"
344
 
345
  add_action( 'init', 'trp_exclude_include_add_sitemap_filter' );
346
  function trp_exclude_include_add_sitemap_filter(){
347
+ if (class_exists('TRP_IN_Seo_Pack'))
348
  add_filter( 'trp_xml_sitemap_output_for_url', 'trp_exclude_include_filter_sitemap_links', 10, 6 );
349
  }
350
 
includes/advanced-settings/enable-auto-translate-slug.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
-
3
- add_filter( 'trp_register_advanced_settings', 'trp_register_enable_auto_translate_slug', 1070 );
4
- function trp_register_enable_auto_translate_slug( $settings_array ){
5
- $settings_array[] = array(
6
- 'name' => 'enable_auto_translate_slug',
7
- 'type' => 'checkbox',
8
- 'label' => esc_html__( 'Automatically translate slugs', 'translatepress-multilingual' ),
9
- 'description' => wp_kses( __( 'Generate automatic translations of slugs for posts, pages and Custom Post Types.<br/>Requires <a href="https://translatepress.com/docs/addons/seo-pack/" title="TranslatePress Add-on SEO Pack documentation" target="_blank"> SEO Pack Add-on</a> to be installed and activated.<br>The slugs will be automatically translated starting with the second refresh of each page.', 'translatepress-multilingual' ), array( 'br' => array(), 'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ) ) ),
10
- );
11
- return $settings_array;
12
- }
13
-
14
- add_filter('trp_machine_translate_slug', 'trp_enable_auto_translate_slug');
15
- function trp_enable_auto_translate_slug($allow) {
16
-
17
- $option = get_option( 'trp_advanced_settings', true );
18
- if ( isset( $option['enable_auto_translate_slug'] ) && $option['enable_auto_translate_slug'] === 'yes' ) {
19
- return true;
20
- }
21
- return $allow;
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/advanced-settings/open-language-switcher-shortcode-on-click.php CHANGED
@@ -14,20 +14,20 @@ function trp_open_language_switcher_shortcode_on_click( $settings_array ){
14
  function trp_lsclick_enqueue_scriptandstyle() {
15
  wp_enqueue_script('trp-clickable-ls-js', TRP_PLUGIN_URL . 'assets/js/trp-clickable-ls.js', array('jquery'), TRP_PLUGIN_VERSION, true );
16
 
17
- wp_add_inline_style('trp-language-switcher-style', '.trp-language-switcher .trp-ls-shortcode-current-language.trp-ls-clicked{
18
  visibility: hidden;
19
  }
20
 
21
- .trp-language-switcher:hover div.trp-ls-shortcode-current-language{
22
  visibility: visible;
23
  }
24
 
25
- .trp-language-switcher:hover div.trp-ls-shortcode-language{
26
  visibility: hidden;
27
  height: 1px;
28
  }
29
- .trp-language-switcher .trp-ls-shortcode-language.trp-ls-clicked,
30
- .trp-language-switcher:hover .trp-ls-shortcode-language.trp-ls-clicked{
31
  visibility:visible;
32
  height:auto;
33
  position: absolute;
14
  function trp_lsclick_enqueue_scriptandstyle() {
15
  wp_enqueue_script('trp-clickable-ls-js', TRP_PLUGIN_URL . 'assets/js/trp-clickable-ls.js', array('jquery'), TRP_PLUGIN_VERSION, true );
16
 
17
+ wp_add_inline_style('trp-language-switcher-style', '.trp_language_switcher_shortcode .trp-language-switcher .trp-ls-shortcode-current-language.trp-ls-clicked{
18
  visibility: hidden;
19
  }
20
 
21
+ .trp_language_switcher_shortcode .trp-language-switcher:hover div.trp-ls-shortcode-current-language{
22
  visibility: visible;
23
  }
24
 
25
+ .trp_language_switcher_shortcode .trp-language-switcher:hover div.trp-ls-shortcode-language{
26
  visibility: hidden;
27
  height: 1px;
28
  }
29
+ .trp_language_switcher_shortcode .trp-language-switcher .trp-ls-shortcode-language.trp-ls-clicked,
30
+ .trp_language_switcher_shortcode .trp-language-switcher:hover .trp-ls-shortcode-language.trp-ls-clicked{
31
  visibility:visible;
32
  height:auto;
33
  position: absolute;
includes/class-advanced-tab.php CHANGED
@@ -210,7 +210,6 @@ class TRP_Advanced_Tab {
210
 
211
  public function include_custom_codes(){
212
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/disable-dynamic-translation.php');
213
- include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/enable-auto-translate-slug.php');
214
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/force-slash-at-end-of-links.php');
215
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/enable-numerals-translation.php');
216
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/custom-date-format.php');
@@ -242,7 +241,9 @@ class TRP_Advanced_Tab {
242
 
243
  function trp_advanced_settings_content_table(){
244
  $advanced_settings_array = $this->get_registered_advanced_settings();
 
245
  $html = '<p id="trp_advanced_tab_content_table">';
 
246
  foreach( $advanced_settings_array as $setting ){
247
  if ( $setting['type'] !== 'separator' ){
248
  continue;
210
 
211
  public function include_custom_codes(){
212
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/disable-dynamic-translation.php');
 
213
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/force-slash-at-end-of-links.php');
214
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/enable-numerals-translation.php');
215
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/custom-date-format.php');
241
 
242
  function trp_advanced_settings_content_table(){
243
  $advanced_settings_array = $this->get_registered_advanced_settings();
244
+
245
  $html = '<p id="trp_advanced_tab_content_table">';
246
+ $advanced_settings_array = apply_filters('trp_advanced_tab_add_element', $advanced_settings_array);
247
  foreach( $advanced_settings_array as $setting ){
248
  if ( $setting['type'] !== 'separator' ){
249
  continue;
includes/class-machine-translation-tab.php CHANGED
@@ -9,6 +9,7 @@ class TRP_Machine_Translation_Tab {
9
  $this->settings = $settings;
10
 
11
  add_action( 'plugins_loaded', array( $this, 'add_upsell_filter' ) );
 
12
 
13
  }
14
 
@@ -60,26 +61,49 @@ class TRP_Machine_Translation_Tab {
60
  * Sanitize settings
61
  */
62
  public function sanitize_settings($mt_settings ){
63
- if( !empty( $mt_settings['machine-translation'] ) )
64
- $mt_settings['machine-translation'] = sanitize_text_field( $mt_settings['machine-translation'] );
 
 
 
 
 
 
 
 
 
 
65
  else
66
- $mt_settings['machine-translation'] = 'no';
67
 
68
- if( !empty( $mt_settings['translation-engine'] ) )
69
- $mt_settings['translation-engine'] = sanitize_text_field( $mt_settings['translation-engine'] );
70
  else
71
- $mt_settings['translation-engine'] = 'google_translate_v2';
72
 
73
- if($mt_settings['translation-engine'] == 'deepl_upsell' && !class_exists( 'TRP_DeepL' ) && !class_exists( 'TRP_IN_DeepL' )){
74
- $mt_settings['translation-engine'] = 'google_translate_v2';
75
  }
76
 
77
- if( !empty( $mt_settings['block-crawlers'] ) )
78
- $mt_settings['block-crawlers'] = sanitize_text_field( $mt_settings['block-crawlers'] );
79
  else
80
- $mt_settings['block-crawlers'] = 'no';
81
 
82
- return apply_filters( 'trp_machine_translation_sanitize_settings', $mt_settings );
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
  /*
@@ -143,6 +167,12 @@ class TRP_Machine_Translation_Tab {
143
  }
144
 
145
 
 
 
 
 
 
 
146
 
147
  public function display_unsupported_languages(){
148
  $trp = TRP_Translate_Press::get_trp_instance();
9
  $this->settings = $settings;
10
 
11
  add_action( 'plugins_loaded', array( $this, 'add_upsell_filter' ) );
12
+ add_filter( 'trp_machine_translate_slug', array( $this, 'add_enable_auto_translate_slug_filter' ) );
13
 
14
  }
15
 
61
  * Sanitize settings
62
  */
63
  public function sanitize_settings($mt_settings ){
64
+
65
+ $free_version = ( ( !class_exists( 'TRP_Handle_Included_Addons' ) ) || ( ( defined( 'TRANSLATE_PRESS' ) && ( TRANSLATE_PRESS !== 'TranslatePress - Developer' && TRANSLATE_PRESS !== 'TranslatePress - Business' && TRANSLATE_PRESS !== 'TranslatePress - Dev' && TRANSLATE_PRESS !== 'TranslatePress - Personal' ) ) ) );
66
+ $seo_pack_active = class_exists( 'TRP_IN_Seo_Pack');
67
+ $settings = array();
68
+ $machine_translation_keys = array( 'machine-translation', 'translation-engine', 'google-translate-key', 'deepl-api-type', 'deepl-api-key', 'block-crawlers', 'automatically-translate-slug', 'machine_translation_limit', 'machine_translation_log' );
69
+ foreach( $machine_translation_keys as $key ){
70
+ if( isset( $mt_settings[$key] ) ){
71
+ $settings[$key] = $mt_settings[$key];
72
+ }
73
+ }
74
+ if( !empty( $settings['machine-translation'] ) )
75
+ $settings['machine-translation'] = sanitize_text_field( $settings['machine-translation'] );
76
  else
77
+ $settings['machine-translation'] = 'no';
78
 
79
+ if( !empty( $settings['translation-engine'] ) )
80
+ $settings['translation-engine'] = sanitize_text_field( $settings['translation-engine'] );
81
  else
82
+ $settings['translation-engine'] = 'google_translate_v2';
83
 
84
+ if($settings['translation-engine'] == 'deepl_upsell' && !class_exists( 'TRP_DeepL' ) && !class_exists( 'TRP_IN_DeepL' )){
85
+ $settings['translation-engine'] = 'google_translate_v2';
86
  }
87
 
88
+ if( !empty( $settings['block-crawlers'] ) )
89
+ $settings['block-crawlers'] = sanitize_text_field( $settings['block-crawlers'] );
90
  else
91
+ $settings['block-crawlers'] = 'no';
92
 
93
+ if( $free_version || !$seo_pack_active ){
94
+ $mt_settings_option = get_option( 'trp_machine_translation_settings' );
95
+ if( isset( $mt_settings_option['automatically-translate-slug'] ) ){
96
+ $settings['automatically-translate-slug'] = $mt_settings_option['automatically-translate-slug'];
97
+ }
98
+ }
99
+ else{
100
+ if( !empty( $settings['automatically-translate-slug'] ) )
101
+ $settings['automatically-translate-slug'] = sanitize_text_field( $settings['automatically-translate-slug'] );
102
+ else
103
+ $settings['automatically-translate-slug'] = 'no';
104
+ }
105
+
106
+ return apply_filters( 'trp_machine_translation_sanitize_settings', $settings );
107
  }
108
 
109
  /*
167
  }
168
 
169
 
170
+ public function add_enable_auto_translate_slug_filter( $allow ){
171
+ if( isset( $this->settings['trp_machine_translation_settings']['automatically-translate-slug'] ) && $this->settings['trp_machine_translation_settings']['automatically-translate-slug'] == 'yes' ){
172
+ $allow = true;
173
+ }
174
+ return $allow;
175
+ }
176
 
177
  public function display_unsupported_languages(){
178
  $trp = TRP_Translate_Press::get_trp_instance();
includes/class-settings.php CHANGED
@@ -411,6 +411,7 @@ class TRP_Settings{
411
  'machine-translation' => 'no',
412
  'translation-engine' => 'google_translate_v2',
413
  'block-crawlers' => 'yes',
 
414
  'machine_translation_counter_date' => date ("Y-m-d" ),
415
  'machine_translation_counter' => 0,
416
  'machine_translation_limit' => 1000000
411
  'machine-translation' => 'no',
412
  'translation-engine' => 'google_translate_v2',
413
  'block-crawlers' => 'yes',
414
+ 'automatically-translate-slug' => 'yes',
415
  'machine_translation_counter_date' => date ("Y-m-d" ),
416
  'machine_translation_counter' => 0,
417
  'machine_translation_limit' => 1000000
includes/class-translation-manager.php CHANGED
@@ -618,14 +618,18 @@ class TRP_Translation_Manager
618
 
619
  global $l10n;
620
  if ( isset( $l10n[$domain] ) && is_object( $l10n[$domain] ) ) {
621
- $mo_filename = $l10n[$domain]->get_filename();
622
 
623
- // $mo_filename does not end with string $locale
624
- if ( substr( strtolower( $mo_filename ), -$length ) == strtolower( $localemo ) ) {
625
- return true;
626
- }else{
627
- return false;
 
 
 
628
  }
 
629
  }
630
 
631
  // if something is not as expected, return true so that we do not interfere
618
 
619
  global $l10n;
620
  if ( isset( $l10n[$domain] ) && is_object( $l10n[$domain] ) ) {
621
+ $mo_filename = $l10n[ $domain ]->get_filename();
622
 
623
+ if ( is_string($mo_filename) ) {
624
+
625
+ // $mo_filename does not end with string $locale
626
+ if ( substr( strtolower( $mo_filename ), -$length ) == strtolower( $localemo ) ) {
627
+ return true;
628
+ } else {
629
+ return false;
630
+ }
631
  }
632
+ return true;
633
  }
634
 
635
  // if something is not as expected, return true so that we do not interfere
includes/class-upgrade.php CHANGED
@@ -79,6 +79,14 @@ class TRP_Upgrade {
79
  if ( version_compare($stored_database_version, '2.1.2', '<=')){
80
  $this->create_opposite_ls_option();
81
  }
 
 
 
 
 
 
 
 
82
  }
83
 
84
  // don't update the db version unless they are different. Otherwise the query is run on every page load.
@@ -87,6 +95,20 @@ class TRP_Upgrade {
87
  }
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  /**
91
  * Iterates over all languages to call gettext table checking
92
  */
79
  if ( version_compare($stored_database_version, '2.1.2', '<=')){
80
  $this->create_opposite_ls_option();
81
  }
82
+ if( version_compare( $stored_database_version, '2.2.2', '<=' ) ){
83
+ $this->migrate_auto_translate_slug_to_automatic_translation();
84
+ }
85
+ /**
86
+ * Write an upgrading function above this comment to be executed only once: while updating plugin to a higher version.
87
+ * Use example condition: version_compare( $stored_database_version, '2.9.9', '<=')
88
+ * where 2.9.9 is the current version, and 3.0.0 will be the updated version where this code will be launched.
89
+ */
90
  }
91
 
92
  // don't update the db version unless they are different. Otherwise the query is run on every page load.
95
  }
96
  }
97
 
98
+ public function migrate_auto_translate_slug_to_automatic_translation(){
99
+ $option = get_option( 'trp_advanced_settings', true );
100
+ $mt_settings_option = get_option( 'trp_machine_translation_settings' );
101
+ if( !isset( $mt_settings_option['automatically-translate-slug'] ) ){
102
+ if( !isset( $option['enable_auto_translate_slug'] ) || $option['enable_auto_translate_slug'] == '' || $option['enable_auto_translate_slug'] == 'no' ){
103
+ $mt_settings_option['automatically-translate-slug'] = 'no';
104
+ }
105
+ else{
106
+ $mt_settings_option['automatically-translate-slug'] = 'yes';
107
+ }
108
+ update_option( 'trp_machine_translation_settings', $mt_settings_option );
109
+ }
110
+ }
111
+
112
  /**
113
  * Iterates over all languages to call gettext table checking
114
  */
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.2.2
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: 6.2.1
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.2.3
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: 6.3.1
14
 
15
  == Copyright ==
16
  Copyright 2017 Cozmoslabs (www.cozmoslabs.com)
languages/translatepress-multilingual.catalog.php CHANGED
@@ -280,6 +280,11 @@
280
  <?php __("Click here to check if the selected translation engine is configured correctly.", "translatepress-multilingual"); ?>
281
  <?php __("Block Crawlers", "translatepress-multilingual"); ?>
282
  <?php __("Block crawlers from triggering automatic translations on your website.", "translatepress-multilingual"); ?>
 
 
 
 
 
283
  <?php __("Limit machine translation / characters per day", "translatepress-multilingual"); ?>
284
  <?php __("Add a limit to the number of automatically translated characters so you can better budget your project.", "translatepress-multilingual"); ?>
285
  <?php __("Today's character count:", "translatepress-multilingual"); ?>
@@ -377,8 +382,6 @@
377
  <?php __("Choose what paths can be translated. Supports wildcard at the end of the path.<br>For example, to exclude https://example.com/some/path you can either use the rule /some/path/ or /some/*.<br>Enter each rule on it's own line. To exclude the home page use {{home}}.", "translatepress-multilingual"); ?>
378
  <?php __("Exclude Paths From Translation", "translatepress-multilingual"); ?>
379
  <?php __("Translate Only Certain Paths", "translatepress-multilingual"); ?>
380
- <?php __("Automatically translate slugs", "translatepress-multilingual"); ?>
381
- <?php __("Generate automatic translations of slugs for posts, pages and Custom Post Types.<br/>Requires <a href=\"https://translatepress.com/docs/addons/seo-pack/\" title=\"TranslatePress Add-on SEO Pack documentation\" target=\"_blank\"> SEO Pack Add-on</a> to be installed and activated.<br>The slugs will be automatically translated starting with the second refresh of each page.", "translatepress-multilingual"); ?>
382
  <?php __("Enable the hreflang x-default tag for language:", "translatepress-multilingual"); ?>
383
  <?php __("Enables the hreflang=\"x-default\" for an entire language. See documentation for more details.", "translatepress-multilingual"); ?>
384
  <?php __("Translate numbers and numerals", "translatepress-multilingual"); ?>
@@ -474,9 +477,21 @@
474
  <?php __("First by IP address, then by browser language", "translatepress-multilingual"); ?>
475
  <?php __("Only by browser language", "translatepress-multilingual"); ?>
476
  <?php __("Only by IP address", "translatepress-multilingual"); ?>
 
 
 
 
477
  <?php __("WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment.", "translatepress-multilingual"); ?>
 
478
  <?php __("Method of language detection", "translatepress-multilingual"); ?>
479
  <?php __("Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies.", "translatepress-multilingual"); ?>
 
 
 
 
 
 
 
480
  <?php __("Bad request. There was an error accessing the DeepL API.", "translatepress-multilingual"); ?>
481
  <?php __("The API key entered is invalid.", "translatepress-multilingual"); ?>
482
  <?php __("The API resource could not be found.", "translatepress-multilingual"); ?>
280
  <?php __("Click here to check if the selected translation engine is configured correctly.", "translatepress-multilingual"); ?>
281
  <?php __("Block Crawlers", "translatepress-multilingual"); ?>
282
  <?php __("Block crawlers from triggering automatic translations on your website.", "translatepress-multilingual"); ?>
283
+ <?php __("Automatically Translate Slugs", "translatepress-multilingual"); ?>
284
+ <?php __("Generate automatic translations of slugs for posts, pages and Custom Post Types.<br/>The slugs will be automatically translated starting with the second refresh of each page.", "translatepress-multilingual"); ?>
285
+ <?php __("This feature is available only in the paid version. <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a> and unlock more premium features.", "translatepress-multilingual"); ?>
286
+ <?php __("Upgrade TranslatePress", "translatepress-multilingual"); ?>
287
+ <?php __("<br/>Requires <a href=\"https://translatepress.com/docs/addons/seo-pack/\" title=\"TranslatePress Add-on SEO Pack documentation\" target=\"_blank\"> SEO Pack Add-on</a> to be installed and activated.", "translatepress-multilingual"); ?>
288
  <?php __("Limit machine translation / characters per day", "translatepress-multilingual"); ?>
289
  <?php __("Add a limit to the number of automatically translated characters so you can better budget your project.", "translatepress-multilingual"); ?>
290
  <?php __("Today's character count:", "translatepress-multilingual"); ?>
382
  <?php __("Choose what paths can be translated. Supports wildcard at the end of the path.<br>For example, to exclude https://example.com/some/path you can either use the rule /some/path/ or /some/*.<br>Enter each rule on it's own line. To exclude the home page use {{home}}.", "translatepress-multilingual"); ?>
383
  <?php __("Exclude Paths From Translation", "translatepress-multilingual"); ?>
384
  <?php __("Translate Only Certain Paths", "translatepress-multilingual"); ?>
 
 
385
  <?php __("Enable the hreflang x-default tag for language:", "translatepress-multilingual"); ?>
386
  <?php __("Enables the hreflang=\"x-default\" for an entire language. See documentation for more details.", "translatepress-multilingual"); ?>
387
  <?php __("Translate numbers and numerals", "translatepress-multilingual"); ?>
477
  <?php __("First by IP address, then by browser language", "translatepress-multilingual"); ?>
478
  <?php __("Only by browser language", "translatepress-multilingual"); ?>
479
  <?php __("Only by IP address", "translatepress-multilingual"); ?>
480
+ <?php __("A popup appears asking the user if they want to be redirected", "translatepress-multilingual"); ?>
481
+ <?php __("Redirect directly (*not recommended)", "translatepress-multilingual"); ?>
482
+ <?php __("Pop-up window over the content", "translatepress-multilingual"); ?>
483
+ <?php __("Hello bar before the content", "translatepress-multilingual"); ?>
484
  <?php __("WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment.", "translatepress-multilingual"); ?>
485
+ <?php __("Go to <a href=\"%s\" target=\"_self\">Advanced</a> tab to change this feature's settings", "translatepress-multilingual"); ?>
486
  <?php __("Method of language detection", "translatepress-multilingual"); ?>
487
  <?php __("Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies.", "translatepress-multilingual"); ?>
488
+ <?php __("Pop-up to notify the user of the detected language", "translatepress-multilingual"); ?>
489
+ <?php __("Select the type of pop-up you wish to appear.", "translatepress-multilingual"); ?>
490
+ <?php __("Write the text you wish to appear in the pop-up.", "translatepress-multilingual"); ?>
491
+ <?php __("The same text is displayed in all languages. <br>A selecting language switcher will be appended to the pop-up. The detected language is pre-selected.", "translatepress-multilingual"); ?>
492
+ <?php __("Write the text you wish to appear on the button.", "translatepress-multilingual"); ?>
493
+ <?php __("Write the text you wish to appear on the close button. Leave empty for just the close button.", "translatepress-multilingual"); ?>
494
+ <?php __("Choose if you want the user to be redirected directly.<br>* Not recommended because it may cause indexing issues for search engines.", "translatepress-multilingual"); ?>
495
  <?php __("Bad request. There was an error accessing the DeepL API.", "translatepress-multilingual"); ?>
496
  <?php __("The API key entered is invalid.", "translatepress-multilingual"); ?>
497
  <?php __("The API resource could not be found.", "translatepress-multilingual"); ?>
languages/translatepress-multilingual.pot CHANGED
@@ -49,23 +49,23 @@ msgstr ""
49
  msgid "Settings saved."
50
  msgstr ""
51
 
52
- #: includes/class-advanced-tab.php:318, 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:42, partials/main-settings-page.php:55, partials/main-settings-page.php:68
53
  msgid "Yes"
54
  msgstr ""
55
 
56
- #: includes/class-advanced-tab.php:528, includes/class-advanced-tab.php:539, includes/class-advanced-tab.php:633, includes/class-advanced-tab.php:664
57
  msgid "Are you sure you want to remove this item?"
58
  msgstr ""
59
 
60
- #: includes/class-advanced-tab.php:528, includes/class-advanced-tab.php:539, includes/class-advanced-tab.php:633, includes/class-advanced-tab.php:664, partials/main-settings-language-selector.php:60, add-ons-advanced/extra-languages/partials/language-selector-pro.php:62
61
  msgid "Remove"
62
  msgstr ""
63
 
64
- #: includes/class-advanced-tab.php:539, includes/class-advanced-tab.php:664, partials/main-settings-language-selector.php:102, add-ons-advanced/extra-languages/partials/language-selector-pro.php:103
65
  msgid "Add"
66
  msgstr ""
67
 
68
- #: includes/class-advanced-tab.php:617, includes/class-advanced-tab.php:651
69
  msgid "Select..."
70
  msgstr ""
71
 
@@ -185,7 +185,7 @@ msgstr ""
185
  msgid "Automatic translation has been disabled."
186
  msgstr ""
187
 
188
- #: 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:817
189
  msgid "Dismiss this notice."
190
  msgstr ""
191
 
@@ -265,35 +265,35 @@ msgstr ""
265
  msgid "Active"
266
  msgstr ""
267
 
268
- #: includes/class-machine-translation-tab.php:22
269
  msgid "Automatic Translation"
270
  msgstr ""
271
 
272
- #: includes/class-machine-translation-tab.php:140, add-ons-pro/deepl/includes/class-deepl.php:27
273
  msgid "DeepL"
274
  msgstr ""
275
 
276
- #: includes/class-machine-translation-tab.php:166
277
  msgid "Unsupported languages"
278
  msgstr ""
279
 
280
- #: includes/class-machine-translation-tab.php:178
281
  msgid "The selected automatic translation engine does not provide support for these languages.<br>You can still manually translate pages in these languages using the Translation Editor."
282
  msgstr ""
283
 
284
- #: includes/class-machine-translation-tab.php:205
285
  msgid "Languages without formality"
286
  msgstr ""
287
 
288
- #: includes/class-machine-translation-tab.php:217
289
  msgid "The selected automatic translation engine provides only <a href=\"%s\" target=\"_blank\">default formality</a> settings for these languages for now.<br>Automatic translation will still work if available for these languages. It will just not use the formality setting from TranslatePress <a href=\"%s\" target=\"_self\"> General Tab</a> for the languages listed above."
290
  msgstr ""
291
 
292
- #: includes/class-machine-translation-tab.php:230
293
  msgid "Recheck supported languages"
294
  msgstr ""
295
 
296
- #: includes/class-machine-translation-tab.php:231
297
  msgid "(last checked on %s)"
298
  msgstr ""
299
 
@@ -409,43 +409,43 @@ msgstr ""
409
  msgid "Light"
410
  msgstr ""
411
 
412
- #: includes/class-settings.php:451, add-ons-advanced/extra-languages/class-extra-languages.php:44
413
  msgid "Error! Duplicate URL slug values."
414
  msgstr ""
415
 
416
- #: includes/class-settings.php:492
417
  msgid "Current Language"
418
  msgstr ""
419
 
420
- #: includes/class-settings.php:498
421
  msgid "Opposite Language"
422
  msgstr ""
423
 
424
- #: includes/class-settings.php:538
425
  msgid "General"
426
  msgstr ""
427
 
428
- #: includes/class-settings.php:543, includes/class-translation-manager.php:438
429
  msgid "Translate Site"
430
  msgstr ""
431
 
432
- #: includes/class-settings.php:548
433
  msgid "Addons"
434
  msgstr ""
435
 
436
- #: includes/class-settings.php:556
437
  msgid "License"
438
  msgstr ""
439
 
440
- #: includes/class-settings.php:600, includes/class-translation-manager.php:470
441
  msgid "Settings"
442
  msgstr ""
443
 
444
- #: includes/class-settings.php:613, partials/license-settings-page.php:32
445
  msgid "Activate License"
446
  msgstr ""
447
 
448
- #: includes/class-settings.php:605
449
  msgid "Pro Features"
450
  msgstr ""
451
 
@@ -649,7 +649,7 @@ msgstr ""
649
  msgid "Different Menu Items for each Language"
650
  msgstr ""
651
 
652
- #: includes/class-translation-manager.php:153, partials/addons-settings-page.php:54
653
  msgid "Automatic User Language Detection"
654
  msgstr ""
655
 
@@ -725,11 +725,11 @@ msgstr ""
725
  msgid "Translate Page"
726
  msgstr ""
727
 
728
- #: includes/class-translation-manager.php:1268
729
  msgid "Security check"
730
  msgstr ""
731
 
732
- #: includes/class-translation-manager.php:1342
733
  msgid "<strong>Warning:</strong> Some strings have possibly incorrectly encoded characters. This may result in breaking the queries, rendering the page untranslated in live mode. Consider revising the following strings or their method of outputting."
734
  msgstr ""
735
 
@@ -789,111 +789,111 @@ msgstr ""
789
  msgid "Twitter Image"
790
  msgstr ""
791
 
792
- #: includes/class-upgrade.php:114
793
  msgid "Removing cdata dictionary strings for language %s..."
794
  msgstr ""
795
 
796
- #: includes/class-upgrade.php:122
797
  msgid "Removing untranslated dictionary links for language %s..."
798
  msgstr ""
799
 
800
- #: includes/class-upgrade.php:142
801
  msgid "Removing duplicated gettext strings for language %s..."
802
  msgstr ""
803
 
804
- #: includes/class-upgrade.php:150
805
  msgid "Removing untranslated gettext strings where translation is available for language %s..."
806
  msgstr ""
807
 
808
- #: includes/class-upgrade.php:158
809
  msgid "Removing duplicated dictionary strings for language %s..."
810
  msgstr ""
811
 
812
- #: includes/class-upgrade.php:166
813
  msgid "Removing untranslated dictionary strings where translation is available for language %s..."
814
  msgstr ""
815
 
816
- #: includes/class-upgrade.php:173
817
  msgid "Inserting original strings for language %s..."
818
  msgstr ""
819
 
820
- #: includes/class-upgrade.php:182
821
  msgid "Cleaning original strings table for language %s..."
822
  msgstr ""
823
 
824
- #: includes/class-upgrade.php:190
825
  msgid "Updating original string ids for language %s..."
826
  msgstr ""
827
 
828
- #: includes/class-upgrade.php:198
829
  msgid "Regenerating original meta table for language %s..."
830
  msgstr ""
831
 
832
- #: includes/class-upgrade.php:206
833
  msgid "Cleaning original meta table for language %s..."
834
  msgstr ""
835
 
836
- #: includes/class-upgrade.php:214
837
  msgid "Finishing up..."
838
  msgstr ""
839
 
840
- #: includes/class-upgrade.php:250
841
  msgid "TranslatePress data update"
842
  msgstr ""
843
 
844
- #: includes/class-upgrade.php:250
845
  msgid "We need to update your translations database to the latest version."
846
  msgstr ""
847
 
848
- #: includes/class-upgrade.php:251
849
  msgid "IMPORTANT: It is strongly recommended to first backup the database!\nAre you sure you want to continue?"
850
  msgstr ""
851
 
852
- #: includes/class-upgrade.php:251
853
  msgid "Run the updater"
854
  msgstr ""
855
 
856
- #: includes/class-upgrade.php:278
857
  msgid "Database optimization did not complete successfully. We recommend restoring the original database or <a href=\"%s\" >trying again.</a>"
858
  msgstr ""
859
 
860
- #: includes/class-upgrade.php:296
861
  msgid "Update aborted! Your user account doesn't have the capability to perform database updates."
862
  msgstr ""
863
 
864
- #: includes/class-upgrade.php:301
865
  msgid "Update aborted! Invalid nonce."
866
  msgstr ""
867
 
868
- #: includes/class-upgrade.php:345
869
  msgid "Update aborted! Incorrect action."
870
  msgstr ""
871
 
872
- #: includes/class-upgrade.php:348
873
  msgid "Update aborted! Incorrect language code."
874
  msgstr ""
875
 
876
- #: includes/class-upgrade.php:332
877
  msgid "Updating database to version %s+"
878
  msgstr ""
879
 
880
- #: includes/class-upgrade.php:336, includes/class-upgrade.php:399
881
  msgid "Processing table for language %s..."
882
  msgstr ""
883
 
884
- #: includes/class-upgrade.php:319, includes/class-upgrade.php:429
885
  msgid "Back to TranslatePress Settings"
886
  msgstr ""
887
 
888
- #: includes/class-upgrade.php:323
889
  msgid "Successfully updated database!"
890
  msgstr ""
891
 
892
- #: includes/class-upgrade.php:404, includes/class-upgrade.php:396
893
  msgid " done."
894
  msgstr ""
895
 
896
- #: includes/class-upgrade.php:815
897
  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."
898
  msgstr ""
899
 
@@ -1033,7 +1033,7 @@ msgstr ""
1033
  msgid "TranslatePress Advanced Settings"
1034
  msgstr ""
1035
 
1036
- #: partials/advanced-settings-page.php:16, partials/machine-translation-settings-page.php:161, partials/main-settings-page.php:159
1037
  msgid "Save Changes"
1038
  msgstr ""
1039
 
@@ -1073,90 +1073,110 @@ msgstr ""
1073
  msgid "TranslatePress Automatic Translation"
1074
  msgstr ""
1075
 
1076
- #: partials/machine-translation-settings-page.php:9
1077
  msgid "Enable Automatic Translation"
1078
  msgstr ""
1079
 
1080
- #: partials/machine-translation-settings-page.php:12, partials/main-settings-page.php:41, partials/main-settings-page.php:54, partials/main-settings-page.php:67
1081
  msgid "No"
1082
  msgstr ""
1083
 
1084
- #: partials/machine-translation-settings-page.php:17
1085
  msgid "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."
1086
  msgstr ""
1087
 
1088
- #: partials/machine-translation-settings-page.php:23
1089
  msgid "Translation Engine"
1090
  msgstr ""
1091
 
1092
- #: partials/machine-translation-settings-page.php:35
1093
  msgid "Choose which engine you want to use in order to automatically translate your website."
1094
  msgstr ""
1095
 
1096
- #: partials/machine-translation-settings-page.php:58
1097
  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>."
1098
  msgstr ""
1099
 
1100
- #: partials/machine-translation-settings-page.php:51
1101
  msgid "<strong>DeepL</strong> automatic translation is available as a <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>."
1102
  msgstr ""
1103
 
1104
- #: partials/machine-translation-settings-page.php:52
1105
  msgid "By upgrading you'll get access to all paid add-ons, premium support and help fund the future development of TranslatePress."
1106
  msgstr ""
1107
 
1108
  #. translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
1109
- #: partials/machine-translation-settings-page.php:73
1110
  msgctxt "Verbiage for the DeepL Pro Add-on"
1111
  msgid "TranslatePress Pro Add-on"
1112
  msgstr ""
1113
 
1114
- #: partials/machine-translation-settings-page.php:67
1115
  msgctxt "Verbiage for the DeepL Pro Add-on"
1116
  msgid "Addons tab"
1117
  msgstr ""
1118
 
1119
- #: partials/machine-translation-settings-page.php:80
1120
  msgid "Please note that DeepL API usage is paid separately. See <a href=\"https://www.deepl.com/pro.html#developer\">DeepL pricing information</a>."
1121
  msgstr ""
1122
 
1123
- #: partials/machine-translation-settings-page.php:85
1124
  msgid "TranslatePress Pro Add-ons"
1125
  msgstr ""
1126
 
1127
- #: partials/machine-translation-settings-page.php:102
1128
  msgid "Test API credentials"
1129
  msgstr ""
1130
 
1131
- #: partials/machine-translation-settings-page.php:104
1132
  msgid "Click here to check if the selected translation engine is configured correctly."
1133
  msgstr ""
1134
 
1135
- #: partials/machine-translation-settings-page.php:113
1136
  msgid "Block Crawlers"
1137
  msgstr ""
1138
 
1139
- #: partials/machine-translation-settings-page.php:120
1140
  msgid "Block crawlers from triggering automatic translations on your website."
1141
  msgstr ""
1142
 
1143
- #: partials/machine-translation-settings-page.php:126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1144
  msgid "Limit machine translation / characters per day"
1145
  msgstr ""
1146
 
1147
- #: partials/machine-translation-settings-page.php:132
1148
  msgid "Add a limit to the number of automatically translated characters so you can better budget your project."
1149
  msgstr ""
1150
 
1151
- #: partials/machine-translation-settings-page.php:138
1152
  msgid "Today's character count:"
1153
  msgstr ""
1154
 
1155
- #: partials/machine-translation-settings-page.php:146
1156
  msgid "Log machine translation queries."
1157
  msgstr ""
1158
 
1159
- #: partials/machine-translation-settings-page.php:153
1160
  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.)"
1161
  msgstr ""
1162
 
@@ -1531,14 +1551,6 @@ msgstr ""
1531
  msgid "Translate Only Certain Paths"
1532
  msgstr ""
1533
 
1534
- #: includes/advanced-settings/enable-auto-translate-slug.php:8
1535
- msgid "Automatically translate slugs"
1536
- msgstr ""
1537
-
1538
- #: includes/advanced-settings/enable-auto-translate-slug.php:9
1539
- msgid "Generate automatic translations of slugs for posts, pages and Custom Post Types.<br/>Requires <a href=\"https://translatepress.com/docs/addons/seo-pack/\" title=\"TranslatePress Add-on SEO Pack documentation\" target=\"_blank\"> SEO Pack Add-on</a> to be installed and activated.<br>The slugs will be automatically translated starting with the second refresh of each page."
1540
- msgstr ""
1541
-
1542
  #: includes/advanced-settings/enable-hreflang-xdefault.php:8
1543
  msgid "Enable the hreflang x-default tag for language:"
1544
  msgstr ""
@@ -1905,34 +1917,82 @@ msgstr ""
1905
  msgid "Post Slug"
1906
  msgstr ""
1907
 
1908
- #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:37
1909
  msgid "First by browser language, then IP address (recommended)"
1910
  msgstr ""
1911
 
1912
- #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:38
1913
  msgid "First by IP address, then by browser language"
1914
  msgstr ""
1915
 
1916
- #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:39
1917
  msgid "Only by browser language"
1918
  msgstr ""
1919
 
1920
- #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:40
1921
  msgid "Only by IP address"
1922
  msgstr ""
1923
 
1924
- #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1925
  msgid "WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment."
1926
  msgstr ""
1927
 
1928
- #: add-ons-pro/automatic-language-detection/partials/settings-option.php:2
 
 
 
 
1929
  msgid "Method of language detection"
1930
  msgstr ""
1931
 
1932
- #: add-ons-pro/automatic-language-detection/partials/settings-option.php:14
1933
  msgid "Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies."
1934
  msgstr ""
1935
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1936
  #: add-ons-pro/deepl/includes/class-deepl.php:56
1937
  msgid "Bad request. There was an error accessing the DeepL API."
1938
  msgstr ""
49
  msgid "Settings saved."
50
  msgstr ""
51
 
52
+ #: includes/class-advanced-tab.php:319, includes/class-error-manager.php:172, partials/machine-translation-settings-page.php:17, partials/machine-translation-settings-page.php:121, partials/machine-translation-settings-page.php:141, partials/machine-translation-settings-page.php:192, partials/main-settings-page.php:42, partials/main-settings-page.php:55, partials/main-settings-page.php:68
53
  msgid "Yes"
54
  msgstr ""
55
 
56
+ #: includes/class-advanced-tab.php:529, includes/class-advanced-tab.php:540, includes/class-advanced-tab.php:634, includes/class-advanced-tab.php:665
57
  msgid "Are you sure you want to remove this item?"
58
  msgstr ""
59
 
60
+ #: includes/class-advanced-tab.php:529, includes/class-advanced-tab.php:540, includes/class-advanced-tab.php:634, includes/class-advanced-tab.php:665, partials/main-settings-language-selector.php:60, add-ons-advanced/extra-languages/partials/language-selector-pro.php:62
61
  msgid "Remove"
62
  msgstr ""
63
 
64
+ #: includes/class-advanced-tab.php:540, includes/class-advanced-tab.php:665, partials/main-settings-language-selector.php:102, add-ons-advanced/extra-languages/partials/language-selector-pro.php:103
65
  msgid "Add"
66
  msgstr ""
67
 
68
+ #: includes/class-advanced-tab.php:618, includes/class-advanced-tab.php:652
69
  msgid "Select..."
70
  msgstr ""
71
 
185
  msgid "Automatic translation has been disabled."
186
  msgstr ""
187
 
188
+ #: 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:839
189
  msgid "Dismiss this notice."
190
  msgstr ""
191
 
265
  msgid "Active"
266
  msgstr ""
267
 
268
+ #: includes/class-machine-translation-tab.php:23
269
  msgid "Automatic Translation"
270
  msgstr ""
271
 
272
+ #: includes/class-machine-translation-tab.php:164, add-ons-pro/deepl/includes/class-deepl.php:27
273
  msgid "DeepL"
274
  msgstr ""
275
 
276
+ #: includes/class-machine-translation-tab.php:196
277
  msgid "Unsupported languages"
278
  msgstr ""
279
 
280
+ #: includes/class-machine-translation-tab.php:208
281
  msgid "The selected automatic translation engine does not provide support for these languages.<br>You can still manually translate pages in these languages using the Translation Editor."
282
  msgstr ""
283
 
284
+ #: includes/class-machine-translation-tab.php:235
285
  msgid "Languages without formality"
286
  msgstr ""
287
 
288
+ #: includes/class-machine-translation-tab.php:247
289
  msgid "The selected automatic translation engine provides only <a href=\"%s\" target=\"_blank\">default formality</a> settings for these languages for now.<br>Automatic translation will still work if available for these languages. It will just not use the formality setting from TranslatePress <a href=\"%s\" target=\"_self\"> General Tab</a> for the languages listed above."
290
  msgstr ""
291
 
292
+ #: includes/class-machine-translation-tab.php:260
293
  msgid "Recheck supported languages"
294
  msgstr ""
295
 
296
+ #: includes/class-machine-translation-tab.php:261
297
  msgid "(last checked on %s)"
298
  msgstr ""
299
 
409
  msgid "Light"
410
  msgstr ""
411
 
412
+ #: includes/class-settings.php:452, add-ons-advanced/extra-languages/class-extra-languages.php:44
413
  msgid "Error! Duplicate URL slug values."
414
  msgstr ""
415
 
416
+ #: includes/class-settings.php:493
417
  msgid "Current Language"
418
  msgstr ""
419
 
420
+ #: includes/class-settings.php:499
421
  msgid "Opposite Language"
422
  msgstr ""
423
 
424
+ #: includes/class-settings.php:539
425
  msgid "General"
426
  msgstr ""
427
 
428
+ #: includes/class-settings.php:544, includes/class-translation-manager.php:438
429
  msgid "Translate Site"
430
  msgstr ""
431
 
432
+ #: includes/class-settings.php:549
433
  msgid "Addons"
434
  msgstr ""
435
 
436
+ #: includes/class-settings.php:557
437
  msgid "License"
438
  msgstr ""
439
 
440
+ #: includes/class-settings.php:601, includes/class-translation-manager.php:470
441
  msgid "Settings"
442
  msgstr ""
443
 
444
+ #: includes/class-settings.php:614, partials/license-settings-page.php:32
445
  msgid "Activate License"
446
  msgstr ""
447
 
448
+ #: includes/class-settings.php:606
449
  msgid "Pro Features"
450
  msgstr ""
451
 
649
  msgid "Different Menu Items for each Language"
650
  msgstr ""
651
 
652
+ #: includes/class-translation-manager.php:153, partials/addons-settings-page.php:54, add-ons-pro/automatic-language-detection/class-automatic-language-detection.php:53, add-ons-pro/automatic-language-detection/partials/general-settings.php:1, add-ons-pro/automatic-language-detection/partials/settings-option.php:1
653
  msgid "Automatic User Language Detection"
654
  msgstr ""
655
 
725
  msgid "Translate Page"
726
  msgstr ""
727
 
728
+ #: includes/class-translation-manager.php:1272
729
  msgid "Security check"
730
  msgstr ""
731
 
732
+ #: includes/class-translation-manager.php:1346
733
  msgid "<strong>Warning:</strong> Some strings have possibly incorrectly encoded characters. This may result in breaking the queries, rendering the page untranslated in live mode. Consider revising the following strings or their method of outputting."
734
  msgstr ""
735
 
789
  msgid "Twitter Image"
790
  msgstr ""
791
 
792
+ #: includes/class-upgrade.php:136
793
  msgid "Removing cdata dictionary strings for language %s..."
794
  msgstr ""
795
 
796
+ #: includes/class-upgrade.php:144
797
  msgid "Removing untranslated dictionary links for language %s..."
798
  msgstr ""
799
 
800
+ #: includes/class-upgrade.php:164
801
  msgid "Removing duplicated gettext strings for language %s..."
802
  msgstr ""
803
 
804
+ #: includes/class-upgrade.php:172
805
  msgid "Removing untranslated gettext strings where translation is available for language %s..."
806
  msgstr ""
807
 
808
+ #: includes/class-upgrade.php:180
809
  msgid "Removing duplicated dictionary strings for language %s..."
810
  msgstr ""
811
 
812
+ #: includes/class-upgrade.php:188
813
  msgid "Removing untranslated dictionary strings where translation is available for language %s..."
814
  msgstr ""
815
 
816
+ #: includes/class-upgrade.php:195
817
  msgid "Inserting original strings for language %s..."
818
  msgstr ""
819
 
820
+ #: includes/class-upgrade.php:204
821
  msgid "Cleaning original strings table for language %s..."
822
  msgstr ""
823
 
824
+ #: includes/class-upgrade.php:212
825
  msgid "Updating original string ids for language %s..."
826
  msgstr ""
827
 
828
+ #: includes/class-upgrade.php:220
829
  msgid "Regenerating original meta table for language %s..."
830
  msgstr ""
831
 
832
+ #: includes/class-upgrade.php:228
833
  msgid "Cleaning original meta table for language %s..."
834
  msgstr ""
835
 
836
+ #: includes/class-upgrade.php:236
837
  msgid "Finishing up..."
838
  msgstr ""
839
 
840
+ #: includes/class-upgrade.php:272
841
  msgid "TranslatePress data update"
842
  msgstr ""
843
 
844
+ #: includes/class-upgrade.php:272
845
  msgid "We need to update your translations database to the latest version."
846
  msgstr ""
847
 
848
+ #: includes/class-upgrade.php:273
849
  msgid "IMPORTANT: It is strongly recommended to first backup the database!\nAre you sure you want to continue?"
850
  msgstr ""
851
 
852
+ #: includes/class-upgrade.php:273
853
  msgid "Run the updater"
854
  msgstr ""
855
 
856
+ #: includes/class-upgrade.php:300
857
  msgid "Database optimization did not complete successfully. We recommend restoring the original database or <a href=\"%s\" >trying again.</a>"
858
  msgstr ""
859
 
860
+ #: includes/class-upgrade.php:318
861
  msgid "Update aborted! Your user account doesn't have the capability to perform database updates."
862
  msgstr ""
863
 
864
+ #: includes/class-upgrade.php:323
865
  msgid "Update aborted! Invalid nonce."
866
  msgstr ""
867
 
868
+ #: includes/class-upgrade.php:367
869
  msgid "Update aborted! Incorrect action."
870
  msgstr ""
871
 
872
+ #: includes/class-upgrade.php:370
873
  msgid "Update aborted! Incorrect language code."
874
  msgstr ""
875
 
876
+ #: includes/class-upgrade.php:354
877
  msgid "Updating database to version %s+"
878
  msgstr ""
879
 
880
+ #: includes/class-upgrade.php:358, includes/class-upgrade.php:421
881
  msgid "Processing table for language %s..."
882
  msgstr ""
883
 
884
+ #: includes/class-upgrade.php:341, includes/class-upgrade.php:451
885
  msgid "Back to TranslatePress Settings"
886
  msgstr ""
887
 
888
+ #: includes/class-upgrade.php:345
889
  msgid "Successfully updated database!"
890
  msgstr ""
891
 
892
+ #: includes/class-upgrade.php:426, includes/class-upgrade.php:418
893
  msgid " done."
894
  msgstr ""
895
 
896
+ #: includes/class-upgrade.php:837
897
  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."
898
  msgstr ""
899
 
1033
  msgid "TranslatePress Advanced Settings"
1034
  msgstr ""
1035
 
1036
+ #: partials/advanced-settings-page.php:16, partials/machine-translation-settings-page.php:203, partials/main-settings-page.php:159
1037
  msgid "Save Changes"
1038
  msgstr ""
1039
 
1073
  msgid "TranslatePress Automatic Translation"
1074
  msgstr ""
1075
 
1076
+ #: partials/machine-translation-settings-page.php:13
1077
  msgid "Enable Automatic Translation"
1078
  msgstr ""
1079
 
1080
+ #: partials/machine-translation-settings-page.php:16, partials/main-settings-page.php:41, partials/main-settings-page.php:54, partials/main-settings-page.php:67
1081
  msgid "No"
1082
  msgstr ""
1083
 
1084
+ #: partials/machine-translation-settings-page.php:21
1085
  msgid "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."
1086
  msgstr ""
1087
 
1088
+ #: partials/machine-translation-settings-page.php:27
1089
  msgid "Translation Engine"
1090
  msgstr ""
1091
 
1092
+ #: partials/machine-translation-settings-page.php:39
1093
  msgid "Choose which engine you want to use in order to automatically translate your website."
1094
  msgstr ""
1095
 
1096
+ #: partials/machine-translation-settings-page.php:62
1097
  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>."
1098
  msgstr ""
1099
 
1100
+ #: partials/machine-translation-settings-page.php:55
1101
  msgid "<strong>DeepL</strong> automatic translation is available as a <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>."
1102
  msgstr ""
1103
 
1104
+ #: partials/machine-translation-settings-page.php:56
1105
  msgid "By upgrading you'll get access to all paid add-ons, premium support and help fund the future development of TranslatePress."
1106
  msgstr ""
1107
 
1108
  #. translators: %1$s is the URL to the DeepL add-on. %2$s is the name of the Pro offerings.
1109
+ #: partials/machine-translation-settings-page.php:77
1110
  msgctxt "Verbiage for the DeepL Pro Add-on"
1111
  msgid "TranslatePress Pro Add-on"
1112
  msgstr ""
1113
 
1114
+ #: partials/machine-translation-settings-page.php:71
1115
  msgctxt "Verbiage for the DeepL Pro Add-on"
1116
  msgid "Addons tab"
1117
  msgstr ""
1118
 
1119
+ #: partials/machine-translation-settings-page.php:84
1120
  msgid "Please note that DeepL API usage is paid separately. See <a href=\"https://www.deepl.com/pro.html#developer\">DeepL pricing information</a>."
1121
  msgstr ""
1122
 
1123
+ #: partials/machine-translation-settings-page.php:89
1124
  msgid "TranslatePress Pro Add-ons"
1125
  msgstr ""
1126
 
1127
+ #: partials/machine-translation-settings-page.php:106
1128
  msgid "Test API credentials"
1129
  msgstr ""
1130
 
1131
+ #: partials/machine-translation-settings-page.php:108
1132
  msgid "Click here to check if the selected translation engine is configured correctly."
1133
  msgstr ""
1134
 
1135
+ #: partials/machine-translation-settings-page.php:117
1136
  msgid "Block Crawlers"
1137
  msgstr ""
1138
 
1139
+ #: partials/machine-translation-settings-page.php:124
1140
  msgid "Block crawlers from triggering automatic translations on your website."
1141
  msgstr ""
1142
 
1143
+ #: partials/machine-translation-settings-page.php:130
1144
+ msgid "Automatically Translate Slugs"
1145
+ msgstr ""
1146
+
1147
+ #: partials/machine-translation-settings-page.php:145
1148
+ msgid "Generate automatic translations of slugs for posts, pages and Custom Post Types.<br/>The slugs will be automatically translated starting with the second refresh of each page."
1149
+ msgstr ""
1150
+
1151
+ #: partials/machine-translation-settings-page.php:148
1152
+ msgid "This feature is available only in the paid version. <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a> and unlock more premium features."
1153
+ msgstr ""
1154
+
1155
+ #: partials/machine-translation-settings-page.php:151
1156
+ msgid "Upgrade TranslatePress"
1157
+ msgstr ""
1158
+
1159
+ #: partials/machine-translation-settings-page.php:160
1160
+ msgid "<br/>Requires <a href=\"https://translatepress.com/docs/addons/seo-pack/\" title=\"TranslatePress Add-on SEO Pack documentation\" target=\"_blank\"> SEO Pack Add-on</a> to be installed and activated."
1161
+ msgstr ""
1162
+
1163
+ #: partials/machine-translation-settings-page.php:168
1164
  msgid "Limit machine translation / characters per day"
1165
  msgstr ""
1166
 
1167
+ #: partials/machine-translation-settings-page.php:174
1168
  msgid "Add a limit to the number of automatically translated characters so you can better budget your project."
1169
  msgstr ""
1170
 
1171
+ #: partials/machine-translation-settings-page.php:180
1172
  msgid "Today's character count:"
1173
  msgstr ""
1174
 
1175
+ #: partials/machine-translation-settings-page.php:188
1176
  msgid "Log machine translation queries."
1177
  msgstr ""
1178
 
1179
+ #: partials/machine-translation-settings-page.php:195
1180
  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.)"
1181
  msgstr ""
1182
 
1551
  msgid "Translate Only Certain Paths"
1552
  msgstr ""
1553
 
 
 
 
 
 
 
 
 
1554
  #: includes/advanced-settings/enable-hreflang-xdefault.php:8
1555
  msgid "Enable the hreflang x-default tag for language:"
1556
  msgstr ""
1917
  msgid "Post Slug"
1918
  msgstr ""
1919
 
1920
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:49
1921
  msgid "First by browser language, then IP address (recommended)"
1922
  msgstr ""
1923
 
1924
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:50
1925
  msgid "First by IP address, then by browser language"
1926
  msgstr ""
1927
 
1928
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:51
1929
  msgid "Only by browser language"
1930
  msgstr ""
1931
 
1932
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:52
1933
  msgid "Only by IP address"
1934
  msgstr ""
1935
 
1936
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:142
1937
+ msgid "A popup appears asking the user if they want to be redirected"
1938
+ msgstr ""
1939
+
1940
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:143
1941
+ msgid "Redirect directly (*not recommended)"
1942
+ msgstr ""
1943
+
1944
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:149
1945
+ msgid "Pop-up window over the content"
1946
+ msgstr ""
1947
+
1948
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:150
1949
+ msgid "Hello bar before the content"
1950
+ msgstr ""
1951
+
1952
+ #: add-ons-pro/automatic-language-detection/includes/class-ald-settings.php:183
1953
  msgid "WARNING. Cannot determine your language preference based on your current IP.<br>This is most likely because the website is on a local environment."
1954
  msgstr ""
1955
 
1956
+ #: add-ons-pro/automatic-language-detection/partials/general-settings.php:3
1957
+ msgid "Go to <a href=\"%s\" target=\"_self\">Advanced</a> tab to change this feature's settings"
1958
+ msgstr ""
1959
+
1960
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:4
1961
  msgid "Method of language detection"
1962
  msgstr ""
1963
 
1964
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:16
1965
  msgid "Select how the language should be detected for first time visitors.<br>The visitor's last displayed language will be remembered through cookies."
1966
  msgstr ""
1967
 
1968
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:24
1969
+ msgid "Pop-up to notify the user of the detected language"
1970
+ msgstr ""
1971
+
1972
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:31
1973
+ msgid "Select the type of pop-up you wish to appear."
1974
+ msgstr ""
1975
+
1976
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:43
1977
+ msgid "Write the text you wish to appear in the pop-up."
1978
+ msgstr ""
1979
+
1980
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:47
1981
+ msgid "The same text is displayed in all languages. <br>A selecting language switcher will be appended to the pop-up. The detected language is pre-selected."
1982
+ msgstr ""
1983
+
1984
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:51
1985
+ msgid "Write the text you wish to appear on the button."
1986
+ msgstr ""
1987
+
1988
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:56
1989
+ msgid "Write the text you wish to appear on the close button. Leave empty for just the close button."
1990
+ msgstr ""
1991
+
1992
+ #: add-ons-pro/automatic-language-detection/partials/settings-option.php:68
1993
+ msgid "Choose if you want the user to be redirected directly.<br>* Not recommended because it may cause indexing issues for search engines."
1994
+ msgstr ""
1995
+
1996
  #: add-ons-pro/deepl/includes/class-deepl.php:56
1997
  msgid "Bad request. There was an error accessing the DeepL API."
1998
  msgstr ""
partials/language-switcher-shortcode.php CHANGED
@@ -2,6 +2,7 @@
2
  $current_language_preference = $this->add_shortcode_preferences($shortcode_settings, $current_language['code'], $current_language['name']);
3
 
4
  ?>
 
5
  <div class="trp-language-switcher trp-language-switcher-container" data-no-translation <?php echo ( isset( $_GET['trp-edit-translation'] ) && $_GET['trp-edit-translation'] == 'preview' ) ? 'data-trp-unpreviewable="trp-unpreviewable"' : '' ?>>
6
  <div class="trp-ls-shortcode-current-language">
7
  <a href="#" class="trp-ls-shortcode-disabled-language trp-ls-disabled-language" title="<?php echo esc_attr( $current_language['name'] ); ?>" onclick="event.preventDefault()">
@@ -30,15 +31,24 @@ $current_language_preference = $this->add_shortcode_preferences($shortcode_setti
30
  if ( trp_ls_shortcodes.length > 0) {
31
  // get the last language switcher added
32
  var trp_el = trp_ls_shortcodes[trp_ls_shortcodes.length - 1];
33
- var trp_shortcode_language_item = trp_el.querySelector('.trp-ls-shortcode-language')
34
 
35
- // set width
36
- var trp_ls_shortcode_width = trp_shortcode_language_item.offsetWidth + 16;
37
- trp_shortcode_language_item.style.width = trp_ls_shortcode_width + 'px';
38
- trp_el.querySelector('.trp-ls-shortcode-current-language').style.width = trp_ls_shortcode_width + 'px';
 
 
39
 
40
- // We're putting this on display: none after we have its width.
41
- trp_shortcode_language_item.style.display = 'none';
 
 
 
 
 
 
 
42
  }
43
  </script>
 
44
  </div>
2
  $current_language_preference = $this->add_shortcode_preferences($shortcode_settings, $current_language['code'], $current_language['name']);
3
 
4
  ?>
5
+ <div class="trp_language_switcher_shortcode">
6
  <div class="trp-language-switcher trp-language-switcher-container" data-no-translation <?php echo ( isset( $_GET['trp-edit-translation'] ) && $_GET['trp-edit-translation'] == 'preview' ) ? 'data-trp-unpreviewable="trp-unpreviewable"' : '' ?>>
7
  <div class="trp-ls-shortcode-current-language">
8
  <a href="#" class="trp-ls-shortcode-disabled-language trp-ls-disabled-language" title="<?php echo esc_attr( $current_language['name'] ); ?>" onclick="event.preventDefault()">
31
  if ( trp_ls_shortcodes.length > 0) {
32
  // get the last language switcher added
33
  var trp_el = trp_ls_shortcodes[trp_ls_shortcodes.length - 1];
 
34
 
35
+ /* Added extra check to not execute width adjustment on the shortcode language switcher placed inside
36
+ * trp_ald_ls_shortcode_popup Automatic User Language Detection Popup.
37
+ * A similar script is executed there to adjust width.
38
+ */
39
+ if ( ! ( (" " + trp_el.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf(" trp_ald_ls_shortcode_popup ") > -1 ) ){
40
+ // above expression is vanilla JS for "does not have CSS class trp_ald_ls_shortcode_popup" in the parent node
41
 
42
+ var trp_shortcode_language_item = trp_el.querySelector( '.trp-ls-shortcode-language' )
43
+ // set width
44
+ var trp_ls_shortcode_width = trp_shortcode_language_item.offsetWidth + 16;
45
+ trp_shortcode_language_item.style.width = trp_ls_shortcode_width + 'px';
46
+ trp_el.querySelector( '.trp-ls-shortcode-current-language' ).style.width = trp_ls_shortcode_width + 'px';
47
+
48
+ // We're putting this on display: none after we have its width.
49
+ trp_shortcode_language_item.style.display = 'none';
50
+ }
51
  }
52
  </script>
53
+ </div>
54
  </div>
partials/machine-translation-settings-page.php CHANGED
@@ -2,7 +2,11 @@
2
  <form method="post" action="options.php">
3
  <?php settings_fields( 'trp_machine_translation_settings' ); ?>
4
  <h1> <?php esc_html_e( 'TranslatePress Automatic Translation', 'translatepress-multilingual' );?></h1>
5
- <?php do_action ( 'trp_settings_navigation_tabs' ); ?>
 
 
 
 
6
 
7
  <table id="trp-options" class="form-table trp-machine-translation-options">
8
  <tr>
@@ -46,7 +50,7 @@
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' );
@@ -122,6 +126,44 @@
122
  </td>
123
  </tr>
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  <tr>
126
  <th scope="row"><?php esc_html_e( 'Limit machine translation / characters per day', 'translatepress-multilingual' ); ?></th>
127
  <td>
@@ -160,4 +202,4 @@
160
 
161
  <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'translatepress-multilingual' ); ?>" /></p>
162
  </form>
163
- </div>
2
  <form method="post" action="options.php">
3
  <?php settings_fields( 'trp_machine_translation_settings' ); ?>
4
  <h1> <?php esc_html_e( 'TranslatePress Automatic Translation', 'translatepress-multilingual' );?></h1>
5
+ <?php
6
+ do_action ( 'trp_settings_navigation_tabs' );
7
+ $free_version = ( ( !class_exists( 'TRP_Handle_Included_Addons' ) ) || ( ( defined( 'TRANSLATE_PRESS' ) && ( TRANSLATE_PRESS !== 'TranslatePress - Developer' && TRANSLATE_PRESS !== 'TranslatePress - Business' && TRANSLATE_PRESS !== 'TranslatePress - Dev' && TRANSLATE_PRESS !== 'TranslatePress - Personal' ) ) ) );
8
+ $seo_pack_active = class_exists( 'TRP_IN_Seo_Pack');
9
+ ?>
10
 
11
  <table id="trp-options" class="form-table trp-machine-translation-options">
12
  <tr>
50
 
51
  <?php
52
  //link and message in case the user has the free version of TranslatePress
53
+ if( ( !class_exists( 'TRP_Handle_Included_Addons' ) ) || ( ( defined( 'TRANSLATE_PRESS' ) && ( TRANSLATE_PRESS !== 'TranslatePress - Developer' && TRANSLATE_PRESS !== 'TranslatePress - Business' && TRANSLATE_PRESS !== 'TranslatePress - Dev' ) ) ) ) :
54
  $url = trp_add_affiliate_id_to_link('https://translatepress.com/pricing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=deepl_upsell&utm_campaign=tpfree');
55
  $message = __( '<strong>DeepL</strong> automatic translation is available as a <a href="%1$s" target="_blank" title="%2$s">%2$s</a>.', 'translatepress-multilingual' );
56
  $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' );
126
  </td>
127
  </tr>
128
 
129
+ <tr>
130
+ <th scope=row><?php esc_html_e( 'Automatically Translate Slugs', 'translatepress-multilingual' ); ?></th>
131
+ <td>
132
+ <label>
133
+ <?php
134
+ $is_disabled = '';
135
+ //link and message in case the user has the free version of TranslatePress
136
+ if( $free_version || !$seo_pack_active ){
137
+ $is_disabled = 'disabled';
138
+ }
139
+ ?>
140
+ <input type=checkbox name="trp_machine_translation_settings[automatically-translate-slug]" value="yes" <?php ( isset( $this->settings['trp_machine_translation_settings']['automatically-translate-slug'] ) && !$free_version && $seo_pack_active ) ? checked( $this->settings['trp_machine_translation_settings']['automatically-translate-slug'], 'yes' ) : checked( '', 'yes' ); echo $is_disabled //phpcs:ignore ?>>
141
+ <?php esc_html_e( 'Yes' , 'translatepress-multilingual' ); ?>
142
+ </label>
143
+ <p class="description">
144
+ <?php
145
+ echo wp_kses( __( 'Generate automatic translations of slugs for posts, pages and Custom Post Types.<br/>The slugs will be automatically translated starting with the second refresh of each page.', 'translatepress-multilingual' ), array( 'br' => array() ) );
146
+ if( $free_version ){
147
+ $url = trp_add_affiliate_id_to_link( 'https://translatepress.com/pricing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=automatically_translate_slugs&utm_campaign=tpfree' );
148
+ $message = __( 'This feature is available only in the paid version. <a href="%1$s" target="_blank" title="%2$s">%2$s</a> and unlock more premium features.', 'translatepress-multilingual' );
149
+ $lnk = sprintf(
150
+ $message, esc_url( $url ),
151
+ __( 'Upgrade TranslatePress', 'translatepress-multilingual' )
152
+ );
153
+ ?>
154
+ <p class="trp-upsell-auto-translate-slugs">
155
+ <?php echo wp_kses_post( $lnk ); // Post kses for more generalized output that is more forgiving and has late escaping. ?>
156
+ </p>
157
+ <?php
158
+ }
159
+ if( !$free_version && !$seo_pack_active ){
160
+ echo wp_kses( __( '<br/>Requires <a href="https://translatepress.com/docs/addons/seo-pack/" title="TranslatePress Add-on SEO Pack documentation" target="_blank"> SEO Pack Add-on</a> to be installed and activated.', 'translatepress-multilingual' ), array( 'br' => array(), 'a' => array( 'href' => array(), 'title' => array(), 'target' => array() ) ) );
161
+ }
162
+ ?>
163
+ </p>
164
+ </td>
165
+ </tr>
166
+
167
  <tr>
168
  <th scope="row"><?php esc_html_e( 'Limit machine translation / characters per day', 'translatepress-multilingual' ); ?></th>
169
  <td>
202
 
203
  <p class="submit"><input type="submit" class="button-primary" value="<?php esc_attr_e( 'Save Changes', 'translatepress-multilingual' ); ?>" /></p>
204
  </form>
205
+ </div>
readme.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: cozmoslabs, razvan.mo, madalin.ungureanu, sareiodata, cristophor
3
  Donate link: https://www.translatepress.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.9.1
7
  Requires PHP: 5.6.20
8
- Stable tag: 2.2.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -140,6 +140,13 @@ For more information please check out our [documentation](https://translatepress
140
 
141
 
142
  == Changelog ==
 
 
 
 
 
 
 
143
  = 2.2.2 =
144
  * Fixed issue in WP 5.9 causing Invalid Data SQL Error reports
145
  * Improved page load time for WooCommerce websites on translated languages
3
  Donate link: https://www.translatepress.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.9.2
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.2.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
140
 
141
 
142
  == Changelog ==
143
+ = 2.2.3 =
144
+ * Fixed XSS security vulnerability
145
+ * Fixed sitemap containing urls with language slugs linking to paths excluded from translation
146
+ * Fixed issue affecting translation of some particular JSON requests
147
+ * Fixed edge case error regarding MO objects
148
+ * Moved Automatic translate slugs option to Automatic Translation tab
149
+
150
  = 2.2.2 =
151
  * Fixed issue in WP 5.9 causing Invalid Data SQL Error reports
152
  * Improved page load time for WooCommerce websites on translated languages