TranslatePress – Translate Multilingual sites - Version 2.1.8

Version Description

  • Added language formality setting to be used in Automatic Translation
  • Added Advanced option for enabling clickable shortcode language switcher
  • Improved tool for database optimization from Advanced tab
  • Fixed translation blocks ignoring target blank on links
Download this release

Release Info

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

Code changes from version 2.1.7 to 2.1.8

assets/js/trp-clickable-ls.js ADDED
@@ -0,0 +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
+ });
assets/js/trp-iframe-preview-script.js CHANGED
@@ -16,7 +16,9 @@ function TRP_Iframe_Preview(){
16
  jQuery('a').each(function () {
17
  // target parent brakes from the iframe so we're changing to self.
18
  // We cannot remove it because we need it in Translation blocks
19
- jQuery(this).attr('data-trp-original-target', jQuery(this).attr('target') );
 
 
20
  jQuery(this).attr('target', '_self');
21
 
22
  if( typeof this.href != "undefined" && this.href != '' ) {
16
  jQuery('a').each(function () {
17
  // target parent brakes from the iframe so we're changing to self.
18
  // We cannot remove it because we need it in Translation blocks
19
+ if ( ! jQuery(this).attr('data-trp-original-target') ){
20
+ jQuery( this ).attr( 'data-trp-original-target', jQuery( this ).attr( 'target' ) );
21
+ }
22
  jQuery(this).attr('target', '_self');
23
 
24
  if( typeof this.href != "undefined" && this.href != '' ) {
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.1.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.1.8' );
62
 
63
  wp_cache_add_non_persistent_groups(array('trp'));
64
 
includes/advanced-settings/open-language-switcher-shortcode-on-click.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ add_filter( 'trp_register_advanced_settings', 'trp_open_language_switcher_shortcode_on_click', 1350 );
4
+ function trp_open_language_switcher_shortcode_on_click( $settings_array ){
5
+ $settings_array[] = array(
6
+ 'name' => 'open_language_switcher_shortcode_on_click',
7
+ 'type' => 'checkbox',
8
+ 'label' => esc_html__( 'Open language switcher only on click', 'translatepress-multilingual' ),
9
+ 'description' => wp_kses( __( 'Open the language switcher shortcode by clicking on it instead of hovering.<br> Close it by clicking on it, anywhere else on the screen or by pressing the escape key. This will affect only the shortcode language switcher.', 'translatepress-multilingual' ), array( 'br' => array()) ),
10
+ );
11
+ return $settings_array;
12
+ }
13
+
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;
34
+ left: 0;
35
+ top: 0;
36
+ display: inline-block !important;
37
+ }');
38
+ }
39
+
40
+ function trp_open_language_switcher_on_click(){
41
+ $option = get_option( 'trp_advanced_settings', true );
42
+
43
+ if(isset($option['open_language_switcher_shortcode_on_click']) && $option['open_language_switcher_shortcode_on_click'] !== 'no'){
44
+ add_action( 'wp_enqueue_scripts', 'trp_lsclick_enqueue_scriptandstyle', 99 );
45
+ }
46
+ }
47
+
48
+ trp_open_language_switcher_on_click();
includes/advanced-settings/remove-duplicates-from-db.php CHANGED
@@ -4,7 +4,7 @@ function trp_register_remove_duplicate_entries_from_db( $settings_array ){
4
  $settings_array[] = array(
5
  'name' => 'remove_duplicate_entries_from_db',
6
  'type' => 'text',
7
- 'label' => esc_html__( 'Remove duplicate rows', 'translatepress-multilingual' ),
8
  'description' => wp_kses_post( sprintf( __( 'Click <a href="%s">here</a> to remove duplicate rows from the database.', 'translatepress-multilingual' ), admin_url('admin.php?page=trp_remove_duplicate_rows') ) ),
9
  );
10
  return $settings_array;
4
  $settings_array[] = array(
5
  'name' => 'remove_duplicate_entries_from_db',
6
  'type' => 'text',
7
+ 'label' => esc_html__( 'Optimize TranslatePress database tables', 'translatepress-multilingual' ),
8
  'description' => wp_kses_post( sprintf( __( 'Click <a href="%s">here</a> to remove duplicate rows from the database.', 'translatepress-multilingual' ), admin_url('admin.php?page=trp_remove_duplicate_rows') ) ),
9
  );
10
  return $settings_array;
includes/class-advanced-tab.php CHANGED
@@ -228,6 +228,7 @@ class TRP_Advanced_Tab {
228
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/remove-duplicates-from-db.php');
229
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/do-not-translate-certain-paths.php');
230
  include_once (TRP_PLUGIN_DIR . 'includes/advanced-settings/opposite-flag-shortcode.php');
 
231
  }
232
 
233
  /*
228
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/remove-duplicates-from-db.php');
229
  include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/do-not-translate-certain-paths.php');
230
  include_once (TRP_PLUGIN_DIR . 'includes/advanced-settings/opposite-flag-shortcode.php');
231
+ include_once (TRP_PLUGIN_DIR . 'includes/advanced-settings/open-language-switcher-shortcode-on-click.php');
232
  }
233
 
234
  /*
includes/class-machine-translation-tab.php CHANGED
@@ -150,6 +150,7 @@ class TRP_Machine_Translation_Tab {
150
  $trp_languages = $trp->get_component( 'languages' );
151
 
152
  $correct_key = $machine_translator->is_correct_api_key();
 
153
 
154
 
155
  if ( 'yes' === $this->settings['trp_machine_translation_settings']['machine-translation'] &&
@@ -157,7 +158,7 @@ class TRP_Machine_Translation_Tab {
157
  !$machine_translator->check_languages_availability($this->settings['translation-languages']) &&
158
  $correct_key != null
159
  ){
160
-
161
  $language_names = $trp_languages->get_language_names( $this->settings['translation-languages'], 'english_name' );
162
 
163
  ?>
@@ -173,13 +174,63 @@ class TRP_Machine_Translation_Tab {
173
  }
174
  ?>
175
  </ul>
176
- <a href="<?php echo esc_url( admin_url( 'admin.php?page=trp_machine_translation&trp_recheck_supported_languages=1&trp_recheck_supported_languages_nonce=' . wp_create_nonce('trp_recheck_supported_languages') ) ); ?>" class="button-secondary"><?php esc_html_e( 'Recheck supported languages', 'translatepress-multilingual' ); ?></a>
177
- <p><i><?php echo wp_kses_post( sprintf( __( '(last checked on %s)', 'translatepress-multilingual' ), esc_html( $machine_translator->get_last_checked_supported_languages() ) ) ); ?> </i></p>
178
- <p class="description">
179
  <?php echo wp_kses( __( '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.', 'translatepress-multilingual' ), array( 'br' => array() ) ); ?>
180
  </p>
181
  </td>
182
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  <?php
184
  }
185
  }
150
  $trp_languages = $trp->get_component( 'languages' );
151
 
152
  $correct_key = $machine_translator->is_correct_api_key();
153
+ $display_recheck_button = false;
154
 
155
 
156
  if ( 'yes' === $this->settings['trp_machine_translation_settings']['machine-translation'] &&
158
  !$machine_translator->check_languages_availability($this->settings['translation-languages']) &&
159
  $correct_key != null
160
  ){
161
+ $display_recheck_button = true;
162
  $language_names = $trp_languages->get_language_names( $this->settings['translation-languages'], 'english_name' );
163
 
164
  ?>
174
  }
175
  ?>
176
  </ul>
177
+ <p class="description">
 
 
178
  <?php echo wp_kses( __( '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.', 'translatepress-multilingual' ), array( 'br' => array() ) ); ?>
179
  </p>
180
  </td>
181
  </tr>
182
+
183
+ <?php
184
+ }
185
+
186
+ $data = get_option('trp_db_stored_data', array() );
187
+ if (isset($data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['formality-supported-languages'])){
188
+ $languages_that_support_formality = $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['formality-supported-languages'];
189
+ $show_formality = false;
190
+ foreach ($languages_that_support_formality as $value){
191
+ if($value == "false"){
192
+ $show_formality = true;
193
+ break;
194
+ }
195
+ }
196
+ if ( 'yes' === $this->settings['trp_machine_translation_settings']['machine-translation'] &&
197
+ !empty( $machine_translator->get_api_key() ) &&
198
+ $show_formality &&
199
+ $correct_key != null
200
+ ){
201
+ $display_recheck_button = true;
202
+ $language_names = $trp_languages->get_language_names( $this->settings['translation-languages'], 'english_name' );
203
+ ?>
204
+ <tr id="trp_unsupported_languages">
205
+ <th scope=row><?php esc_html_e( 'Languages without formality', 'translatepress-multilingual' ); ?></th>
206
+ <td>
207
+ <ul class="trp-unsupported-languages">
208
+ <?php
209
+ foreach ( $this->settings['translation-languages'] as $language_code ) {
210
+ if ( isset($languages_that_support_formality[$language_code]) && $languages_that_support_formality[$language_code] == "false") {
211
+ echo '<li>' . esc_html( $language_names[$language_code] ) . '</li>';
212
+ }
213
+ }
214
+ ?>
215
+ </ul>
216
+ <p class="description">
217
+ <?php echo wp_kses( sprintf(__( '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.', 'translatepress-multilingual' ), esc_url('https://www.deepl.com/docs-api/translating-text/'), esc_url(admin_url('options-general.php?page=translate-press'))), array('a' => array('href' => array(), 'target' =>array(), 'title' => array()), 'br' => array()) ); ?>
218
+ </p>
219
+ </td>
220
+ </tr>
221
+ <?php
222
+ }
223
+ }
224
+ if ( 'yes' === $this->settings['trp_machine_translation_settings']['machine-translation'] && $display_recheck_button ){
225
+ ?>
226
+
227
+ <tr id="trp_recheck_supported_languages">
228
+ <th scope=row></th>
229
+ <td>
230
+ <a href="<?php echo esc_url( admin_url( 'admin.php?page=trp_machine_translation&trp_recheck_supported_languages=1&trp_recheck_supported_languages_nonce=' . wp_create_nonce('trp_recheck_supported_languages') ) ); ?>" class="button-secondary"><?php esc_html_e( 'Recheck supported languages', 'translatepress-multilingual' ); ?></a>
231
+ <p><i><?php echo wp_kses_post( sprintf( __( '(last checked on %s)', 'translatepress-multilingual' ), esc_html( $machine_translator->get_last_checked_supported_languages() ) ) ); ?> </i></p>
232
+ </td>
233
+ </tr>
234
  <?php
235
  }
236
  }
includes/class-machine-translator.php CHANGED
@@ -66,7 +66,7 @@ class TRP_Machine_Translator {
66
  }
67
 
68
  // if supported languages are not stored, fetch them and update option
69
- if ( empty( $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['last-checked'] ) || $force_recheck ){
70
  if ( empty( $data['trp_mt_supported_languages'] ) ) {
71
  $data['trp_mt_supported_languages'] = array();
72
  }
@@ -75,6 +75,9 @@ class TRP_Machine_Translator {
75
  }
76
 
77
  $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['languages'] = $this->get_supported_languages();
 
 
 
78
  $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['last-checked'] = date("Y-m-d H:i:s" );
79
  update_option('trp_db_stored_data', $data );
80
  }
66
  }
67
 
68
  // if supported languages are not stored, fetch them and update option
69
+ if ( empty( $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['last-checked'] ) || $force_recheck || ( method_exists($this,'check_formality') && !isset($data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['formality-supported-languages']))){
70
  if ( empty( $data['trp_mt_supported_languages'] ) ) {
71
  $data['trp_mt_supported_languages'] = array();
72
  }
75
  }
76
 
77
  $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['languages'] = $this->get_supported_languages();
78
+ if (method_exists($this, 'check_formality')) {
79
+ $data['trp_mt_supported_languages'][ $this->settings['trp_machine_translation_settings']['translation-engine'] ]['formality-supported-languages'] = $this->check_formality();
80
+ }
81
  $data['trp_mt_supported_languages'][$this->settings['trp_machine_translation_settings']['translation-engine']]['last-checked'] = date("Y-m-d H:i:s" );
82
  update_option('trp_db_stored_data', $data );
83
  }
includes/class-query.php CHANGED
@@ -1129,11 +1129,20 @@ class TRP_Query{
1129
  *
1130
  * @param $table
1131
  */
1132
- public function remove_duplicate_rows_in_dictionary_table( $language_code, $batch ){
1133
  $table_name = $this->get_table_name( $language_code );
1134
- $query = $this->get_remove_identical_duplicates_query($table_name, $batch, 'regular' );
1135
- return $this->db->query( $query );
1136
- }
 
 
 
 
 
 
 
 
 
1137
 
1138
  /**
1139
  * Removes duplicate rows of gettext strings table
@@ -1143,10 +1152,25 @@ class TRP_Query{
1143
  *
1144
  * @param $table
1145
  */
1146
- public function remove_duplicate_rows_in_gettext_table( $language_code, $batch ){
 
 
 
 
 
 
1147
  $table_name = $this->get_gettext_table_name( $language_code );
1148
- $query = $this->get_remove_identical_duplicates_query($table_name, $batch, 'gettext' );
1149
- return $this->db->query( $query );
 
 
 
 
 
 
 
 
 
1150
  }
1151
 
1152
  /**
@@ -1156,7 +1180,7 @@ class TRP_Query{
1156
  * @param $type string possible values are 'regular' or 'gettext'
1157
  * @return string
1158
  */
1159
- private function get_remove_identical_duplicates_query( $table_name, $batch, $type ){
1160
  $charset_collate = $this->db->get_charset_collate();
1161
  $charset = "utf8mb4";
1162
  if( strpos( 'latin1', $charset_collate ) === 0 )
@@ -1168,8 +1192,8 @@ class TRP_Query{
1168
  ' . $table_name . ' AS `b`
1169
  WHERE
1170
  -- IMPORTANT: Ensures one version remains
1171
- `a`.ID < ' . $batch . '
1172
- AND `b`.ID < ' . $batch . '
1173
  AND `a`.`ID` < `b`.`ID`
1174
 
1175
  -- Check for all duplicates. Binary ensure case sensitive comparison
@@ -1189,10 +1213,14 @@ class TRP_Query{
1189
  *
1190
  * Only the original with translation remains
1191
  */
1192
- public function remove_untranslated_strings_if_translation_available( $language_code ){
1193
  $table_name = $this->get_table_name( $language_code );
1194
- $query = $this->get_remove_untranslated_duplicates_query( $table_name, 'regular' );
1195
- return $this->db->query( $query );
 
 
 
 
1196
  }
1197
 
1198
  /**
@@ -1200,10 +1228,14 @@ class TRP_Query{
1200
  *
1201
  * Only the original with translation remains
1202
  */
1203
- public function remove_untranslated_strings_if_gettext_translation_available( $language_code ){
1204
  $table_name = $this->get_gettext_table_name( $language_code );
1205
- $query = $this->get_remove_untranslated_duplicates_query( $table_name, 'gettext' );
1206
- return $this->db->query( $query );
 
 
 
 
1207
  }
1208
 
1209
  /**
1129
  *
1130
  * @param $table
1131
  */
1132
+ public function remove_duplicate_rows_in_dictionary_table( $language_code, $inferior_limit, $batch_size ) {
1133
  $table_name = $this->get_table_name( $language_code );
1134
+ if ($this->table_exists($table_name)) {
1135
+ $last_id = $this->get_last_id( $table_name );
1136
+ $query = $this->get_remove_identical_duplicates_query( $table_name, $inferior_limit, 'regular' );
1137
+ $this->db->query( $query );
1138
+ if ( $inferior_limit > $last_id ) {
1139
+ return true;
1140
+ }
1141
+ return false;
1142
+ }else{
1143
+ return true;
1144
+ }
1145
+ }
1146
 
1147
  /**
1148
  * Removes duplicate rows of gettext strings table
1152
  *
1153
  * @param $table
1154
  */
1155
+ /**
1156
+ * @param $language_code
1157
+ * @param $inferior_limit 1000, 2000
1158
+ * @param $batch_size
1159
+ * @return bool|int
1160
+ */
1161
+ public function remove_duplicate_rows_in_gettext_table( $language_code, $inferior_limit, $batch_size ){
1162
  $table_name = $this->get_gettext_table_name( $language_code );
1163
+ if ($this->table_exists($table_name)) {
1164
+ $last_id = $this->get_last_id( $table_name );
1165
+ $query = $this->get_remove_identical_duplicates_query( $table_name, $inferior_limit, 'gettext' );
1166
+ $this->db->query( $query );
1167
+ if ( $inferior_limit > $last_id ) {
1168
+ return true;
1169
+ }
1170
+ return false;
1171
+ }else{
1172
+ return true;
1173
+ }
1174
  }
1175
 
1176
  /**
1180
  * @param $type string possible values are 'regular' or 'gettext'
1181
  * @return string
1182
  */
1183
+ private function get_remove_identical_duplicates_query( $table_name, $inferior_limit, $type ){
1184
  $charset_collate = $this->db->get_charset_collate();
1185
  $charset = "utf8mb4";
1186
  if( strpos( 'latin1', $charset_collate ) === 0 )
1192
  ' . $table_name . ' AS `b`
1193
  WHERE
1194
  -- IMPORTANT: Ensures one version remains
1195
+ `a`.ID < ' . $inferior_limit . '
1196
+ AND `b`.ID < ' . $inferior_limit . '
1197
  AND `a`.`ID` < `b`.`ID`
1198
 
1199
  -- Check for all duplicates. Binary ensure case sensitive comparison
1213
  *
1214
  * Only the original with translation remains
1215
  */
1216
+ public function remove_untranslated_strings_if_translation_available( $language_code, $inferior_limit, $batch_size ){
1217
  $table_name = $this->get_table_name( $language_code );
1218
+
1219
+ if ($this->table_exists($table_name)) {
1220
+ $query = $this->get_remove_untranslated_duplicates_query( $table_name, 'regular' );
1221
+ $this->db->query( $query );
1222
+ }
1223
+ return true;
1224
  }
1225
 
1226
  /**
1228
  *
1229
  * Only the original with translation remains
1230
  */
1231
+ public function remove_untranslated_strings_if_gettext_translation_available( $language_code, $inferior_limit, $batch_size ){
1232
  $table_name = $this->get_gettext_table_name( $language_code );
1233
+
1234
+ if ($this->table_exists($table_name)) {
1235
+ $query = $this->get_remove_untranslated_duplicates_query( $table_name, 'gettext' );
1236
+ $this->db->query( $query );
1237
+ }
1238
+ return true;
1239
  }
1240
 
1241
  /**
includes/class-settings.php CHANGED
@@ -281,6 +281,22 @@ class TRP_Settings{
281
  }
282
  }
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  // check for duplicates in url slugs
285
  $duplicate_exists = false;
286
  foreach( $settings['url-slugs'] as $urlslug ) {
281
  }
282
  }
283
 
284
+ foreach ($settings['translation-languages'] as $value=>$language){
285
+ if(isset($settings['translation-languages-formality'][$value])) {
286
+ if ( $settings['translation-languages-formality'][ $value ] == 'informal' ) {
287
+ $settings['translation-languages-formality-parameter'][ $language ] = 'informal';
288
+ } else {
289
+ if ( $settings['translation-languages-formality'][ $value ] == 'formal' ) {
290
+ $settings['translation-languages-formality-parameter'][ $language ] = 'formal';
291
+ } else {
292
+ $settings['translation-languages-formality-parameter'][ $language ] = 'default';
293
+ }
294
+ }
295
+ }
296
+ }
297
+
298
+ unset($settings['translation-languages-formality']);
299
+
300
  // check for duplicates in url slugs
301
  $duplicate_exists = false;
302
  foreach( $settings['url-slugs'] as $urlslug ) {
includes/class-upgrade.php CHANGED
@@ -116,6 +116,38 @@ class TRP_Upgrade {
116
  'callback' => array( $this,'trp_updated_database_gettext_empty_rows_145'),
117
  'batch_size' => 20000
118
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  'original_id_insert_166' => array(
120
  'version' => '1.6.6',
121
  'option_name' => 'trp_updated_database_original_id_insert_166',
@@ -244,8 +276,10 @@ class TRP_Upgrade {
244
  $updates_needed[ sanitize_text_field( $_REQUEST['trp_updb_action'] )]['message_processing']
245
  : __('Processing table for language %s...', 'translatepress-multilingual' );
246
 
247
- $request['progress_message'] .= '<p>' . sprintf( $update_message_initial, $updates_needed[ sanitize_text_field( $_REQUEST['trp_updb_action'] ) ]['version'] ) . '</p>';
248
- $request['progress_message'] .= sprintf( $update_message_processing, sanitize_text_field( $_REQUEST['trp_updb_lang'] ) );//phpcs:ignore
 
 
249
  }
250
  }else{
251
  if ( !isset( $updates_needed[ $_REQUEST['trp_updb_action'] ] ) ){
@@ -471,130 +505,28 @@ class TRP_Upgrade {
471
  return;
472
  }
473
  // prepare page structure
 
474
  require_once TRP_PLUGIN_DIR . 'partials/trp-remove-duplicate-rows.php';
475
 
476
- if ( isset( $_GET['trp_rm_duplicates_original_strings'] ) ){
477
- $this->trp_remove_duplicate_original_strings();
478
- exit;
479
  }
480
 
481
- if ( empty( $_GET['trp_rm_duplicates'] ) ){
482
- // iteration not started
483
- return;
484
- }
485
- if ( sanitize_text_field( $_GET['trp_rm_duplicates'] ) === 'done' ){
486
- // iteration finished
487
- echo esc_html__('Done.', 'translatepress-multilingual' ) . '<br><br><a href="' . esc_url( site_url('wp-admin/admin.php?page=trp_advanced_page') ) . '"> <input type="button" value="' . esc_attr__('Back to TranslatePress Settings', 'translatepress-multilingual' ) . '" class="button-primary"></a>';
488
- return;
489
- }
490
- $nonce = isset( $_GET['trp_rm_nonce'] ) ? wp_verify_nonce( sanitize_text_field( $_GET['trp_rm_nonce'] ), 'tpremoveduplicaterows' ) : false;
491
- if ( $nonce === false ){
492
- echo esc_html__('Invalid nonce.', 'translatepress-multilingual' ) . '<br><br><a href="' . esc_url( site_url('wp-admin/admin.php?page=trp_advanced_page') ) . '"> <input type="button" value="' . esc_attr__('Back to TranslatePress Settings', 'translatepress-multilingual' ) . '" class="button-primary"></a>';
493
- return;
494
- }
495
-
496
- $next_get_batch = 1;
497
- $batch_size = apply_filters( 'trp_rm_duplicate_batch_size', 10000 );
498
- if ( !empty( $_GET['trp_rm_batch_size'] ) && isset( $_GET['trp_rm_batch'] ) && (int) $_GET['trp_rm_batch'] > 0 ){
499
- $batch_size = (int) $_GET['trp_rm_batch_size'];
500
- }
501
- if ( in_array( sanitize_text_field( $_GET['trp_rm_duplicates'] ), $this->settings['translation-languages'] ) ) {
502
- // language code found in array
503
- $language_code = sanitize_text_field( $_GET['trp_rm_duplicates'] );
504
- // skip default language since it doesn't have a table
505
- if ( ( isset($_GET['trp_rm_duplicates_dictionary']) && $language_code != $this->settings['default-language'] ) || isset($_GET['trp_rm_duplicates_gettext']) ) {
506
- if ( ! $this->trp_query ) {
507
- $trp = TRP_Translate_Press::get_trp_instance();
508
- /* @var TRP_Query */
509
- $this->trp_query = $trp->get_component( 'query' );
510
- }
511
- if (isset($_GET['trp_rm_duplicates_dictionary']) )
512
- $table_name = $this->trp_query->get_table_name( $language_code );
513
- else if (isset($_GET['trp_rm_duplicates_gettext']) )
514
- $table_name = $this->trp_query->get_gettext_table_name( $language_code );
515
-
516
- echo '<div>' . wp_kses( sprintf( __( 'Querying table <strong>%s</strong>', 'translatepress-multilingual' ), [ 'strong' => [] ] ), $table_name ) . '</div>';
517
-
518
- $last_id = $this->trp_query->get_last_id( $table_name );
519
- if ( !empty( $_GET['trp_rm_batch'] ) && (int) $_GET['trp_rm_batch'] > 0 ) {
520
- $get_batch = (int)$_GET['trp_rm_batch'];
521
- }else{
522
- $get_batch = 1;
523
- }
524
- $batch = $batch_size * $get_batch;
525
-
526
- /* Execute this query only for string with ID < $batch. This ensures that the query is fast.
527
- * Deleting duplicate rows for the first 20k rows might take too long.
528
- * As a solution we are deleting the duplicates of the first 10k rows ( 1 to 10 000),
529
- * then delete duplicates of the first 20k rows( 1 to 20 000, not 10 000 to 20 000 because we there could still be duplicates).
530
- * Same goes for higher numbers.
531
- */
532
- if (isset($_GET['trp_rm_duplicates_dictionary']) ) {
533
- $result1 = $this->trp_query->remove_duplicate_rows_in_dictionary_table($language_code, $batch);
534
- $result2 = 0;
535
- if ($batch > $last_id) {
536
- // execute this query only when we do not have any more duplicate rows
537
- $result2 = $this->trp_query->remove_untranslated_strings_if_translation_available($language_code);
538
- } else {
539
- $next_get_batch = $get_batch + 1;
540
- }
541
- }
542
- else if (isset($_GET['trp_rm_duplicates_gettext']) ){
543
- $result1 = $this->trp_query->remove_duplicate_rows_in_gettext_table($language_code, $batch);
544
- $result2 = 0;
545
- if ($batch > $last_id) {
546
- // execute this query only when we do not have any more duplicate rows
547
- $result2 = $this->trp_query->remove_untranslated_strings_if_gettext_translation_available($language_code);
548
- } else {
549
- $next_get_batch = $get_batch + 1;
550
- }
551
- }
552
-
553
- if ( ( $result1 === false ) || ( $result2 === false ) ) {
554
- // if query outputted error do not continue iteration
555
- return;
556
- }else{
557
- $result = $result1 + $result2;
558
- echo '<div>' . esc_html( sprintf( __( '%s duplicates removed', 'translatepress-multilingual' ), $result ) ) . '</div>';
559
- }
560
- }
561
- if ( $next_get_batch == 1 ) {
562
- // finished with the current language
563
- $index = array_search( $language_code, $this->settings['translation-languages'] );
564
- if ( isset ( $this->settings['translation-languages'][ $index + 1 ] ) ) {
565
- // next language code in array
566
- $next_language = $this->settings['translation-languages'][ $index + 1 ];
567
- } else {
568
- // finish iteration due to completing all the translation languages
569
- $next_language = 'done';
570
- }
571
- }else{
572
- $next_language = $language_code;
573
- }
574
- }else{
575
- // finish iteration due to incorrect translation language
576
- $next_language = 'done';
577
- }
578
-
579
- // construct and redirect to next url
580
- $next_page_args = array(
581
- 'page' => 'trp_remove_duplicate_rows',
582
- 'trp_rm_duplicates' => $next_language,
583
- 'trp_rm_batch' => $next_get_batch,
584
- 'trp_rm_batch_size' => $batch_size,
585
- 'trp_rm_nonce' => wp_create_nonce('tpremoveduplicaterows')
586
- );
587
 
588
- if (isset($_GET['trp_rm_duplicates_dictionary']) )
589
- $next_page_args['trp_rm_duplicates_dictionary'] = true;
590
- else if (isset($_GET['trp_rm_duplicates_gettext']) ){
591
- $next_page_args['trp_rm_duplicates_gettext'] = true;
592
  }
593
 
594
- $url = add_query_arg( $next_page_args, site_url('wp-admin/admin.php') );
595
- echo '<meta http-equiv="refresh" content="0; url=' . esc_url( $url ) . '" />';
596
- echo '<br> ' . esc_html__( 'If the page does not redirect automatically', 'translatepress-multilingual' ) . ' <a href="' . esc_url( $url ) . '" >' . esc_html__( 'click here', 'translatepress-multilingual' ) . '.</a>';
597
- exit;
 
598
  }
599
 
600
  public function enqueue_update_script( $hook ) {
@@ -722,10 +654,6 @@ class TRP_Upgrade {
722
  update_option( 'trp_regenerate_original_meta_table', 'no' );
723
  update_option( 'trp_clean_original_meta_table', 'no' );
724
 
725
- $url = add_query_arg( array('page'=>'trp_update_database'), site_url('wp-admin/admin.php') );
726
- echo '<meta http-equiv="refresh" content="0; url=' . esc_url( $url ) . '" />';
727
- echo '<br> ' . esc_html__( 'If the page does not redirect automatically', 'translatepress-multilingual' ) . ' <a href="' . esc_url( $url ) . '" >' . esc_html__( 'click here', 'translatepress-multilingual' ) . '.</a>';
728
- exit;
729
  }
730
 
731
  public function trp_regenerate_original_meta_table($language_code, $inferior_limit, $batch_size ){
116
  'callback' => array( $this,'trp_updated_database_gettext_empty_rows_145'),
117
  'batch_size' => 20000
118
  ),
119
+ 'remove_duplicate_gettext_rows' => array(
120
+ 'version' => '0',
121
+ 'option_name' => 'trp_remove_duplicate_gettext_rows',
122
+ 'callback' => array( $this->trp_query,'remove_duplicate_rows_in_gettext_table'),
123
+ 'batch_size' => 10000,
124
+ 'message_initial' => '',
125
+ 'message_processing'=> __('Removing duplicated gettext strings for language %s...', 'translatepress-multilingual' )
126
+ ),
127
+ 'remove_duplicate_untranslated_gettext_rows' => array(
128
+ 'version' => '0',
129
+ 'option_name' => 'trp_remove_duplicate_untranslated_gettext_rows',
130
+ 'callback' => array( $this->trp_query,'remove_untranslated_strings_if_gettext_translation_available'),
131
+ 'batch_size' => 10000,
132
+ 'message_initial' => '',
133
+ 'message_processing'=> __('Removing untranslated gettext strings where translation is available for language %s...', 'translatepress-multilingual' )
134
+ ),
135
+ 'remove_duplicate_dictionary_rows' => array(
136
+ 'version' => '0',
137
+ 'option_name' => 'trp_remove_duplicate_dictionary_rows',
138
+ 'callback' => array( $this->trp_query,'remove_duplicate_rows_in_dictionary_table'),
139
+ 'batch_size' => 1000,
140
+ 'message_initial' => '',
141
+ 'message_processing'=> __('Removing duplicated dictionary strings for language %s...', 'translatepress-multilingual' )
142
+ ),
143
+ 'remove_duplicate_untranslated_dictionary_rows' => array(
144
+ 'version' => '0',
145
+ 'option_name' => 'trp_remove_duplicate_untranslated_dictionary_rows',
146
+ 'callback' => array( $this->trp_query,'remove_untranslated_strings_if_translation_available'),
147
+ 'batch_size' => 10000,
148
+ 'message_initial' => '',
149
+ 'message_processing'=> __('Removing untranslated dictionary strings where translation is available for language %s...', 'translatepress-multilingual' )
150
+ ),
151
  'original_id_insert_166' => array(
152
  'version' => '1.6.6',
153
  'option_name' => 'trp_updated_database_original_id_insert_166',
276
  $updates_needed[ sanitize_text_field( $_REQUEST['trp_updb_action'] )]['message_processing']
277
  : __('Processing table for language %s...', 'translatepress-multilingual' );
278
 
279
+ if ($updates_needed[ sanitize_text_field( $_REQUEST['trp_updb_action'] ) ]['version'] != 0) {
280
+ $request['progress_message'] .= '<p>' . sprintf( $update_message_initial, $updates_needed[ sanitize_text_field( $_REQUEST['trp_updb_action'] ) ]['version'] ) . '</p>';
281
+ }
282
+ $request['progress_message'] .= '<br>' . sprintf( $update_message_processing, sanitize_text_field( $_REQUEST['trp_updb_lang'] ) );//phpcs:ignore
283
  }
284
  }else{
285
  if ( !isset( $updates_needed[ $_REQUEST['trp_updb_action'] ] ) ){
505
  return;
506
  }
507
  // prepare page structure
508
+
509
  require_once TRP_PLUGIN_DIR . 'partials/trp-remove-duplicate-rows.php';
510
 
511
+ if(isset( $_GET['trp_rm_duplicates_gettext'] )){
512
+ update_option('trp_remove_duplicate_gettext_rows', 'no');
513
+ update_option('trp_remove_duplicate_untranslated_gettext_rows', 'no');
514
  }
515
 
516
+ if(isset( $_GET['trp_rm_duplicates_dictionary'] )){
517
+ update_option('trp_remove_duplicate_dictionary_rows', 'no');
518
+ update_option('trp_remove_duplicate_untranslated_dictionary_rows', 'no');
519
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
 
521
+ if ( isset( $_GET['trp_rm_duplicates_original_strings'] ) ){
522
+ $this->trp_remove_duplicate_original_strings();
 
 
523
  }
524
 
525
+ if (isset( $_GET['trp_rm_duplicates_gettext'] ) || isset( $_GET['trp_rm_duplicates_dictionary'] ) || isset( $_GET['trp_rm_duplicates_original_strings'] )) {
526
+ $url = add_query_arg( array( 'page' => 'trp_update_database' ), site_url( 'wp-admin/admin.php' ) );
527
+ wp_safe_redirect( $url );
528
+ }
529
+ exit;
530
  }
531
 
532
  public function enqueue_update_script( $hook ) {
654
  update_option( 'trp_regenerate_original_meta_table', 'no' );
655
  update_option( 'trp_clean_original_meta_table', 'no' );
656
 
 
 
 
 
657
  }
658
 
659
  public function trp_regenerate_original_meta_table($language_code, $inferior_limit, $batch_size ){
includes/google-translate/class-google-translate-v2-machine-translator.php CHANGED
@@ -151,4 +151,14 @@ class TRP_Google_Translate_V2_Machine_Translator extends TRP_Machine_Translator
151
  public function get_engine_specific_language_codes($languages){
152
  return $this->trp_languages->get_iso_codes($languages);
153
  }
 
 
 
 
 
 
 
 
 
 
154
  }
151
  public function get_engine_specific_language_codes($languages){
152
  return $this->trp_languages->get_iso_codes($languages);
153
  }
154
+
155
+ /*
156
+ * Google does not support formality yet, but we need this for the machine translation tab to show the unsupported languages for formality
157
+ */
158
+ public function check_formality(){
159
+
160
+ $formality_supported_languages = array();
161
+
162
+ return $formality_supported_languages;
163
+ }
164
  }
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.1.7
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.9
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.1.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: 6.0
14
 
15
  == Copyright ==
16
  Copyright 2017 Cozmoslabs (www.cozmoslabs.com)
languages/translatepress-multilingual.catalog.php CHANGED
@@ -65,9 +65,11 @@
65
  <?php __("Automatic Translation", "translatepress-multilingual"); ?>
66
  <?php __("DeepL", "translatepress-multilingual"); ?>
67
  <?php __("Unsupported languages", "translatepress-multilingual"); ?>
 
 
 
68
  <?php __("Recheck supported languages", "translatepress-multilingual"); ?>
69
  <?php __("(last checked on %s)", "translatepress-multilingual"); ?>
70
- <?php __("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.", "translatepress-multilingual"); ?>
71
  <?php __("Please enter your Google Translate key.", "translatepress-multilingual"); ?>
72
  <?php __("Please enter your DeepL API key.", "translatepress-multilingual"); ?>
73
  <?php __("You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon, so that TranslatePress can function properly.", "translatepress-multilingual"); ?>
@@ -190,6 +192,10 @@
190
  <?php __("OG Image", "translatepress-multilingual"); ?>
191
  <?php __("OG Image Secure URL", "translatepress-multilingual"); ?>
192
  <?php __("Twitter Image", "translatepress-multilingual"); ?>
 
 
 
 
193
  <?php __("Inserting original strings for language %s...", "translatepress-multilingual"); ?>
194
  <?php __("Cleaning original strings table for language %s...", "translatepress-multilingual"); ?>
195
  <?php __("Updating original string ids for language %s...", "translatepress-multilingual"); ?>
@@ -208,12 +214,6 @@
208
  <?php __("Back to TranslatePress Settings", "translatepress-multilingual"); ?>
209
  <?php __("Successfully updated database!", "translatepress-multilingual"); ?>
210
  <?php __(" done.", "translatepress-multilingual"); ?>
211
- <?php __("Done.", "translatepress-multilingual"); ?>
212
- <?php __("Invalid nonce.", "translatepress-multilingual"); ?>
213
- <?php __("Querying table <strong>%s</strong>", "translatepress-multilingual"); ?>
214
- <?php __("%s duplicates removed", "translatepress-multilingual"); ?>
215
- <?php __("If the page does not redirect automatically", "translatepress-multilingual"); ?>
216
- <?php __("click here", "translatepress-multilingual"); ?>
217
  <?php __("Recreated original strings table.", "translatepress-multilingual"); ?>
218
  <?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"); ?>
219
  <?php __("TranslatePress", "translatepress-multilingual"); ?>
@@ -284,12 +284,16 @@
284
  <?php __("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.)", "translatepress-multilingual"); ?>
285
  <?php __("All Languages", "translatepress-multilingual"); ?>
286
  <?php __("Language", "translatepress-multilingual"); ?>
 
287
  <?php __("Code", "translatepress-multilingual"); ?>
288
  <?php __("Slug", "translatepress-multilingual"); ?>
 
 
 
289
  <?php __("Are you sure you want to remove this language?", "translatepress-multilingual"); ?>
290
  <?php __("Choose...", "translatepress-multilingual"); ?>
291
  <?php __("Custom Languages", "translatepress-multilingual"); ?>
292
- <?php __("Select the language you wish to make your website available in.", "translatepress-multilingual"); ?>
293
  <?php __("To add <strong>more than two languages</strong> and support for SEO Title, Description, Slug and more check out <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>.", "translatepress-multilingual"); ?>
294
  <?php __("TranslatePress Advanced Add-ons", "translatepress-multilingual"); ?>
295
  <?php __("Not only are you getting extra features and premium support, but you also help fund the future development of TranslatePress.", "translatepress-multilingual"); ?>
@@ -330,14 +334,17 @@
330
  <?php __("Response:", "translatepress-multilingual"); ?>
331
  <?php __("Response Body:", "translatepress-multilingual"); ?>
332
  <?php __("Entire Response From wp_remote_get():", "translatepress-multilingual"); ?>
333
- <?php __("Remove duplicate rows from TranslatePress tables", "translatepress-multilingual"); ?>
334
- <?php __("<strong>IMPORTANT NOTE: Before performing this action it is strongly recommended to first backup the database.</strong><br><br>This feature can be used to cleanup duplicate entries in TranslatePress trp_dictionary or trp_gettext tables. Such duplicates can appear in exceptional situations of unexpected behavior.", "translatepress-multilingual"); ?>
335
  <?php __("IMPORTANT: It is strongly recommended to first backup the database!! Are you sure you want to continue?", "translatepress-multilingual"); ?>
336
- <?php __("Batch size", "translatepress-multilingual"); ?>
337
- <?php __("The number of rows to check at once.<br>Choosing a smaller number helps solve the 504 error \"Page took too long to respond\" on large databases.<br>May take several minutes depending on the database size.", "translatepress-multilingual"); ?>
338
- <?php __("Remove duplicate dictionary rows", "translatepress-multilingual"); ?>
339
- <?php __("Remove duplicate gettext rows", "translatepress-multilingual"); ?>
340
- <?php __("Remove duplicate original strings", "translatepress-multilingual"); ?>
 
 
 
341
  <?php __("TranslatePress Database Updater", "translatepress-multilingual"); ?>
342
  <?php __("Updating TranslatePress tables", "translatepress-multilingual"); ?>
343
  <?php __("Limit this menu item to the following languages", "translatepress-multilingual"); ?>
@@ -389,9 +396,10 @@
389
  <?php __("Fixes attributes without spaces between them because they are not valid HTML.<br> May help fix missing or broken content from the HTML on translated pages.", "translatepress-multilingual"); ?>
390
  <?php __("Force slash at end of home url:", "translatepress-multilingual"); ?>
391
  <?php __("Ads a slash at the end of the home_url() function", "translatepress-multilingual"); ?>
 
 
392
  <?php __("Show opposite language in the language switcher", "translatepress-multilingual"); ?>
393
  <?php __("Transforms the language switcher into a button showing the other available language, not the current one.<br> Only works when there are exactly two languages, the default one and a translation one.<br>This will affect the shortcode language switcher and floating language switcher as well.<br> To achieve this in menu language switcher go to Appearance->Menus->Language Switcher and select Opposite Language.", "translatepress-multilingual"); ?>
394
- <?php __("Remove duplicate rows", "translatepress-multilingual"); ?>
395
  <?php __("Click <a href=\"%s\">here</a> to remove duplicate rows from the database.", "translatepress-multilingual"); ?>
396
  <?php __("Troubleshooting", "translatepress-multilingual"); ?>
397
  <?php __("Exclude strings", "translatepress-multilingual"); ?>
@@ -447,7 +455,8 @@
447
  <?php __("Click to sort strings by this column", "translatepress-multilingual"); ?>
448
  <?php __("Language in which the translation status filter applies. Leave unselected for the translation status to apply to ANY language", "translatepress-multilingual"); ?>
449
  <?php __("String Translation Editor", "translatepress-multilingual"); ?>
450
- <?php __("Select the languages you wish to make your website available in.", "translatepress-multilingual"); ?>
 
451
  <?php __("Post Slug", "translatepress-multilingual"); ?>
452
  <?php __("First by browser language, then IP address (recommended)", "translatepress-multilingual"); ?>
453
  <?php __("First by IP address, then by browser language", "translatepress-multilingual"); ?>
65
  <?php __("Automatic Translation", "translatepress-multilingual"); ?>
66
  <?php __("DeepL", "translatepress-multilingual"); ?>
67
  <?php __("Unsupported languages", "translatepress-multilingual"); ?>
68
+ <?php __("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.", "translatepress-multilingual"); ?>
69
+ <?php __("Languages without formality", "translatepress-multilingual"); ?>
70
+ <?php __("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.", "translatepress-multilingual"); ?>
71
  <?php __("Recheck supported languages", "translatepress-multilingual"); ?>
72
  <?php __("(last checked on %s)", "translatepress-multilingual"); ?>
 
73
  <?php __("Please enter your Google Translate key.", "translatepress-multilingual"); ?>
74
  <?php __("Please enter your DeepL API key.", "translatepress-multilingual"); ?>
75
  <?php __("You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon, so that TranslatePress can function properly.", "translatepress-multilingual"); ?>
192
  <?php __("OG Image", "translatepress-multilingual"); ?>
193
  <?php __("OG Image Secure URL", "translatepress-multilingual"); ?>
194
  <?php __("Twitter Image", "translatepress-multilingual"); ?>
195
+ <?php __("Removing duplicated gettext strings for language %s...", "translatepress-multilingual"); ?>
196
+ <?php __("Removing untranslated gettext strings where translation is available for language %s...", "translatepress-multilingual"); ?>
197
+ <?php __("Removing duplicated dictionary strings for language %s...", "translatepress-multilingual"); ?>
198
+ <?php __("Removing untranslated dictionary strings where translation is available for language %s...", "translatepress-multilingual"); ?>
199
  <?php __("Inserting original strings for language %s...", "translatepress-multilingual"); ?>
200
  <?php __("Cleaning original strings table for language %s...", "translatepress-multilingual"); ?>
201
  <?php __("Updating original string ids for language %s...", "translatepress-multilingual"); ?>
214
  <?php __("Back to TranslatePress Settings", "translatepress-multilingual"); ?>
215
  <?php __("Successfully updated database!", "translatepress-multilingual"); ?>
216
  <?php __(" done.", "translatepress-multilingual"); ?>
 
 
 
 
 
 
217
  <?php __("Recreated original strings table.", "translatepress-multilingual"); ?>
218
  <?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"); ?>
219
  <?php __("TranslatePress", "translatepress-multilingual"); ?>
284
  <?php __("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.)", "translatepress-multilingual"); ?>
285
  <?php __("All Languages", "translatepress-multilingual"); ?>
286
  <?php __("Language", "translatepress-multilingual"); ?>
287
+ <?php __("Formality", "translatepress-multilingual"); ?>
288
  <?php __("Code", "translatepress-multilingual"); ?>
289
  <?php __("Slug", "translatepress-multilingual"); ?>
290
+ <?php __("Default", "translatepress-multilingual"); ?>
291
+ <?php __("Formal", "translatepress-multilingual"); ?>
292
+ <?php __("Informal", "translatepress-multilingual"); ?>
293
  <?php __("Are you sure you want to remove this language?", "translatepress-multilingual"); ?>
294
  <?php __("Choose...", "translatepress-multilingual"); ?>
295
  <?php __("Custom Languages", "translatepress-multilingual"); ?>
296
+ <?php __("Select the languages you wish to make your website available in.<br>The Formality field is used by Automatic Translation to decide whether the translated text should lean towards formal or informal language. For now, it is supported only for a few languages and only by <a href=\"%s\">DeepL</a>.", "translatepress-multilingual"); ?>
297
  <?php __("To add <strong>more than two languages</strong> and support for SEO Title, Description, Slug and more check out <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>.", "translatepress-multilingual"); ?>
298
  <?php __("TranslatePress Advanced Add-ons", "translatepress-multilingual"); ?>
299
  <?php __("Not only are you getting extra features and premium support, but you also help fund the future development of TranslatePress.", "translatepress-multilingual"); ?>
334
  <?php __("Response:", "translatepress-multilingual"); ?>
335
  <?php __("Response Body:", "translatepress-multilingual"); ?>
336
  <?php __("Entire Response From wp_remote_get():", "translatepress-multilingual"); ?>
337
+ <?php __("Optimize TranslatePress database tables", "translatepress-multilingual"); ?>
338
+ <?php __("<strong>IMPORTANT NOTE: Before performing this action it is strongly recommended to first backup the database.</strong><br><br>", "translatepress-multilingual"); ?>
339
  <?php __("IMPORTANT: It is strongly recommended to first backup the database!! Are you sure you want to continue?", "translatepress-multilingual"); ?>
340
+ <?php __("Operations to perform", "translatepress-multilingual"); ?>
341
+ <?php __("Remove duplicate rows for gettext strings", "translatepress-multilingual"); ?>
342
+ <?php __("Cleans up all trp_gettext_* tables of duplicate rows. These tables contain translations for themes and plugin strings.", "translatepress-multilingual"); ?>
343
+ <?php __("Remove duplicate rows for dictionary strings", "translatepress-multilingual"); ?>
344
+ <?php __("Cleans up all trp_dictionary_* tables of duplicate rows. These tables contain translations for user-inputted strings such as post content, post title, menus etc.", "translatepress-multilingual"); ?>
345
+ <?php __("Remove duplicate rows for original dictionary strings", "translatepress-multilingual"); ?>
346
+ <?php __("Cleans up all trp_original_strings table of duplicate rows. This table contains strings in the default language, without any translation.<br>The trp_original_meta table, which contains meta information that refers to the post parent’s id, is also regenerated.<br>Such duplicates can appear in exceptional situations of unexpected behavior.", "translatepress-multilingual"); ?>
347
+ <?php __("Optimize Database", "translatepress-multilingual"); ?>
348
  <?php __("TranslatePress Database Updater", "translatepress-multilingual"); ?>
349
  <?php __("Updating TranslatePress tables", "translatepress-multilingual"); ?>
350
  <?php __("Limit this menu item to the following languages", "translatepress-multilingual"); ?>
396
  <?php __("Fixes attributes without spaces between them because they are not valid HTML.<br> May help fix missing or broken content from the HTML on translated pages.", "translatepress-multilingual"); ?>
397
  <?php __("Force slash at end of home url:", "translatepress-multilingual"); ?>
398
  <?php __("Ads a slash at the end of the home_url() function", "translatepress-multilingual"); ?>
399
+ <?php __("Open language switcher only on click", "translatepress-multilingual"); ?>
400
+ <?php __("Open the language switcher shortcode by clicking on it instead of hovering.<br> Close it by clicking on it, anywhere else on the screen or by pressing the escape key. This will affect only the shortcode language switcher.", "translatepress-multilingual"); ?>
401
  <?php __("Show opposite language in the language switcher", "translatepress-multilingual"); ?>
402
  <?php __("Transforms the language switcher into a button showing the other available language, not the current one.<br> Only works when there are exactly two languages, the default one and a translation one.<br>This will affect the shortcode language switcher and floating language switcher as well.<br> To achieve this in menu language switcher go to Appearance->Menus->Language Switcher and select Opposite Language.", "translatepress-multilingual"); ?>
 
403
  <?php __("Click <a href=\"%s\">here</a> to remove duplicate rows from the database.", "translatepress-multilingual"); ?>
404
  <?php __("Troubleshooting", "translatepress-multilingual"); ?>
405
  <?php __("Exclude strings", "translatepress-multilingual"); ?>
455
  <?php __("Click to sort strings by this column", "translatepress-multilingual"); ?>
456
  <?php __("Language in which the translation status filter applies. Leave unselected for the translation status to apply to ANY language", "translatepress-multilingual"); ?>
457
  <?php __("String Translation Editor", "translatepress-multilingual"); ?>
458
+ <?php __("Active*", "translatepress-multilingual"); ?>
459
+ <?php __("<br>* The inactive languages will still be visible and active for the admin. For other users they won't be visible in the language switchers and won't be accessible either.", "translatepress-multilingual"); ?>
460
  <?php __("Post Slug", "translatepress-multilingual"); ?>
461
  <?php __("First by browser language, then IP address (recommended)", "translatepress-multilingual"); ?>
462
  <?php __("First by IP address, then by browser language", "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:312, 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:509, includes/class-advanced-tab.php:520, includes/class-advanced-tab.php:614, includes/class-advanced-tab.php:645
57
  msgid "Are you sure you want to remove this item?"
58
  msgstr ""
59
 
60
- #: includes/class-advanced-tab.php:509, includes/class-advanced-tab.php:520, includes/class-advanced-tab.php:614, includes/class-advanced-tab.php:645, partials/main-settings-language-selector.php:40, add-ons-advanced/extra-languages/partials/language-selector-pro.php:43
61
  msgid "Remove"
62
  msgstr ""
63
 
64
- #: includes/class-advanced-tab.php:520, includes/class-advanced-tab.php:645, partials/main-settings-language-selector.php:82, add-ons-advanced/extra-languages/partials/language-selector-pro.php:84
65
  msgid "Add"
66
  msgstr ""
67
 
68
- #: includes/class-advanced-tab.php:598, includes/class-advanced-tab.php:632
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:808
189
  msgid "Dismiss this notice."
190
  msgstr ""
191
 
@@ -261,7 +261,7 @@ msgstr ""
261
  msgid "If your problem still isn't solved, try asking your hosting about your errors. The most common issue is missing permissions for the SQL user, such as the Create Tables permission."
262
  msgstr ""
263
 
264
- #: includes/class-install-plugins.php:34, includes/class-settings.php:162, add-ons-advanced/extra-languages/partials/language-selector-pro.php:10
265
  msgid "Active"
266
  msgstr ""
267
 
@@ -273,27 +273,35 @@ msgstr ""
273
  msgid "DeepL"
274
  msgstr ""
275
 
276
- #: includes/class-machine-translation-tab.php:165
277
  msgid "Unsupported languages"
278
  msgstr ""
279
 
280
- #: includes/class-machine-translation-tab.php:176
281
- msgid "Recheck supported languages"
282
  msgstr ""
283
 
284
- #: includes/class-machine-translation-tab.php:177
285
- msgid "(last checked on %s)"
286
  msgstr ""
287
 
288
- #: includes/class-machine-translation-tab.php:179
289
- 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."
290
  msgstr ""
291
 
292
- #: includes/class-machine-translator.php:137
 
 
 
 
 
 
 
 
293
  msgid "Please enter your Google Translate key."
294
  msgstr ""
295
 
296
- #: includes/class-machine-translator.php:152
297
  msgid "Please enter your DeepL API key."
298
  msgstr ""
299
 
@@ -401,39 +409,39 @@ msgstr ""
401
  msgid "Light"
402
  msgstr ""
403
 
404
- #: includes/class-settings.php:435, add-ons-advanced/extra-languages/class-extra-languages.php:44
405
  msgid "Error! Duplicate URL slug values."
406
  msgstr ""
407
 
408
- #: includes/class-settings.php:476
409
  msgid "Current Language"
410
  msgstr ""
411
 
412
- #: includes/class-settings.php:482
413
  msgid "Opposite Language"
414
  msgstr ""
415
 
416
- #: includes/class-settings.php:522
417
  msgid "General"
418
  msgstr ""
419
 
420
- #: includes/class-settings.php:527, includes/class-translation-manager.php:438
421
  msgid "Translate Site"
422
  msgstr ""
423
 
424
- #: includes/class-settings.php:532
425
  msgid "Addons"
426
  msgstr ""
427
 
428
- #: includes/class-settings.php:540
429
  msgid "License"
430
  msgstr ""
431
 
432
- #: includes/class-settings.php:584, includes/class-translation-manager.php:470
433
  msgid "Settings"
434
  msgstr ""
435
 
436
- #: includes/class-settings.php:588
437
  msgid "Pro Features"
438
  msgstr ""
439
 
@@ -777,107 +785,99 @@ msgstr ""
777
  msgid "Twitter Image"
778
  msgstr ""
779
 
780
- #: includes/class-upgrade.php:124
781
- msgid "Inserting original strings for language %s..."
782
  msgstr ""
783
 
784
  #: includes/class-upgrade.php:133
785
- msgid "Cleaning original strings table for language %s..."
786
  msgstr ""
787
 
788
  #: includes/class-upgrade.php:141
789
- msgid "Updating original string ids for language %s..."
790
  msgstr ""
791
 
792
  #: includes/class-upgrade.php:149
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
793
  msgid "Regenerating original meta table for language %s..."
794
  msgstr ""
795
 
796
- #: includes/class-upgrade.php:157
797
  msgid "Cleaning original meta table for language %s..."
798
  msgstr ""
799
 
800
- #: includes/class-upgrade.php:191
801
  msgid "TranslatePress data update"
802
  msgstr ""
803
 
804
- #: includes/class-upgrade.php:191
805
  msgid "We need to update your translations database to the latest version."
806
  msgstr ""
807
 
808
- #: includes/class-upgrade.php:192
809
  msgid "IMPORTANT: It is strongly recommended to first backup the database!\nAre you sure you want to continue?"
810
  msgstr ""
811
 
812
- #: includes/class-upgrade.php:192
813
  msgid "Run the updater"
814
  msgstr ""
815
 
816
- #: includes/class-upgrade.php:208
817
  msgid "Update aborted! Your user account doesn't have the capability to perform database updates."
818
  msgstr ""
819
 
820
- #: includes/class-upgrade.php:213
821
  msgid "Update aborted! Invalid nonce."
822
  msgstr ""
823
 
824
- #: includes/class-upgrade.php:252
825
  msgid "Update aborted! Incorrect action."
826
  msgstr ""
827
 
828
- #: includes/class-upgrade.php:255
829
  msgid "Update aborted! Incorrect language code."
830
  msgstr ""
831
 
832
- #: includes/class-upgrade.php:241
833
  msgid "Updating database to version %s+"
834
  msgstr ""
835
 
836
- #: includes/class-upgrade.php:245, includes/class-upgrade.php:305
837
  msgid "Processing table for language %s..."
838
  msgstr ""
839
 
840
- #: includes/class-upgrade.php:228, includes/class-upgrade.php:334, includes/class-upgrade.php:487, includes/class-upgrade.php:492
841
  msgid "Back to TranslatePress Settings"
842
  msgstr ""
843
 
844
- #: includes/class-upgrade.php:232
845
  msgid "Successfully updated database!"
846
  msgstr ""
847
 
848
- #: includes/class-upgrade.php:309, includes/class-upgrade.php:302
849
  msgid " done."
850
  msgstr ""
851
 
852
- #: includes/class-upgrade.php:487
853
- msgid "Done."
854
- msgstr ""
855
-
856
- #: includes/class-upgrade.php:492
857
- msgid "Invalid nonce."
858
- msgstr ""
859
-
860
- #: includes/class-upgrade.php:516
861
- msgid "Querying table <strong>%s</strong>"
862
- msgstr ""
863
-
864
- #: includes/class-upgrade.php:558
865
- msgid "%s duplicates removed"
866
- msgstr ""
867
-
868
- #: includes/class-upgrade.php:596, includes/class-upgrade.php:727
869
- msgid "If the page does not redirect automatically"
870
- msgstr ""
871
-
872
- #: includes/class-upgrade.php:596, includes/class-upgrade.php:727
873
- msgid "click here"
874
- msgstr ""
875
-
876
- #: includes/class-upgrade.php:716
877
  msgid "Recreated original strings table."
878
  msgstr ""
879
 
880
- #: includes/class-upgrade.php:806
881
  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."
882
  msgstr ""
883
 
@@ -1157,49 +1157,65 @@ msgid "Language"
1157
  msgstr ""
1158
 
1159
  #: partials/main-settings-language-selector.php:8, add-ons-advanced/extra-languages/partials/language-selector-pro.php:8
1160
- msgid "Code"
1161
  msgstr ""
1162
 
1163
  #: partials/main-settings-language-selector.php:9, add-ons-advanced/extra-languages/partials/language-selector-pro.php:9
 
 
 
 
1164
  msgid "Slug"
1165
  msgstr ""
1166
 
1167
- #: partials/main-settings-language-selector.php:40, add-ons-advanced/extra-languages/partials/language-selector-pro.php:43
 
 
 
 
 
 
 
 
 
 
 
 
1168
  msgid "Are you sure you want to remove this language?"
1169
  msgstr ""
1170
 
1171
- #: partials/main-settings-language-selector.php:53, add-ons-advanced/extra-languages/partials/language-selector-pro.php:56
1172
  msgid "Choose..."
1173
  msgstr ""
1174
 
1175
- #: partials/main-settings-language-selector.php:57, add-ons-advanced/extra-languages/partials/language-selector-pro.php:60
1176
  msgid "Custom Languages"
1177
  msgstr ""
1178
 
1179
- #: partials/main-settings-language-selector.php:86
1180
- msgid "Select the language you wish to make your website available in."
1181
  msgstr ""
1182
 
1183
  #. translators: %1$s is the URL to the add-ons. %2$2 is for the TranslatePress add-on verbiage.
1184
- #: partials/main-settings-language-selector.php:98
1185
  msgid "To add <strong>more than two languages</strong> and support for SEO Title, Description, Slug and more check out <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>."
1186
  msgstr ""
1187
 
1188
- #: partials/main-settings-language-selector.php:100
1189
  msgctxt "Verbiage for the TranslatePress Advanced add-ons"
1190
  msgid "TranslatePress Advanced Add-ons"
1191
  msgstr ""
1192
 
1193
- #: partials/main-settings-language-selector.php:102
1194
  msgid "Not only are you getting extra features and premium support, but you also help fund the future development of TranslatePress."
1195
  msgstr ""
1196
 
1197
- #: partials/main-settings-language-selector.php:106
1198
  msgctxt "Link to the TranslatePress add-ons"
1199
  msgid "TranslatePress Advanced Add-ons"
1200
  msgstr ""
1201
 
1202
- #: partials/main-settings-language-selector.php:93
1203
  msgid "To add <strong>more than two languages</strong> activate the <strong>Extra Languages Add-on</strong> from <a href=\"%s\" class=\"trp-translatepress-account-page\" target=\"_blank\" title=\"Add-ons page\">the Add-ons Page</a>. Once activated, you'll be able to add unlimited languages."
1204
  msgstr ""
1205
 
@@ -1343,12 +1359,12 @@ msgstr ""
1343
  msgid "Entire Response From wp_remote_get():"
1344
  msgstr ""
1345
 
1346
- #: partials/trp-remove-duplicate-rows.php:7
1347
- msgid "Remove duplicate rows from TranslatePress tables"
1348
  msgstr ""
1349
 
1350
  #: partials/trp-remove-duplicate-rows.php:10
1351
- msgid "<strong>IMPORTANT NOTE: Before performing this action it is strongly recommended to first backup the database.</strong><br><br>This feature can be used to cleanup duplicate entries in TranslatePress trp_dictionary or trp_gettext tables. Such duplicates can appear in exceptional situations of unexpected behavior."
1352
  msgstr ""
1353
 
1354
  #: partials/trp-remove-duplicate-rows.php:12
@@ -1356,23 +1372,35 @@ msgid "IMPORTANT: It is strongly recommended to first backup the database!! Are
1356
  msgstr ""
1357
 
1358
  #: partials/trp-remove-duplicate-rows.php:15
1359
- msgid "Batch size"
 
 
 
 
 
 
 
 
1360
  msgstr ""
1361
 
1362
- #: partials/trp-remove-duplicate-rows.php:19
1363
- msgid "The number of rows to check at once.<br>Choosing a smaller number helps solve the 504 error \"Page took too long to respond\" on large databases.<br>May take several minutes depending on the database size."
1364
  msgstr ""
1365
 
1366
  #: partials/trp-remove-duplicate-rows.php:28
1367
- msgid "Remove duplicate dictionary rows"
 
 
 
 
1368
  msgstr ""
1369
 
1370
- #: partials/trp-remove-duplicate-rows.php:29
1371
- msgid "Remove duplicate gettext rows"
1372
  msgstr ""
1373
 
1374
- #: partials/trp-remove-duplicate-rows.php:30
1375
- msgid "Remove duplicate original strings"
1376
  msgstr ""
1377
 
1378
  #: partials/trp-update-database.php:3
@@ -1579,6 +1607,14 @@ msgstr ""
1579
  msgid "Ads a slash at the end of the home_url() function"
1580
  msgstr ""
1581
 
 
 
 
 
 
 
 
 
1582
  #: includes/advanced-settings/opposite-flag-shortcode.php:8
1583
  msgid "Show opposite language in the language switcher"
1584
  msgstr ""
@@ -1587,10 +1623,6 @@ msgstr ""
1587
  msgid "Transforms the language switcher into a button showing the other available language, not the current one.<br> Only works when there are exactly two languages, the default one and a translation one.<br>This will affect the shortcode language switcher and floating language switcher as well.<br> To achieve this in menu language switcher go to Appearance->Menus->Language Switcher and select Opposite Language."
1588
  msgstr ""
1589
 
1590
- #: includes/advanced-settings/remove-duplicates-from-db.php:7
1591
- msgid "Remove duplicate rows"
1592
- msgstr ""
1593
-
1594
  #: includes/advanced-settings/remove-duplicates-from-db.php:8
1595
  msgid "Click <a href=\"%s\">here</a> to remove duplicate rows from the database."
1596
  msgstr ""
@@ -1813,8 +1845,12 @@ msgstr ""
1813
  msgid "String Translation Editor"
1814
  msgstr ""
1815
 
1816
- #: add-ons-advanced/extra-languages/partials/language-selector-pro.php:87
1817
- msgid "Select the languages you wish to make your website available in."
 
 
 
 
1818
  msgstr ""
1819
 
1820
  #: add-ons-advanced/seo-pack/includes/class-slug-manager.php:49, add-ons-advanced/seo-pack/includes/string-translation/class-string-translation-seo.php:56
49
  msgid "Settings saved."
50
  msgstr ""
51
 
52
+ #: includes/class-advanced-tab.php:313, 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:510, includes/class-advanced-tab.php:521, includes/class-advanced-tab.php:615, includes/class-advanced-tab.php:646
57
  msgid "Are you sure you want to remove this item?"
58
  msgstr ""
59
 
60
+ #: includes/class-advanced-tab.php:510, includes/class-advanced-tab.php:521, includes/class-advanced-tab.php:615, includes/class-advanced-tab.php:646, 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:521, includes/class-advanced-tab.php:646, 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:599, includes/class-advanced-tab.php:633
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:736
189
  msgid "Dismiss this notice."
190
  msgstr ""
191
 
261
  msgid "If your problem still isn't solved, try asking your hosting about your errors. The most common issue is missing permissions for the SQL user, such as the Create Tables permission."
262
  msgstr ""
263
 
264
+ #: includes/class-install-plugins.php:34, includes/class-settings.php:162
265
  msgid "Active"
266
  msgstr ""
267
 
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
+
300
+ #: includes/class-machine-translator.php:140
301
  msgid "Please enter your Google Translate key."
302
  msgstr ""
303
 
304
+ #: includes/class-machine-translator.php:155
305
  msgid "Please enter your DeepL API key."
306
  msgstr ""
307
 
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:604
445
  msgid "Pro Features"
446
  msgstr ""
447
 
785
  msgid "Twitter Image"
786
  msgstr ""
787
 
788
+ #: includes/class-upgrade.php:125
789
+ msgid "Removing duplicated gettext strings for language %s..."
790
  msgstr ""
791
 
792
  #: includes/class-upgrade.php:133
793
+ msgid "Removing untranslated gettext strings where translation is available for language %s..."
794
  msgstr ""
795
 
796
  #: includes/class-upgrade.php:141
797
+ msgid "Removing duplicated dictionary strings for language %s..."
798
  msgstr ""
799
 
800
  #: includes/class-upgrade.php:149
801
+ msgid "Removing untranslated dictionary strings where translation is available for language %s..."
802
+ msgstr ""
803
+
804
+ #: includes/class-upgrade.php:156
805
+ msgid "Inserting original strings for language %s..."
806
+ msgstr ""
807
+
808
+ #: includes/class-upgrade.php:165
809
+ msgid "Cleaning original strings table for language %s..."
810
+ msgstr ""
811
+
812
+ #: includes/class-upgrade.php:173
813
+ msgid "Updating original string ids for language %s..."
814
+ msgstr ""
815
+
816
+ #: includes/class-upgrade.php:181
817
  msgid "Regenerating original meta table for language %s..."
818
  msgstr ""
819
 
820
+ #: includes/class-upgrade.php:189
821
  msgid "Cleaning original meta table for language %s..."
822
  msgstr ""
823
 
824
+ #: includes/class-upgrade.php:223
825
  msgid "TranslatePress data update"
826
  msgstr ""
827
 
828
+ #: includes/class-upgrade.php:223
829
  msgid "We need to update your translations database to the latest version."
830
  msgstr ""
831
 
832
+ #: includes/class-upgrade.php:224
833
  msgid "IMPORTANT: It is strongly recommended to first backup the database!\nAre you sure you want to continue?"
834
  msgstr ""
835
 
836
+ #: includes/class-upgrade.php:224
837
  msgid "Run the updater"
838
  msgstr ""
839
 
840
+ #: includes/class-upgrade.php:240
841
  msgid "Update aborted! Your user account doesn't have the capability to perform database updates."
842
  msgstr ""
843
 
844
+ #: includes/class-upgrade.php:245
845
  msgid "Update aborted! Invalid nonce."
846
  msgstr ""
847
 
848
+ #: includes/class-upgrade.php:286
849
  msgid "Update aborted! Incorrect action."
850
  msgstr ""
851
 
852
+ #: includes/class-upgrade.php:289
853
  msgid "Update aborted! Incorrect language code."
854
  msgstr ""
855
 
856
+ #: includes/class-upgrade.php:273
857
  msgid "Updating database to version %s+"
858
  msgstr ""
859
 
860
+ #: includes/class-upgrade.php:277, includes/class-upgrade.php:339
861
  msgid "Processing table for language %s..."
862
  msgstr ""
863
 
864
+ #: includes/class-upgrade.php:260, includes/class-upgrade.php:368
865
  msgid "Back to TranslatePress Settings"
866
  msgstr ""
867
 
868
+ #: includes/class-upgrade.php:264
869
  msgid "Successfully updated database!"
870
  msgstr ""
871
 
872
+ #: includes/class-upgrade.php:343, includes/class-upgrade.php:336
873
  msgid " done."
874
  msgstr ""
875
 
876
+ #: includes/class-upgrade.php:648
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
877
  msgid "Recreated original strings table."
878
  msgstr ""
879
 
880
+ #: includes/class-upgrade.php:734
881
  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."
882
  msgstr ""
883
 
1157
  msgstr ""
1158
 
1159
  #: partials/main-settings-language-selector.php:8, add-ons-advanced/extra-languages/partials/language-selector-pro.php:8
1160
+ msgid "Formality"
1161
  msgstr ""
1162
 
1163
  #: partials/main-settings-language-selector.php:9, add-ons-advanced/extra-languages/partials/language-selector-pro.php:9
1164
+ msgid "Code"
1165
+ msgstr ""
1166
+
1167
+ #: partials/main-settings-language-selector.php:10, add-ons-advanced/extra-languages/partials/language-selector-pro.php:10
1168
  msgid "Slug"
1169
  msgstr ""
1170
 
1171
+ #: partials/main-settings-language-selector.php:17, add-ons-advanced/extra-languages/partials/language-selector-pro.php:18
1172
+ msgid "Default"
1173
+ msgstr ""
1174
+
1175
+ #: partials/main-settings-language-selector.php:18, add-ons-advanced/extra-languages/partials/language-selector-pro.php:19
1176
+ msgid "Formal"
1177
+ msgstr ""
1178
+
1179
+ #: partials/main-settings-language-selector.php:19, add-ons-advanced/extra-languages/partials/language-selector-pro.php:20
1180
+ msgid "Informal"
1181
+ msgstr ""
1182
+
1183
+ #: partials/main-settings-language-selector.php:60, add-ons-advanced/extra-languages/partials/language-selector-pro.php:62
1184
  msgid "Are you sure you want to remove this language?"
1185
  msgstr ""
1186
 
1187
+ #: partials/main-settings-language-selector.php:73, add-ons-advanced/extra-languages/partials/language-selector-pro.php:75
1188
  msgid "Choose..."
1189
  msgstr ""
1190
 
1191
+ #: partials/main-settings-language-selector.php:77, add-ons-advanced/extra-languages/partials/language-selector-pro.php:79
1192
  msgid "Custom Languages"
1193
  msgstr ""
1194
 
1195
+ #: partials/main-settings-language-selector.php:105, add-ons-advanced/extra-languages/partials/language-selector-pro.php:106
1196
+ msgid "Select the languages you wish to make your website available in.<br>The Formality field is used by Automatic Translation to decide whether the translated text should lean towards formal or informal language. For now, it is supported only for a few languages and only by <a href=\"%s\">DeepL</a>."
1197
  msgstr ""
1198
 
1199
  #. translators: %1$s is the URL to the add-ons. %2$2 is for the TranslatePress add-on verbiage.
1200
+ #: partials/main-settings-language-selector.php:116
1201
  msgid "To add <strong>more than two languages</strong> and support for SEO Title, Description, Slug and more check out <a href=\"%1$s\" target=\"_blank\" title=\"%2$s\">%2$s</a>."
1202
  msgstr ""
1203
 
1204
+ #: partials/main-settings-language-selector.php:118
1205
  msgctxt "Verbiage for the TranslatePress Advanced add-ons"
1206
  msgid "TranslatePress Advanced Add-ons"
1207
  msgstr ""
1208
 
1209
+ #: partials/main-settings-language-selector.php:120
1210
  msgid "Not only are you getting extra features and premium support, but you also help fund the future development of TranslatePress."
1211
  msgstr ""
1212
 
1213
+ #: partials/main-settings-language-selector.php:124
1214
  msgctxt "Link to the TranslatePress add-ons"
1215
  msgid "TranslatePress Advanced Add-ons"
1216
  msgstr ""
1217
 
1218
+ #: partials/main-settings-language-selector.php:111
1219
  msgid "To add <strong>more than two languages</strong> activate the <strong>Extra Languages Add-on</strong> from <a href=\"%s\" class=\"trp-translatepress-account-page\" target=\"_blank\" title=\"Add-ons page\">the Add-ons Page</a>. Once activated, you'll be able to add unlimited languages."
1220
  msgstr ""
1221
 
1359
  msgid "Entire Response From wp_remote_get():"
1360
  msgstr ""
1361
 
1362
+ #: partials/trp-remove-duplicate-rows.php:7, includes/advanced-settings/remove-duplicates-from-db.php:7
1363
+ msgid "Optimize TranslatePress database tables"
1364
  msgstr ""
1365
 
1366
  #: partials/trp-remove-duplicate-rows.php:10
1367
+ msgid "<strong>IMPORTANT NOTE: Before performing this action it is strongly recommended to first backup the database.</strong><br><br>"
1368
  msgstr ""
1369
 
1370
  #: partials/trp-remove-duplicate-rows.php:12
1372
  msgstr ""
1373
 
1374
  #: partials/trp-remove-duplicate-rows.php:15
1375
+ msgid "Operations to perform"
1376
+ msgstr ""
1377
+
1378
+ #: partials/trp-remove-duplicate-rows.php:21
1379
+ msgid "Remove duplicate rows for gettext strings"
1380
+ msgstr ""
1381
+
1382
+ #: partials/trp-remove-duplicate-rows.php:23
1383
+ msgid "Cleans up all trp_gettext_* tables of duplicate rows. These tables contain translations for themes and plugin strings."
1384
  msgstr ""
1385
 
1386
+ #: partials/trp-remove-duplicate-rows.php:26
1387
+ msgid "Remove duplicate rows for dictionary strings"
1388
  msgstr ""
1389
 
1390
  #: partials/trp-remove-duplicate-rows.php:28
1391
+ msgid "Cleans up all trp_dictionary_* tables of duplicate rows. These tables contain translations for user-inputted strings such as post content, post title, menus etc."
1392
+ msgstr ""
1393
+
1394
+ #: partials/trp-remove-duplicate-rows.php:31
1395
+ msgid "Remove duplicate rows for original dictionary strings"
1396
  msgstr ""
1397
 
1398
+ #: partials/trp-remove-duplicate-rows.php:33
1399
+ msgid "Cleans up all trp_original_strings table of duplicate rows. This table contains strings in the default language, without any translation.<br>The trp_original_meta table, which contains meta information that refers to the post parent’s id, is also regenerated.<br>Such duplicates can appear in exceptional situations of unexpected behavior."
1400
  msgstr ""
1401
 
1402
+ #: partials/trp-remove-duplicate-rows.php:39
1403
+ msgid "Optimize Database"
1404
  msgstr ""
1405
 
1406
  #: partials/trp-update-database.php:3
1607
  msgid "Ads a slash at the end of the home_url() function"
1608
  msgstr ""
1609
 
1610
+ #: includes/advanced-settings/open-language-switcher-shortcode-on-click.php:8
1611
+ msgid "Open language switcher only on click"
1612
+ msgstr ""
1613
+
1614
+ #: includes/advanced-settings/open-language-switcher-shortcode-on-click.php:9
1615
+ msgid "Open the language switcher shortcode by clicking on it instead of hovering.<br> Close it by clicking on it, anywhere else on the screen or by pressing the escape key. This will affect only the shortcode language switcher."
1616
+ msgstr ""
1617
+
1618
  #: includes/advanced-settings/opposite-flag-shortcode.php:8
1619
  msgid "Show opposite language in the language switcher"
1620
  msgstr ""
1623
  msgid "Transforms the language switcher into a button showing the other available language, not the current one.<br> Only works when there are exactly two languages, the default one and a translation one.<br>This will affect the shortcode language switcher and floating language switcher as well.<br> To achieve this in menu language switcher go to Appearance->Menus->Language Switcher and select Opposite Language."
1624
  msgstr ""
1625
 
 
 
 
 
1626
  #: includes/advanced-settings/remove-duplicates-from-db.php:8
1627
  msgid "Click <a href=\"%s\">here</a> to remove duplicate rows from the database."
1628
  msgstr ""
1845
  msgid "String Translation Editor"
1846
  msgstr ""
1847
 
1848
+ #: add-ons-advanced/extra-languages/partials/language-selector-pro.php:11
1849
+ msgid "Active*"
1850
+ msgstr ""
1851
+
1852
+ #: add-ons-advanced/extra-languages/partials/language-selector-pro.php:107
1853
+ msgid "<br>* The inactive languages will still be visible and active for the admin. For other users they won't be visible in the language switchers and won't be accessible either."
1854
  msgstr ""
1855
 
1856
  #: add-ons-advanced/seo-pack/includes/class-slug-manager.php:49, add-ons-advanced/seo-pack/includes/string-translation/class-string-translation-seo.php:56
partials/main-settings-language-selector.php CHANGED
@@ -5,6 +5,7 @@
5
  <thead>
6
  <tr>
7
  <th colspan="2"><?php esc_html_e( 'Language', 'translatepress-multilingual' ); ?></th>
 
8
  <th><?php esc_html_e( 'Code', 'translatepress-multilingual' ); ?></th>
9
  <th><?php esc_html_e( 'Slug', 'translatepress-multilingual' ); ?></th>
10
  </tr>
@@ -12,7 +13,15 @@
12
  <tbody id="trp-sortable-languages" class="trp-language-selector-limited">
13
 
14
  <?php
15
- foreach ($this->settings['translation-languages'] as $selected_language_code ){
 
 
 
 
 
 
 
 
16
  $default_language = ( $selected_language_code == $this->settings['default-language'] );?>
17
  <tr class="trp-language">
18
  <td><span class="trp-sortable-handle"></span></td>
@@ -30,6 +39,17 @@
30
  <input type="hidden" class="trp-hidden-default-language" name="trp_settings[translation-languages][]" value="<?php echo esc_attr( $selected_language_code );?>" />
31
  <?php } ?>
32
  </td>
 
 
 
 
 
 
 
 
 
 
 
33
  <td>
34
  <input class="trp-language-code trp-code-slug" type="text" disabled value="<?php echo esc_attr( $selected_language_code ); ?>">
35
  </td>
@@ -82,9 +102,7 @@
82
  <button type="button" id="trp-add-language" class="button-secondary"><?php esc_html_e( 'Add', 'translatepress-multilingual' );?></button>
83
  </div>
84
  <p class="description">
85
- <?php
86
- esc_html_e( 'Select the language you wish to make your website available in.', 'translatepress-multilingual');
87
- ?>
88
  </p>
89
  <p class="trp-upsell-multiple-languages" style="display: none;">
90
  <?php
5
  <thead>
6
  <tr>
7
  <th colspan="2"><?php esc_html_e( 'Language', 'translatepress-multilingual' ); ?></th>
8
+ <th><?php esc_html_e( 'Formality', 'translatepress-multilingual' ); ?></th>
9
  <th><?php esc_html_e( 'Code', 'translatepress-multilingual' ); ?></th>
10
  <th><?php esc_html_e( 'Slug', 'translatepress-multilingual' ); ?></th>
11
  </tr>
13
  <tbody id="trp-sortable-languages" class="trp-language-selector-limited">
14
 
15
  <?php
16
+ $formality_array = array(
17
+ 'default' => __('Default', 'translatepress-multilingual'),
18
+ 'formal' => __('Formal', 'translatepress-multilingual'),
19
+ 'informal'=> __('Informal', 'translatepress-multilingual')
20
+ );
21
+ ?>
22
+
23
+ <?php
24
+ foreach ($this->settings['translation-languages'] as $key=>$selected_language_code ){
25
  $default_language = ( $selected_language_code == $this->settings['default-language'] );?>
26
  <tr class="trp-language">
27
  <td><span class="trp-sortable-handle"></span></td>
39
  <input type="hidden" class="trp-hidden-default-language" name="trp_settings[translation-languages][]" value="<?php echo esc_attr( $selected_language_code );?>" />
40
  <?php } ?>
41
  </td>
42
+ <td>
43
+ <select name="trp_settings[translation-languages-formality][]" class="trp-translation-language-formality" >
44
+ <?php
45
+ foreach ( $formality_array as $value => $label ) {
46
+ ?>
47
+ <option value="<?php echo esc_attr( $value ); ?>" <?php echo ( isset($this->settings['translation-languages-formality-parameter'][$selected_language_code]) && $value == $this->settings['translation-languages-formality-parameter'][$selected_language_code] ) ? 'selected' : ''; ?>><?php echo esc_html( $label ); ?></option>
48
+ <?php
49
+ }
50
+ ?>
51
+ </select>
52
+ </td>
53
  <td>
54
  <input class="trp-language-code trp-code-slug" type="text" disabled value="<?php echo esc_attr( $selected_language_code ); ?>">
55
  </td>
102
  <button type="button" id="trp-add-language" class="button-secondary"><?php esc_html_e( 'Add', 'translatepress-multilingual' );?></button>
103
  </div>
104
  <p class="description">
105
+ <?php echo wp_kses ( sprintf(__( 'Select the languages you wish to make your website available in.<br>The Formality field is used by Automatic Translation to decide whether the translated text should lean towards formal or informal language. For now, it is supported only for a few languages and only by <a href="%s">DeepL</a>.', 'translatepress-multilingual' ), esc_url('https://www.deepl.com/docs-api/translating-text/') ), array('a' => array('href' => array(), 'title' => array()), 'br' => array()) ); ?>
 
 
106
  </p>
107
  <p class="trp-upsell-multiple-languages" style="display: none;">
108
  <?php
partials/trp-remove-duplicate-rows.php CHANGED
@@ -4,30 +4,39 @@
4
 
5
  <div class="grid feat-header">
6
  <div class="grid-cell">
7
- <h2><?php esc_html_e('Remove duplicate rows from TranslatePress tables', 'translatepress-multilingual' );?> </h2>
8
  <?php if ( empty( $_GET['trp_rm_duplicates'] ) ){ ?>
9
  <div>
10
- <?php echo wp_kses_post( __( '<strong>IMPORTANT NOTE: Before performing this action it is strongly recommended to first backup the database.</strong><br><br>This feature can be used to cleanup duplicate entries in TranslatePress trp_dictionary or trp_gettext tables. Such duplicates can appear in exceptional situations of unexpected behavior.', 'translatepress-multilingual' ) )?>
11
  </div>
12
  <form onsubmit="return confirm('<?php echo esc_js( __( 'IMPORTANT: It is strongly recommended to first backup the database!! Are you sure you want to continue?', 'translatepress-multilingual' ) ); ?>');">
13
  <table class="form-table">
14
  <tr>
15
- <th scope="row"><?php esc_html_e( 'Batch size', 'translatepress-multilingual' ); ?></th>
16
  <td>
17
- <input name="trp_rm_batch_size" type="number" value="10000" step="100" min="100">
18
- <p>
19
- <i><?php echo wp_kses_post( __( 'The number of rows to check at once.<br>Choosing a smaller number helps solve the 504 error "Page took too long to respond" on large databases.<br>May take several minutes depending on the database size.', 'translatepress-multilingual' ) ); ?></i>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  </p>
21
  </td>
22
  </tr>
23
  </table>
24
- <input type="hidden" name="trp_rm_nonce" value="<?php echo esc_attr( wp_create_nonce('tpremoveduplicaterows') )?>">
25
- <input type="hidden" name="page" value="trp_remove_duplicate_rows">
26
- <input type="hidden" name="trp_rm_batch" value="1">
27
- <input type="hidden" name="trp_rm_duplicates" value="<?php echo esc_attr( $this->settings['translation-languages'][0] ); ?>">
28
- <input type="submit" class="button-primary" name="trp_rm_duplicates_dictionary" value="<?php esc_attr_e( 'Remove duplicate dictionary rows', 'translatepress-multilingual' ); ?>">
29
- <input type="submit" class="button-primary" name="trp_rm_duplicates_gettext" value="<?php esc_attr_e( 'Remove duplicate gettext rows', 'translatepress-multilingual' ); ?>">
30
- <input type="submit" class="button-primary" name="trp_rm_duplicates_original_strings" value="<?php esc_attr_e( 'Remove duplicate original strings', 'translatepress-multilingual' ); ?>">
31
  </form>
32
  <?php } ?>
33
 
4
 
5
  <div class="grid feat-header">
6
  <div class="grid-cell">
7
+ <h2><?php esc_html_e('Optimize TranslatePress database tables', 'translatepress-multilingual' );?> </h2>
8
  <?php if ( empty( $_GET['trp_rm_duplicates'] ) ){ ?>
9
  <div>
10
+ <?php echo wp_kses_post( __( '<strong>IMPORTANT NOTE: Before performing this action it is strongly recommended to first backup the database.</strong><br><br>', 'translatepress-multilingual' ) )?>
11
  </div>
12
  <form onsubmit="return confirm('<?php echo esc_js( __( 'IMPORTANT: It is strongly recommended to first backup the database!! Are you sure you want to continue?', 'translatepress-multilingual' ) ); ?>');">
13
  <table class="form-table">
14
  <tr>
15
+ <th scope="row"><?php esc_attr_e('Operations to perform', 'translatepress-multilingual');?></th>
16
  <td>
17
+ <input type="hidden" name="trp_rm_nonce" value="<?php echo esc_attr( wp_create_nonce('tpremoveduplicaterows') )?>">
18
+ <input type="hidden" name="page" value="trp_remove_duplicate_rows">
19
+ <input type="hidden" name="trp_rm_batch" value="1">
20
+ <input type="hidden" name="trp_rm_duplicates" value="<?php echo esc_attr( $this->settings['translation-languages'][0] ); ?>">
21
+ <input type="checkbox" name="trp_rm_duplicates_gettext" id="trp_rm_duplicates_gettext" checked><label for="trp_rm_duplicates_gettext"><?php esc_attr_e( 'Remove duplicate rows for gettext strings', 'translatepress-multilingual' ); ?></label></input><br>
22
+ <p class="description">
23
+ <?php echo wp_kses ( __( 'Cleans up all trp_gettext_* tables of duplicate rows. These tables contain translations for themes and plugin strings.', 'translatepress-multilingual' ), array( 'br' => array() ) ); ?>
24
+ </p>
25
+ <br>
26
+ <input type="checkbox" name="trp_rm_duplicates_dictionary" id="trp_rm_duplicates_dictionary" checked><label for="trp_rm_duplicates_dictionary"><?php esc_attr_e( 'Remove duplicate rows for dictionary strings', 'translatepress-multilingual' ); ?></label></input><br>
27
+ <p class="description">
28
+ <?php echo wp_kses ( __( 'Cleans up all trp_dictionary_* tables of duplicate rows. These tables contain translations for user-inputted strings such as post content, post title, menus etc.', 'translatepress-multilingual' ), array( 'br' => array() ) ); ?>
29
+ </p>
30
+ <br>
31
+ <input type="checkbox" name="trp_rm_duplicates_original_strings" id="trp_rm_duplicates_original_strings" checked><label for="trp_rm_duplicates_original_strings"><?php esc_attr_e( 'Remove duplicate rows for original dictionary strings', 'translatepress-multilingual' ); ?></label></input><br>
32
+ <p class="description">
33
+ <?php echo wp_kses ( __( 'Cleans up all trp_original_strings table of duplicate rows. This table contains strings in the default language, without any translation.<br>The trp_original_meta table, which contains meta information that refers to the post parent’s id, is also regenerated.<br>Such duplicates can appear in exceptional situations of unexpected behavior.', 'translatepress-multilingual' ), array( 'br' => array() ) ); ?>
34
  </p>
35
  </td>
36
  </tr>
37
  </table>
38
+ <br>
39
+ <input type="submit" class="button-primary" name="trp_rm_duplicates_of_the_selected_option" value="<?php esc_attr_e( 'Optimize Database', 'translatepress-multilingual' ); ?>">
 
 
 
 
 
40
  </form>
41
  <?php } ?>
42
 
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.2
7
  Requires PHP: 5.6.20
8
- Stable tag: 2.1.7
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.1.7 =
144
  * Added form in settings to sign up for TranslatePress email course
145
  * Fixed issue when logging in that redirected to "page not found" when languages are reordered
5
  Requires at least: 3.1.0
6
  Tested up to: 5.8.2
7
  Requires PHP: 5.6.20
8
+ Stable tag: 2.1.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
140
 
141
 
142
  == Changelog ==
143
+ = 2.1.8 =
144
+ * Added language formality setting to be used in Automatic Translation
145
+ * Added Advanced option for enabling clickable shortcode language switcher
146
+ * Improved tool for database optimization from Advanced tab
147
+ * Fixed translation blocks ignoring target blank on links
148
+
149
  = 2.1.7 =
150
  * Added form in settings to sign up for TranslatePress email course
151
  * Fixed issue when logging in that redirected to "page not found" when languages are reordered