Version Description
- Fixed truncated archive urls on front page on translated pages
- Fixed bug with language switcher not working properly for posts with translated slugs when using Advanced option to Exclude Paths From Translation
- Fixed canonical of archive links sometimes not having translated slugs in url
- Fixed FAQ schema not being fully translated
- Fixed trp_hreflang hook parameters
Download this release
Release Info
Developer | razvan.mo |
Plugin | TranslatePress – Translate Multilingual sites |
Version | 2.2.8 |
Comparing to | |
See all releases |
Code changes from version 2.2.7 to 2.2.8
- class-translate-press.php +1 -1
- includes/advanced-settings/do-not-translate-certain-paths.php +8 -1
- includes/advanced-settings/fix-broken-html.php +1 -1
- includes/advanced-settings/fix-invalid-space-between-html-attr.php +0 -56
- includes/class-advanced-tab.php +0 -1
- includes/class-edd-sl-plugin-updater.php +45 -39
- includes/class-url-converter.php +50 -15
- includes/compatibility-functions.php +5 -5
- index.php +1 -1
- languages/translatepress-multilingual.catalog.php +1 -3
- languages/translatepress-multilingual.pot +14 -22
- readme.txt +9 -2
class-translate-press.php
CHANGED
@@ -60,7 +60,7 @@ class TRP_Translate_Press{
|
|
60 |
define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
61 |
define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
|
62 |
define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
|
63 |
-
define( 'TRP_PLUGIN_VERSION', '2.2.
|
64 |
|
65 |
wp_cache_add_non_persistent_groups(array('trp'));
|
66 |
|
60 |
define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
|
61 |
define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
|
62 |
define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
|
63 |
+
define( 'TRP_PLUGIN_VERSION', '2.2.8' );
|
64 |
|
65 |
wp_cache_add_non_persistent_groups(array('trp'));
|
66 |
|
includes/advanced-settings/do-not-translate-certain-paths.php
CHANGED
@@ -216,7 +216,14 @@ function trp_exclude_include_do_not_redirect_on_excluded_pages( $redirect, $lang
|
|
216 |
|
217 |
}
|
218 |
|
219 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
function trp_exclude_include_redirect_to_default_language(){
|
221 |
|
222 |
if( isset( $_GET['trp-edit-translation'] ) && ( $_GET['trp-edit-translation'] == 'true' || $_GET['trp-edit-translation'] == 'preview' ) )
|
216 |
|
217 |
}
|
218 |
|
219 |
+
/**
|
220 |
+
* The function verifies if we are on an excluded path and automatically redirects to the default language in that case.
|
221 |
+
* The function '$url_converter->get_url_for_language( $settings['default-language'], null, '' )' is needed in the case we are on a page with a different
|
222 |
+
* language code then the default and the path is the one excluded, so we need to get the correct url in the default language.
|
223 |
+
*
|
224 |
+
* Redirects to the excluded page in the default language.
|
225 |
+
*/
|
226 |
+
add_action( 'template_redirect', 'trp_exclude_include_redirect_to_default_language', 1 );
|
227 |
function trp_exclude_include_redirect_to_default_language(){
|
228 |
|
229 |
if( isset( $_GET['trp-edit-translation'] ) && ( $_GET['trp-edit-translation'] == 'true' || $_GET['trp-edit-translation'] == 'preview' ) )
|
includes/advanced-settings/fix-broken-html.php
CHANGED
@@ -6,7 +6,7 @@ function trp_register_fix_broken_html( $settings_array ){
|
|
6 |
'name' => 'fix_broken_html',
|
7 |
'type' => 'checkbox',
|
8 |
'label' => esc_html__( 'Fix broken HTML', 'translatepress-multilingual' ),
|
9 |
-
'description' => wp_kses( __( 'General attempt to fix broken or missing HTML on translated pages.<br
|
10 |
);
|
11 |
return $settings_array;
|
12 |
}
|
6 |
'name' => 'fix_broken_html',
|
7 |
'type' => 'checkbox',
|
8 |
'label' => esc_html__( 'Fix broken HTML', 'translatepress-multilingual' ),
|
9 |
+
'description' => wp_kses( __( 'General attempt to fix broken or missing HTML on translated pages.<br/>', 'translatepress-multilingual' ), array( 'br' => array(), 'strong' => array() ) ),
|
10 |
);
|
11 |
return $settings_array;
|
12 |
}
|
includes/advanced-settings/fix-invalid-space-between-html-attr.php
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
add_filter( 'trp_register_advanced_settings', 'trp_register_fix_invalid_space_between_html_attr', 40 );
|
4 |
-
function trp_register_fix_invalid_space_between_html_attr( $settings_array ){
|
5 |
-
$settings_array[] = array(
|
6 |
-
'name' => 'fix_invalid_space_between_html_attr',
|
7 |
-
'type' => 'checkbox',
|
8 |
-
'label' => esc_html__( 'Fix spaces between HTML attributes', 'translatepress-multilingual' ),
|
9 |
-
'description' => wp_kses( __( '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' ), array( 'br' => array()) ),
|
10 |
-
);
|
11 |
-
return $settings_array;
|
12 |
-
}
|
13 |
-
|
14 |
-
add_filter('trp_before_translate_content', 'trp_fix_html_attributes_without_spaces');
|
15 |
-
function trp_fix_html_attributes_without_spaces($output){
|
16 |
-
|
17 |
-
$option = get_option( 'trp_advanced_settings', true );
|
18 |
-
if ( isset( $option['fix_invalid_space_between_html_attr'] ) && $option['fix_invalid_space_between_html_attr'] === 'yes' ){
|
19 |
-
$size = strlen($output);
|
20 |
-
$pos = 0;
|
21 |
-
$pos_c = 0;
|
22 |
-
|
23 |
-
while ($pos_c < $size){
|
24 |
-
|
25 |
-
$len = strcspn($output, '<' , $pos);
|
26 |
-
$pos += $len;
|
27 |
-
|
28 |
-
$len_c = strcspn($output, '>' , $pos);
|
29 |
-
$pos_c += $len_c;
|
30 |
-
|
31 |
-
$even_detection_apostrophe = 0;
|
32 |
-
$even_detection_quote = 0;
|
33 |
-
for ($i = $pos; $i < $pos_c; $i++){
|
34 |
-
$char = $output[$i]; //next
|
35 |
-
if ($char == '"' ){
|
36 |
-
$even_detection_quote ++;
|
37 |
-
if ( $even_detection_quote % 2 == 0){
|
38 |
-
$output = substr_replace( $output, ' ', $i+1, 0 );
|
39 |
-
}
|
40 |
-
}
|
41 |
-
|
42 |
-
if ($char == "'" ){
|
43 |
-
$even_detection_apostrophe ++;
|
44 |
-
if ( $even_detection_apostrophe % 2 == 0){
|
45 |
-
$output = substr_replace( $output, ' ', $i+1, 0 );
|
46 |
-
}
|
47 |
-
}
|
48 |
-
}
|
49 |
-
|
50 |
-
$pos_c ++;
|
51 |
-
$pos = $pos_c;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
|
55 |
-
return $output;
|
56 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-advanced-tab.php
CHANGED
@@ -219,7 +219,6 @@ class TRP_Advanced_Tab {
|
|
219 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/exclude-selectors.php');
|
220 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/exclude-selectors-automatic-translation.php');
|
221 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/fix-broken-html.php');
|
222 |
-
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/fix-invalid-space-between-html-attr.php');
|
223 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/show-dynamic-content-before-translation.php');
|
224 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/enable-hreflang-xdefault.php');
|
225 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/strip-gettext-post-content.php');
|
219 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/exclude-selectors.php');
|
220 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/exclude-selectors-automatic-translation.php');
|
221 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/fix-broken-html.php');
|
|
|
222 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/show-dynamic-content-before-translation.php');
|
223 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/enable-hreflang-xdefault.php');
|
224 |
include_once(TRP_PLUGIN_DIR . 'includes/advanced-settings/strip-gettext-post-content.php');
|
includes/class-edd-sl-plugin-updater.php
CHANGED
@@ -584,49 +584,58 @@ class TRP_Plugin_Updater{
|
|
584 |
*/
|
585 |
public function check_license( $transient_data ){
|
586 |
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
$
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
616 |
}
|
617 |
}
|
618 |
}
|
|
|
|
|
|
|
|
|
619 |
}
|
620 |
|
621 |
-
|
|
|
|
|
622 |
$this->update_option('trp_license_details', $license_information_for_all_addons);
|
623 |
-
|
624 |
}
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
$license_information_for_all_addons['invalid'][] = (object) array( 'error' => 'missing' );
|
629 |
-
$this->update_option('trp_license_details', $license_information_for_all_addons);
|
630 |
}
|
631 |
|
632 |
return $transient_data;
|
@@ -760,8 +769,6 @@ class TRP_Plugin_Updater{
|
|
760 |
}
|
761 |
}
|
762 |
|
763 |
-
|
764 |
-
|
765 |
function deactivate_license() {
|
766 |
|
767 |
// listen for our activate button to be clicked
|
@@ -819,5 +826,4 @@ class TRP_Plugin_Updater{
|
|
819 |
}
|
820 |
}
|
821 |
|
822 |
-
|
823 |
}
|
584 |
*/
|
585 |
public function check_license( $transient_data ){
|
586 |
|
587 |
+
if( empty( $transient_data->response ) )
|
588 |
+
return $transient_data;
|
589 |
+
|
590 |
+
if ( false === ( $trp_check_license = get_transient( 'trp_checked_licence' ) ) ) {
|
591 |
+
|
592 |
+
$license = trim( $this->get_option( 'trp_license_key' ) );
|
593 |
+
if( $license ) {
|
594 |
+
$license_status = trim($this->get_option('trp_license_status'));
|
595 |
+
|
596 |
+
if ($license_status) { // do this only if the user activated the license on this site
|
597 |
+
$license_information_for_all_addons = array();
|
598 |
+
|
599 |
+
$trp = TRP_Translate_Press::get_trp_instance();
|
600 |
+
if (!empty($trp->active_pro_addons)) {
|
601 |
+
foreach ($trp->active_pro_addons as $active_pro_addon_name) {
|
602 |
+
// data to send in our API request
|
603 |
+
$api_params = array(
|
604 |
+
'edd_action' => 'activate_license', //as the license is already activated this does not do anything. We could use check_license action but it gives different results so we can't use it consistently with the result we get from the moment we activate it
|
605 |
+
'license' => $license,
|
606 |
+
'item_name' => urlencode($active_pro_addon_name), // the name of our product in EDD
|
607 |
+
'url' => home_url()
|
608 |
+
);
|
609 |
+
|
610 |
+
// Call the custom API.
|
611 |
+
$response = wp_remote_post($this->store_url, array('timeout' => 15, 'sslverify' => false, 'body' => $api_params));
|
612 |
+
|
613 |
+
// make sure the response came back okay
|
614 |
+
if (!is_wp_error($response)) {
|
615 |
+
$license_data = json_decode(wp_remote_retrieve_body($response));
|
616 |
+
if (false === $license_data->success) {
|
617 |
+
$license_information_for_all_addons['invalid'][] = $license_data;
|
618 |
+
break;//we only need one failure
|
619 |
+
} else {
|
620 |
+
$license_information_for_all_addons['valid'][] = $license_data;
|
621 |
+
}
|
622 |
}
|
623 |
}
|
624 |
}
|
625 |
+
|
626 |
+
//store the license reponse for each addon in the database
|
627 |
+
$this->update_option('trp_license_details', $license_information_for_all_addons);
|
628 |
+
|
629 |
}
|
630 |
|
631 |
+
} else {
|
632 |
+
//we need to throw a notice if we have a pro addon active and no license entered
|
633 |
+
$license_information_for_all_addons['invalid'][] = (object) array( 'error' => 'missing' );
|
634 |
$this->update_option('trp_license_details', $license_information_for_all_addons);
|
|
|
635 |
}
|
636 |
+
|
637 |
+
set_transient( 'trp_checked_licence', 'yes', DAY_IN_SECONDS );
|
638 |
+
|
|
|
|
|
639 |
}
|
640 |
|
641 |
return $transient_data;
|
769 |
}
|
770 |
}
|
771 |
|
|
|
|
|
772 |
function deactivate_license() {
|
773 |
|
774 |
// listen for our activate button to be clicked
|
826 |
}
|
827 |
}
|
828 |
|
|
|
829 |
}
|
includes/class-url-converter.php
CHANGED
@@ -192,7 +192,7 @@ class TRP_Url_Converter {
|
|
192 |
|
193 |
foreach ($languages as $language){
|
194 |
$language_hreflang = strtok( $language, '_' );
|
195 |
-
$language_hreflang = apply_filters( 'trp_hreflang', $language_hreflang, $
|
196 |
if (!in_array($language_hreflang, $hreflang_duplicates)){
|
197 |
if(isset($hreflang_duplicates_region_independent[ $language ] )) {
|
198 |
echo $hreflang_duplicates_region_independent[ $language ]; /* phpcs:ignore */ /* escaped inside the array */
|
@@ -369,6 +369,14 @@ class TRP_Url_Converter {
|
|
369 |
}
|
370 |
}
|
371 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
if( $post_id ){
|
373 |
|
374 |
/*
|
@@ -382,8 +390,6 @@ class TRP_Url_Converter {
|
|
382 |
*
|
383 |
*/
|
384 |
|
385 |
-
$TRP_LANGUAGE = $this->get_lang_from_url_string( $url );
|
386 |
-
|
387 |
$processed_permalink = get_permalink($post_id);
|
388 |
|
389 |
$url_to_replace = ($url_obj->isSchemeless()) ? trailingslashit(trailingslashit( home_url() ) . ltrim($url, '/') ) : $url;
|
@@ -398,28 +404,53 @@ class TRP_Url_Converter {
|
|
398 |
trp_bulk_debug($debug, array('url' => $url, 'new url' => $new_url, 'found post id' => $post_id, 'url type' => 'based on permalink', 'for language' => $TRP_LANGUAGE));
|
399 |
$TRP_LANGUAGE = $trp_language_copy;
|
400 |
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
|
|
|
|
405 |
$current_term_link = get_term_link( $trp_current_url_term_slug, $trp_current_url_taxonomy);
|
|
|
406 |
$TRP_LANGUAGE = $language;
|
|
|
407 |
$check_term_link = get_term_link($trp_current_url_term_slug, $trp_current_url_taxonomy);
|
408 |
-
if (!is_wp_error($check_term_link))
|
409 |
-
$new_url =
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
$TRP_LANGUAGE = $trp_language_copy;
|
414 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
$TRP_LANGUAGE = $language;
|
416 |
if ( empty($url_obj->getQuery()) ) {
|
417 |
-
$new_url = $this->maybe_add_pagination_to_blog_page( get_post_type_archive_link( 'post' ) );
|
418 |
} else {
|
419 |
$new_url = rtrim( $this->maybe_add_pagination_to_blog_page( get_post_type_archive_link( 'post' ) ), '/') . '/?' . $url_obj->getQuery();
|
420 |
}
|
421 |
$TRP_LANGUAGE = $trp_language_copy;
|
422 |
-
|
|
|
|
|
|
|
|
|
423 |
// we're just adding the new language to the url
|
424 |
$new_url_obj = $url_obj;
|
425 |
if ($abs_home_url_obj->getPath() == "/") {
|
@@ -449,8 +480,12 @@ class TRP_Url_Converter {
|
|
449 |
$new_url = $new_url_obj->getUri();
|
450 |
|
451 |
trp_bulk_debug($debug, array('url' => $url, 'new url' => $new_url, 'lang' => $language, 'url type' => 'custom url with language', 'abs home path' => $abs_home_url_obj->getPath()));
|
|
|
|
|
|
|
452 |
}
|
453 |
}
|
|
|
454 |
|
455 |
/* fix links for woocommerce on language switcher for product categories and product tags */
|
456 |
if( class_exists( 'WooCommerce' ) ){
|
192 |
|
193 |
foreach ($languages as $language){
|
194 |
$language_hreflang = strtok( $language, '_' );
|
195 |
+
$language_hreflang = apply_filters( 'trp_hreflang', $language_hreflang, $language );
|
196 |
if (!in_array($language_hreflang, $hreflang_duplicates)){
|
197 |
if(isset($hreflang_duplicates_region_independent[ $language ] )) {
|
198 |
echo $hreflang_duplicates_region_independent[ $language ]; /* phpcs:ignore */ /* escaped inside the array */
|
369 |
}
|
370 |
}
|
371 |
|
372 |
+
$TRP_LANGUAGE = $this->get_lang_from_url_string( $url );
|
373 |
+
|
374 |
+
if ($TRP_LANGUAGE == null){
|
375 |
+
$TRP_LANGUAGE = $this->settings['default-language'];
|
376 |
+
}
|
377 |
+
|
378 |
+
$new_url_has_been_determined = false;
|
379 |
+
|
380 |
if( $post_id ){
|
381 |
|
382 |
/*
|
390 |
*
|
391 |
*/
|
392 |
|
|
|
|
|
393 |
$processed_permalink = get_permalink($post_id);
|
394 |
|
395 |
$url_to_replace = ($url_obj->isSchemeless()) ? trailingslashit(trailingslashit( home_url() ) . ltrim($url, '/') ) : $url;
|
404 |
trp_bulk_debug($debug, array('url' => $url, 'new url' => $new_url, 'found post id' => $post_id, 'url type' => 'based on permalink', 'for language' => $TRP_LANGUAGE));
|
405 |
$TRP_LANGUAGE = $trp_language_copy;
|
406 |
|
407 |
+
$new_url_has_been_determined = true;
|
408 |
+
|
409 |
+
}
|
410 |
+
|
411 |
+
if( isset( $trp_current_url_term_slug ) && isset($trp_current_url_taxonomy) && $new_url_has_been_determined === false){
|
412 |
+
// check here if it is a term link
|
413 |
$current_term_link = get_term_link( $trp_current_url_term_slug, $trp_current_url_taxonomy);
|
414 |
+
$language_to_replace = $TRP_LANGUAGE;
|
415 |
$TRP_LANGUAGE = $language;
|
416 |
+
$current_term_link= apply_filters( 'trp_get_url_for_language', $current_term_link, $url, $language_to_replace, $this->get_abs_home(), $this->get_lang_from_url_string($url), $this->get_url_slug( $language ) );
|
417 |
$check_term_link = get_term_link($trp_current_url_term_slug, $trp_current_url_taxonomy);
|
418 |
+
if (!is_wp_error($check_term_link) && strpos(urldecode( $url ), $current_term_link) === 0) {
|
419 |
+
$new_url = str_replace( $current_term_link, $check_term_link, urldecode( $url ) );
|
420 |
+
$new_url_has_been_determined = true;
|
421 |
+
}
|
|
|
422 |
$TRP_LANGUAGE = $trp_language_copy;
|
423 |
+
}
|
424 |
+
|
425 |
+
/**
|
426 |
+
* We try to look for a possible posts archive link that can be on the front page or another page in order to add pagination.
|
427 |
+
*/
|
428 |
+
$url_stripped = $url;
|
429 |
+
$posts_archive_link = get_post_type_archive_link('post');
|
430 |
+
|
431 |
+
if( !empty($url_obj->getQuery()) ){
|
432 |
+
$url_stripped = strtok($url_stripped, '?');
|
433 |
+
}
|
434 |
+
$url_stripped = rtrim($url_stripped, '/');
|
435 |
+
|
436 |
+
$posts_archive_link = strtok($posts_archive_link, '?');
|
437 |
+
$posts_archive_link = rtrim($this->maybe_add_pagination_to_blog_page($posts_archive_link), '/');
|
438 |
+
|
439 |
+
if( is_home() && $url_stripped === $posts_archive_link && ( isset( $_SERVER['REQUEST_URI'] ) && strpos( esc_url_raw( $_SERVER['REQUEST_URI'] ), 'sitemap') === false && strpos( esc_url_raw( $_SERVER['REQUEST_URI'] ), '.xml') === false ) &&
|
440 |
+
$new_url_has_been_determined === false)
|
441 |
+
{//for some reason in yoast sitemap is_home() is true ..so we need to check if we are not in the sitemap itself
|
442 |
$TRP_LANGUAGE = $language;
|
443 |
if ( empty($url_obj->getQuery()) ) {
|
444 |
+
$new_url = $this->maybe_add_pagination_to_blog_page( trailingslashit(get_post_type_archive_link( 'post' ) ));
|
445 |
} else {
|
446 |
$new_url = rtrim( $this->maybe_add_pagination_to_blog_page( get_post_type_archive_link( 'post' ) ), '/') . '/?' . $url_obj->getQuery();
|
447 |
}
|
448 |
$TRP_LANGUAGE = $trp_language_copy;
|
449 |
+
|
450 |
+
$new_url_has_been_determined = true;
|
451 |
+
}
|
452 |
+
|
453 |
+
if ($new_url_has_been_determined === false){
|
454 |
// we're just adding the new language to the url
|
455 |
$new_url_obj = $url_obj;
|
456 |
if ($abs_home_url_obj->getPath() == "/") {
|
480 |
$new_url = $new_url_obj->getUri();
|
481 |
|
482 |
trp_bulk_debug($debug, array('url' => $url, 'new url' => $new_url, 'lang' => $language, 'url type' => 'custom url with language', 'abs home path' => $abs_home_url_obj->getPath()));
|
483 |
+
|
484 |
+
$new_url_has_been_determined = true;
|
485 |
+
|
486 |
}
|
487 |
}
|
488 |
+
$TRP_LANGUAGE = $trp_language_copy;
|
489 |
|
490 |
/* fix links for woocommerce on language switcher for product categories and product tags */
|
491 |
if( class_exists( 'WooCommerce' ) ){
|
includes/compatibility-functions.php
CHANGED
@@ -772,12 +772,12 @@ function trp_superfly_change_menu_loading_hook(){
|
|
772 |
*/
|
773 |
add_filter( 'wpseo_canonical', 'trp_wpseo_canonical_compat', 99999, 2);
|
774 |
function trp_wpseo_canonical_compat( $canonical, $presentation_class = null ){
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
|
780 |
-
|
781 |
};
|
782 |
|
783 |
add_filter( 'wpseo_opengraph_url', 'trp_opengraph_url', 99999 );
|
772 |
*/
|
773 |
add_filter( 'wpseo_canonical', 'trp_wpseo_canonical_compat', 99999, 2);
|
774 |
function trp_wpseo_canonical_compat( $canonical, $presentation_class = null ){
|
775 |
+
global $TRP_LANGUAGE;
|
776 |
+
$trp = TRP_Translate_Press::get_trp_instance();
|
777 |
+
$url_converter = $trp->get_component( 'url_converter' );
|
778 |
+
$canonical = $url_converter->get_url_for_language( $TRP_LANGUAGE, $canonical, '' );
|
779 |
|
780 |
+
return $canonical;
|
781 |
};
|
782 |
|
783 |
add_filter( 'wpseo_opengraph_url', 'trp_opengraph_url', 99999 );
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: TranslatePress - Multilingual
|
4 |
Plugin URI: https://translatepress.com/
|
5 |
Description: Experience a better way of translating your WordPress site using a visual front-end translation editor, with full support for WooCommerce and site builders.
|
6 |
-
Version: 2.2.
|
7 |
Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
|
8 |
Author URI: https://cozmoslabs.com/
|
9 |
Text Domain: translatepress-multilingual
|
3 |
Plugin Name: TranslatePress - Multilingual
|
4 |
Plugin URI: https://translatepress.com/
|
5 |
Description: Experience a better way of translating your WordPress site using a visual front-end translation editor, with full support for WooCommerce and site builders.
|
6 |
+
Version: 2.2.8
|
7 |
Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
|
8 |
Author URI: https://cozmoslabs.com/
|
9 |
Text Domain: translatepress-multilingual
|
languages/translatepress-multilingual.catalog.php
CHANGED
@@ -401,9 +401,7 @@
|
|
401 |
<?php __("Exclude strings from automatic translation", "translatepress-multilingual"); ?>
|
402 |
<?php __("Do not automatically translate these strings (ex. names, technical words...)<br>Paragraphs containing these strings will still be translated except for the specified part.", "translatepress-multilingual"); ?>
|
403 |
<?php __("Fix broken HTML", "translatepress-multilingual"); ?>
|
404 |
-
<?php __("General attempt to fix broken or missing HTML on translated pages.<br
|
405 |
-
<?php __("Fix spaces between HTML attributes", "translatepress-multilingual"); ?>
|
406 |
-
<?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"); ?>
|
407 |
<?php __("Force slash at end of home url:", "translatepress-multilingual"); ?>
|
408 |
<?php __("Ads a slash at the end of the home_url() function", "translatepress-multilingual"); ?>
|
409 |
<?php __("Show Both (recommended)", "translatepress-multilingual"); ?>
|
401 |
<?php __("Exclude strings from automatic translation", "translatepress-multilingual"); ?>
|
402 |
<?php __("Do not automatically translate these strings (ex. names, technical words...)<br>Paragraphs containing these strings will still be translated except for the specified part.", "translatepress-multilingual"); ?>
|
403 |
<?php __("Fix broken HTML", "translatepress-multilingual"); ?>
|
404 |
+
<?php __("General attempt to fix broken or missing HTML on translated pages.<br/>", "translatepress-multilingual"); ?>
|
|
|
|
|
405 |
<?php __("Force slash at end of home url:", "translatepress-multilingual"); ?>
|
406 |
<?php __("Ads a slash at the end of the home_url() function", "translatepress-multilingual"); ?>
|
407 |
<?php __("Show Both (recommended)", "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:
|
53 |
msgid "Yes"
|
54 |
msgstr ""
|
55 |
|
56 |
-
#: includes/class-advanced-tab.php:
|
57 |
msgid "Are you sure you want to remove this item?"
|
58 |
msgstr ""
|
59 |
|
60 |
-
#: includes/class-advanced-tab.php:
|
61 |
msgid "Remove"
|
62 |
msgstr ""
|
63 |
|
64 |
-
#: includes/class-advanced-tab.php:
|
65 |
msgid "Add"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: includes/class-advanced-tab.php:
|
69 |
msgid "Select..."
|
70 |
msgstr ""
|
71 |
|
@@ -85,35 +85,35 @@ msgstr ""
|
|
85 |
msgid "Error"
|
86 |
msgstr ""
|
87 |
|
88 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
89 |
msgid "Your license key expired on %s."
|
90 |
msgstr ""
|
91 |
|
92 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
93 |
msgid "Your license key has been disabled."
|
94 |
msgstr ""
|
95 |
|
96 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
97 |
msgid "Invalid license."
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
101 |
msgid "Your license is not active for this URL."
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
105 |
msgid "This appears to be an invalid license key for %s."
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
109 |
msgid "Your license key has reached its activation limit."
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
113 |
msgid "An error occurred, please try again."
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: includes/class-edd-sl-plugin-updater.php:
|
117 |
msgid "You have successfully activated your license"
|
118 |
msgstr ""
|
119 |
|
@@ -1628,15 +1628,7 @@ msgid "Fix broken HTML"
|
|
1628 |
msgstr ""
|
1629 |
|
1630 |
#: includes/advanced-settings/fix-broken-html.php:9
|
1631 |
-
msgid "General attempt to fix broken or missing HTML on translated pages.<br
|
1632 |
-
msgstr ""
|
1633 |
-
|
1634 |
-
#: includes/advanced-settings/fix-invalid-space-between-html-attr.php:8
|
1635 |
-
msgid "Fix spaces between HTML attributes"
|
1636 |
-
msgstr ""
|
1637 |
-
|
1638 |
-
#: includes/advanced-settings/fix-invalid-space-between-html-attr.php:9
|
1639 |
-
msgid "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."
|
1640 |
msgstr ""
|
1641 |
|
1642 |
#: includes/advanced-settings/force-slash-at-end-of-links.php:9
|
49 |
msgid "Settings saved."
|
50 |
msgstr ""
|
51 |
|
52 |
+
#: includes/class-advanced-tab.php:318, includes/class-error-manager.php:172, partials/machine-translation-settings-page.php:17, partials/machine-translation-settings-page.php:121, partials/machine-translation-settings-page.php:141, partials/machine-translation-settings-page.php:192, partials/main-settings-page.php:42, partials/main-settings-page.php:55, partials/main-settings-page.php:68
|
53 |
msgid "Yes"
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: includes/class-advanced-tab.php:528, includes/class-advanced-tab.php:539, includes/class-advanced-tab.php:633, includes/class-advanced-tab.php:664
|
57 |
msgid "Are you sure you want to remove this item?"
|
58 |
msgstr ""
|
59 |
|
60 |
+
#: includes/class-advanced-tab.php:528, includes/class-advanced-tab.php:539, includes/class-advanced-tab.php:633, includes/class-advanced-tab.php:664, partials/main-settings-language-selector.php:60, add-ons-advanced/extra-languages/partials/language-selector-pro.php:62
|
61 |
msgid "Remove"
|
62 |
msgstr ""
|
63 |
|
64 |
+
#: includes/class-advanced-tab.php:539, includes/class-advanced-tab.php:664, partials/main-settings-language-selector.php:102, add-ons-advanced/extra-languages/partials/language-selector-pro.php:103
|
65 |
msgid "Add"
|
66 |
msgstr ""
|
67 |
|
68 |
+
#: includes/class-advanced-tab.php:617, includes/class-advanced-tab.php:651
|
69 |
msgid "Select..."
|
70 |
msgstr ""
|
71 |
|
85 |
msgid "Error"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: includes/class-edd-sl-plugin-updater.php:715
|
89 |
msgid "Your license key expired on %s."
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/class-edd-sl-plugin-updater.php:720
|
93 |
msgid "Your license key has been disabled."
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: includes/class-edd-sl-plugin-updater.php:723
|
97 |
msgid "Invalid license."
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: includes/class-edd-sl-plugin-updater.php:727
|
101 |
msgid "Your license is not active for this URL."
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: includes/class-edd-sl-plugin-updater.php:730
|
105 |
msgid "This appears to be an invalid license key for %s."
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: includes/class-edd-sl-plugin-updater.php:733
|
109 |
msgid "Your license key has reached its activation limit."
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: includes/class-edd-sl-plugin-updater.php:736, includes/class-edd-sl-plugin-updater.php:704, includes/class-edd-sl-plugin-updater.php:805
|
113 |
msgid "An error occurred, please try again."
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: includes/class-edd-sl-plugin-updater.php:767
|
117 |
msgid "You have successfully activated your license"
|
118 |
msgstr ""
|
119 |
|
1628 |
msgstr ""
|
1629 |
|
1630 |
#: includes/advanced-settings/fix-broken-html.php:9
|
1631 |
+
msgid "General attempt to fix broken or missing HTML on translated pages.<br/>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1632 |
msgstr ""
|
1633 |
|
1634 |
#: includes/advanced-settings/force-slash-at-end-of-links.php:9
|
readme.txt
CHANGED
@@ -3,9 +3,9 @@ Contributors: cozmoslabs, razvan.mo, madalin.ungureanu, sareiodata, cristophor
|
|
3 |
Donate link: https://www.translatepress.com/
|
4 |
Tags: translate, translation, multilingual, automatic translation, bilingual, front-end translation, google translate, language
|
5 |
Requires at least: 3.1.0
|
6 |
-
Tested up to:
|
7 |
Requires PHP: 5.6.20
|
8 |
-
Stable tag: 2.2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -140,6 +140,13 @@ For more information please check out our [documentation](https://translatepress
|
|
140 |
|
141 |
|
142 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
= 2.2.7 =
|
144 |
* Added compatibility for WooCommerce PDF Catalog plugin
|
145 |
* Fixed edge case causing SQL errors due to case sensitivity on table names
|
3 |
Donate link: https://www.translatepress.com/
|
4 |
Tags: translate, translation, multilingual, automatic translation, bilingual, front-end translation, google translate, language
|
5 |
Requires at least: 3.1.0
|
6 |
+
Tested up to: 6.0
|
7 |
Requires PHP: 5.6.20
|
8 |
+
Stable tag: 2.2.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.2.8 =
|
144 |
+
* Fixed truncated archive urls on front page on translated pages
|
145 |
+
* Fixed bug with language switcher not working properly for posts with translated slugs when using Advanced option to Exclude Paths From Translation
|
146 |
+
* Fixed canonical of archive links sometimes not having translated slugs in url
|
147 |
+
* Fixed FAQ schema not being fully translated
|
148 |
+
* Fixed trp_hreflang hook parameters
|
149 |
+
|
150 |
= 2.2.7 =
|
151 |
* Added compatibility for WooCommerce PDF Catalog plugin
|
152 |
* Fixed edge case causing SQL errors due to case sensitivity on table names
|