Lingotek Translation - Version 1.5.7

Version Description

(2022-06-06) = - Fixed handling of undefined Polylang constants

Download this release

Release Info

Developer lopez93
Plugin Icon 128x128 Lingotek Translation
Version 1.5.7
Comparing to
See all releases

Code changes from version 1.5.6 to 1.5.7

Files changed (2) hide show
  1. lingotek.php +14 -10
  2. readme.txt +5 -1
lingotek.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  Plugin name: Lingotek Translation
4
  Plugin URI: http://lingotek.com/wordpress#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wplingotektranslationplugin
5
- Version: 1.5.6
6
  Author: Lingotek and Frédéric Demarle
7
  Author uri: http://lingotek.com
8
  Description: Lingotek offers convenient cloud-based localization and translation.
@@ -19,7 +19,7 @@ if ( ! function_exists( 'add_action' ) ) {
19
  }
20
 
21
  // Plugin version (should match above meta).
22
- define( 'LINGOTEK_VERSION', '1.5.6' );
23
  define( 'LINGOTEK_MIN_PLL_VERSION', '1.8' );
24
  // Plugin name as known by WordPress.
25
  define( 'LINGOTEK_BASENAME', plugin_basename( __FILE__ ) );
@@ -322,7 +322,7 @@ class Lingotek {
322
  add_action( 'init', array( &$this, 'lingotek_new_ui' ), 10, 2 );
323
 
324
  //Action hook that triggers after the content gets saved in the elementor editor.
325
- add_action( 'elementor/editor/after_save', [$this, 'elementor_update_status' ] );
326
  }
327
 
328
  /**
@@ -798,14 +798,19 @@ class Lingotek {
798
  global $polylang;
799
 
800
  $language;
801
- if ( file_exists( PLL_ADMIN_INC . '/languages.php' ) ) {
802
- include PLL_ADMIN_INC . '/languages.php';
803
- $locale = get_locale();
804
-
 
 
 
 
805
  // attempts to set the default language from the current locale.
806
  foreach ( $languages as $lang ) {
807
  if ( get_locale() === $lang[1] ) {
808
  $language = $lang;
 
809
  }
810
  }
811
  }
@@ -867,6 +872,7 @@ class Lingotek {
867
 
868
  /**
869
  * Converts the class name to the appropriate file name for class loading.
 
870
  * @param string $class the class name.
871
  */
872
  public static function convert_class_to_file( $class ) {
@@ -929,13 +935,11 @@ class Lingotek {
929
  * @since 1.5.3
930
  */
931
  public function elementor_update_status( $post_id ) {
932
-
933
  if ( $post_id ) {
934
  global $polylang;
935
- $post_filters = new Lingotek_Filters_Post( $polylang );
936
  $post_filters->change_elementor_status( $post_id );
937
  }
938
-
939
  }
940
 
941
  /**
2
  /**
3
  Plugin name: Lingotek Translation
4
  Plugin URI: http://lingotek.com/wordpress#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wplingotektranslationplugin
5
+ Version: 1.5.7
6
  Author: Lingotek and Frédéric Demarle
7
  Author uri: http://lingotek.com
8
  Description: Lingotek offers convenient cloud-based localization and translation.
19
  }
20
 
21
  // Plugin version (should match above meta).
22
+ define( 'LINGOTEK_VERSION', '1.5.7' );
23
  define( 'LINGOTEK_MIN_PLL_VERSION', '1.8' );
24
  // Plugin name as known by WordPress.
25
  define( 'LINGOTEK_BASENAME', plugin_basename( __FILE__ ) );
322
  add_action( 'init', array( &$this, 'lingotek_new_ui' ), 10, 2 );
323
 
324
  //Action hook that triggers after the content gets saved in the elementor editor.
325
+ add_action( 'elementor/editor/after_save', array( $this, 'elementor_update_status' ) );
326
  }
327
 
328
  /**
798
  global $polylang;
799
 
800
  $language;
801
+ $languages;
802
+ // TODO: PLL_ADMIN_INC removed after polylang 2.8. Update to use only POLYLANG_DIR in next major release.
803
+ if ( defined( 'PLL_ADMIN_INC' ) && file_exists( PLL_ADMIN_INC . '/languages.php' ) ) {
804
+ $languages = include PLL_ADMIN_INC . '/languages.php';
805
+ } elseif ( defined( 'POLYLANG_DIR' ) && file_exists( POLYLANG_DIR . '/settings/languages.php' ) ) {
806
+ $languages = include POLYLANG_DIR . '/settings/languages.php';
807
+ }
808
+ if ( ! empty( $languages ) ) {
809
  // attempts to set the default language from the current locale.
810
  foreach ( $languages as $lang ) {
811
  if ( get_locale() === $lang[1] ) {
812
  $language = $lang;
813
+ break;
814
  }
815
  }
816
  }
872
 
873
  /**
874
  * Converts the class name to the appropriate file name for class loading.
875
+ *
876
  * @param string $class the class name.
877
  */
878
  public static function convert_class_to_file( $class ) {
935
  * @since 1.5.3
936
  */
937
  public function elementor_update_status( $post_id ) {
 
938
  if ( $post_id ) {
939
  global $polylang;
940
+ $post_filters = new Lingotek_Filters_Post( $polylang );
941
  $post_filters->change_elementor_status( $post_id );
942
  }
 
943
  }
944
 
945
  /**
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://lingotek.com/
4
  Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
5
  Requires at least: 3.8
6
  Tested up to: 5.8
7
- Stable tag: 1.5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -51,6 +51,7 @@ Lingotek works in conjuction with the [Polylang](https://wordpress.org/plugins/p
51
  * Categories, post tags, and some other metas are automatically copied when adding a new post or page translation.
52
  * A customizable language switcher is provided as a widget or in the nav menu.
53
  * The admin interface is of course multilingual too and each user can set the WordPress admin language in its profile.
 
54
  * We maintain the privacy of free automatic users by deleting all completed content from our TMS older than one month and active content older than two months. To ensure this does not affect your translated content, please download your translation soon after they are complete, or set your download settings to automatic. Enterprise customers should coordinate with client success about their community’s archive and deletion timeframes.
55
 
56
  = Credits =
@@ -123,6 +124,9 @@ For more, visit the [Lingotek documentation site](https://lingotek.atlassian.net
123
  5. The Lingotek Translation plugin provides the ability to Copy, Translate, and Ignore each specific custom field. Our plugin supports Wordpress custom fields and advanced custom fields.
124
 
125
  == Changelog ==
 
 
 
126
  = 1.5.6 (2022-05-19) =
127
  - WordPress Elementor: Widget Typography should not be translated
128
  - WordPress - completed translations cannot be downloaded, source and translation status is not updated
4
  Tags: automation, bilingual, international, language, Lingotek, localization, multilanguage, multilingual, translate, translation
5
  Requires at least: 3.8
6
  Tested up to: 5.8
7
+ Stable tag: 1.5.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
51
  * Categories, post tags, and some other metas are automatically copied when adding a new post or page translation.
52
  * A customizable language switcher is provided as a widget or in the nav menu.
53
  * The admin interface is of course multilingual too and each user can set the WordPress admin language in its profile.
54
+ * We now support localization of pages created with Elementor
55
  * We maintain the privacy of free automatic users by deleting all completed content from our TMS older than one month and active content older than two months. To ensure this does not affect your translated content, please download your translation soon after they are complete, or set your download settings to automatic. Enterprise customers should coordinate with client success about their community’s archive and deletion timeframes.
56
 
57
  = Credits =
124
  5. The Lingotek Translation plugin provides the ability to Copy, Translate, and Ignore each specific custom field. Our plugin supports Wordpress custom fields and advanced custom fields.
125
 
126
  == Changelog ==
127
+ = 1.5.7 (2022-06-06) =
128
+ - Fixed handling of undefined Polylang constants
129
+
130
  = 1.5.6 (2022-05-19) =
131
  - WordPress Elementor: Widget Typography should not be translated
132
  - WordPress - completed translations cannot be downloaded, source and translation status is not updated