Polylang - Version 1.1.6

Version Description

If you are using a version older than 0.8, please ugrade to 0.9.8 before ugrading to 1.0 or later

=

Download this release

Release Info

Developer Chouby
Plugin Icon 128x128 Polylang
Version 1.1.6
Comparing to
See all releases

Code changes from version 1.1.5 to 1.1.6

include/admin-base.php CHANGED
@@ -34,6 +34,7 @@ class Polylang_Admin_Base extends Polylang_Base {
34
  foreach($languages as $lang) {
35
  if ($locale == $lang->description) {
36
  $GLOBALS['wp_locale']->text_direction = get_metadata('term', $lang->term_id, '_rtl', true) ? 'rtl' : 'ltr';
 
37
  break;
38
  }
39
  }
34
  foreach($languages as $lang) {
35
  if ($locale == $lang->description) {
36
  $GLOBALS['wp_locale']->text_direction = get_metadata('term', $lang->term_id, '_rtl', true) ? 'rtl' : 'ltr';
37
+ $GLOBALS['l10n']['pll_string'] = $this->mo_import($lang);
38
  break;
39
  }
40
  }
include/admin-filters.php CHANGED
@@ -15,6 +15,7 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
15
 
16
  // adds a 'settings' link in the plugins table
17
  add_filter('plugin_action_links_'.basename(POLYLANG_DIR).'/polylang.php', array(&$this, 'plugin_action_links'));
 
18
 
19
  // ugrades languages files after a core upgrade (timing is important)
20
  // FIXME private action ? is there a better way to do this ?
@@ -533,6 +534,19 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
533
  foreach ($terms as $term) {
534
  if ($term_id = $this->get_term($term->term_id, $_POST['post_lang_choice']))
535
  $newterms[] = (int) $term_id; // cast is important otherwise we get 'numeric' tags
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  elseif (!is_wp_error($term_info = wp_insert_term($term->name, $tax))) // create the term in the correct language
537
  $newterms[] = (int) $term_info['term_id'];
538
  }
@@ -1152,6 +1166,12 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
1152
  return $links;
1153
  }
1154
 
 
 
 
 
 
 
1155
  // ugrades languages files after a core upgrade
1156
  function upgrade_languages($version) {
1157
  apply_filters('update_feedback', __('Upgrading language files…', 'polylang'));
15
 
16
  // adds a 'settings' link in the plugins table
17
  add_filter('plugin_action_links_'.basename(POLYLANG_DIR).'/polylang.php', array(&$this, 'plugin_action_links'));
18
+ add_action('in_plugin_update_message-'.basename(POLYLANG_DIR).'/polylang.php', array(&$this, 'plugin_update_message'), 10, 2);
19
 
20
  // ugrades languages files after a core upgrade (timing is important)
21
  // FIXME private action ? is there a better way to do this ?
534
  foreach ($terms as $term) {
535
  if ($term_id = $this->get_term($term->term_id, $_POST['post_lang_choice']))
536
  $newterms[] = (int) $term_id; // cast is important otherwise we get 'numeric' tags
537
+
538
+ // FIXME quick fix for Polylang 1.1.6
539
+ // handles tags with same names in several languages (but are not the translation of each other)
540
+ elseif ($term_id = $wpdb->get_var($wpdb->prepare("
541
+ SELECT t.term_id FROM $wpdb->terms AS t
542
+ INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id
543
+ INNER JOIN $wpdb->termmeta AS tm on t.term_id = tm.term_id
544
+ WHERE tt.taxonomy = %s AND t.name = %s
545
+ AND tm.meta_key = %s AND tm.meta_value = %s",
546
+ $tax, $term->name, '_language', $this->get_language($_POST['post_lang_choice'])->term_id
547
+ )))
548
+ $newterms[] = (int) $term_id;
549
+
550
  elseif (!is_wp_error($term_info = wp_insert_term($term->name, $tax))) // create the term in the correct language
551
  $newterms[] = (int) $term_info['term_id'];
552
  }
1166
  return $links;
1167
  }
1168
 
1169
+ // adds the upgrade notice in plugins table
1170
+ function plugin_update_message($plugin_data, $r) {
1171
+ if (isset($r->upgrade_notice))
1172
+ printf('<p style="margin: 3px 0 0 0; border-top: 1px solid #ddd; padding-top: 3px">%s</p>', $r->upgrade_notice);
1173
+ }
1174
+
1175
  // ugrades languages files after a core upgrade
1176
  function upgrade_languages($version) {
1177
  apply_filters('update_feedback', __('Upgrading language files&#8230;', 'polylang'));
include/auto-translate.php CHANGED
@@ -13,6 +13,9 @@ class Polylang_Auto_Translate {
13
  global $wpdb, $polylang;
14
  $qv = &$query->query_vars;
15
 
 
 
 
16
  $sign = create_function('$n', 'return $n > 0 ? 1 : ($n < 0 ? -1 : 0);');
17
 
18
  // /!\ always keep untranslated as is
@@ -94,7 +97,7 @@ class Polylang_Auto_Translate {
94
  // tax_query since WP 3.1
95
  if (!empty($qv['tax_query']) && is_array($qv['tax_query'])) {
96
  foreach ($qv['tax_query'] as $key => $q) {
97
- if (in_array($q['taxonomy'], $polylang->taxonomies)) {
98
  $arr = array();
99
  $field = isset($q['field']) && in_array($q['field'], array('slug', 'name')) ? $q['field'] : 'term_id';
100
  foreach ( (array) $q['terms'] as $t)
13
  global $wpdb, $polylang;
14
  $qv = &$query->query_vars;
15
 
16
+ if (!empty($qv['post_type']) && !(is_array($qv['post_type']) && array_intersect($qv['post_type'], $polylang->post_types) || in_array($qv['post_type'], $polylang->post_types)))
17
+ return;
18
+
19
  $sign = create_function('$n', 'return $n > 0 ? 1 : ($n < 0 ? -1 : 0);');
20
 
21
  // /!\ always keep untranslated as is
97
  // tax_query since WP 3.1
98
  if (!empty($qv['tax_query']) && is_array($qv['tax_query'])) {
99
  foreach ($qv['tax_query'] as $key => $q) {
100
+ if (isset($q['taxonomy']) && in_array($q['taxonomy'], $polylang->taxonomies)) {
101
  $arr = array();
102
  $field = isset($q['field']) && in_array($q['field'], array('slug', 'name')) ? $q['field'] : 'term_id';
103
  foreach ( (array) $q['terms'] as $t)
polylang.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://polylang.wordpress.com/
5
- Version: 1.1.5
6
  Author: Frédéric Demarle
7
  Description: Adds multilingual capability to WordPress
8
  Text Domain: polylang
@@ -29,7 +29,7 @@ Domain Path: /languages
29
  *
30
  */
31
 
32
- define('POLYLANG_VERSION', '1.1.5');
33
  define('PLL_MIN_WP_VERSION', '3.1');
34
 
35
  define('POLYLANG_DIR', dirname(__FILE__)); // our directory
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://polylang.wordpress.com/
5
+ Version: 1.1.6
6
  Author: Frédéric Demarle
7
  Description: Adds multilingual capability to WordPress
8
  Text Domain: polylang
29
  *
30
  */
31
 
32
+ define('POLYLANG_VERSION', '1.1.6');
33
  define('PLL_MIN_WP_VERSION', '3.1');
34
 
35
  define('POLYLANG_DIR', dirname(__FILE__)); // our directory
readme.txt CHANGED
@@ -1,16 +1,18 @@
1
  === Polylang ===
2
  Contributors: Chouby
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCWWYUUQV8F4E
4
- Tags: multilingual, bilingual, translate, translation, language, multilanguage, i18n, international, l10n, localization
5
  Requires at least: 3.1
6
  Tested up to: 3.6
7
- Stable tag: 1.1.5
8
  License: GPLv2 or later
9
 
10
  Polylang adds multilingual content management support to WordPress.
11
 
12
  == Description ==
13
 
 
 
14
  = Features =
15
 
16
  Polylang allows you to create a bilingual or multilingual WordPress site. You write posts, pages and create categories and post tags as usual, and then define the language for each of them. The translation is optional. The plugin does not integrate automatic or professional translation.
@@ -24,14 +26,12 @@ Polylang allows you to create a bilingual or multilingual WordPress site. You wr
24
 
25
  = Translators =
26
 
27
- The plugin admin interface is currently available in 29 languages: English, French, German contributed by [Christian Ries](http://www.singbyfoot.lu), Russian contributed by [yoyurec](http://yoyurec.in.ua) and unostar, Greek contributed by [theodotos](http://www.ubuntucy.org), Dutch contributed by [AlbertGn](http://wordpress.org/support/profile/albertgn), Hebrew contributed by [ArielK](http://www.arielk.net), Polish contributed by [Peter Paciorkiewicz](http://www.paciorkiewicz.pl), Latvian contributed by [@AndyDeGroo](http://twitter.com/AndyDeGroo), Italian contributed by [Luca Barbetti](http://wordpress.org/support/profile/lucabarbetti), Danish contributed by [Compute](http://wordpress.org/support/profile/compute), Spanish contributed by Curro, Portuguese contributed by [Vitor Carvalho](http://vcarvalho.com/), Lithuanian contributed by [Naglis Jonaitis](http://najo.lt/), Turkish contributed by [darchws](http://darch.ws/), Finnish contributed by [Jani Alha](http://www.wysiwyg.fi), Bulgarian contributed by [pavelsof](http://wordpress.org/support/profile/pavelsof), Belarusian contributed by [Alexander Markevitch](http://fourfeathers.by/), Afrikaans contributed by [Kobus Joubert](http://translate3d.com/), Hungarian contributed by Csaba Erdei, Norwegian contributed by [Tom Boersma](http://www.oransje.com/), Slovak contributed by [Branco (WebHostingGeeks.com)](http://webhostinggeeks.com/user-reviews/), Swedish contributed by [matsii](http://wordpress.org/support/profile/matsii), Catalan contributed by [Núria Martínez Berenguer](http://nuriamb.capa.webfactional.com), Ukrainian contributed by [cmd soft](http://www.cmd-soft.com/), Estonian contributed by [Ahto Naris](http://profiles.wordpress.org/ahtonaris/), Venetian contributed by Michele Brunelli, simplified Chinese contributed by [Changmeng Hu](http://www.wpdaxue.com), Indonesian contributed by [ajoull](http://www.ajoull.com/)
28
-
29
 
30
- Other [contributions](http://polylang.wordpress.com/documentation/contribute/) are welcome !
31
 
32
- = Feedback or ideas =
33
 
34
- Don't hesitate to [give your feedback](http://wordpress.org/support/plugin/polylang). It will help making the plugin better. Don't hesitate to rate the plugin too.
35
 
36
  == Installation ==
37
 
@@ -53,54 +53,38 @@ Don't hesitate to [give your feedback](http://wordpress.org/support/plugin/polyl
53
  * Search the [support forum](http://wordpress.org/support/plugin/polylang). I know that searching in the WordPress forum is not very convenient, but please give it a try. You can use generic search engines such as Google too as the WordPress forum SEO is very good. You will most probably find your answer here.
54
  * If you still have a problem, open a new thread in the [support forum](http://wordpress.org/support/plugin/polylang).
55
 
56
- == Screenshots ==
57
-
58
- 1. The Polylang languages admin panel in WordPress 3.3.1
59
-
60
- == Contribute ==
61
-
62
- If you wonder how you can help Polylang, here are some ideas. As you will read, there is no need to be a PHP developper!
63
-
64
- = Help other users of Polylang =
65
-
66
- The [support forum](http://wordpress.org/support/plugin/polylang) is here so that users of the plugin can get help when they need it. However, I will not always be available to answer questions. You don't need to be a developer to help out. Very often similar questions have been answered in the past.
67
-
68
- = Report bugs =
69
 
70
- Don't hesitate to report bugs on the [support forum](http://wordpress.org/support/plugin/polylang).
71
 
72
- = Test new versions =
73
-
74
- You can subscribe to the [blog](http://polylang.wordpress.com/) that I use to announce development versions and then, test the new versions and report bugs before the final release. It helps a lot!
75
-
76
- = Translate the admin interface =
77
-
78
- Polylang is already available in 25 languages. It's very easy to add a new one! Download [poedit](http://www.poedit.net/download.php) (available for Windows, Mac OS X and Linux). Rename the file polylang.pot found in the polylang/languages directory into something like polylang-your_locale.po. Open the file with poedit and start translating (keeping strange codes such as %s, %1$s as is). Once done, just save and you will get two files polylang-your_locale.po and polylang-your_locale.mo that you can send to the author. The translation will be included with the next release and will be covered by the same license as Polylang (GPLv2 or later).
79
-
80
- = Communicate =
81
-
82
- If you like Polylang, you can spread the word... Rating the plugin is very easy, you can write some words about the plugin, make a link to the plugin page...
83
-
84
- = What else ? =
85
 
86
- Every suggestions are welcome.
87
 
88
  == Upgrade Notice ==
89
 
90
- = 1.0 =
91
  If you are using a version older than 0.8, please ugrade to 0.9.8 before ugrading to 1.0 or later
92
 
93
  == Changelog ==
94
 
 
 
 
 
 
 
 
 
95
  = 1.1.5 (2013-09-15) =
96
 
97
  * Add compatibility with Aqua Resizer (often used in porfolio themes)
98
  * Add support of 'icl_get_default_language' function from the WPML API
99
  * Remove the 3 characters limitation for the language code
100
- * Change default names for zh_CN, zh_HK, zh_TW
101
  * Bug correction: urls are modified in search forms
102
 
103
- = 1.1.4 (2013-08-16) =
104
 
105
  * Add simplified Chinese language contributed by [Changmeng Hu](http://www.wpdaxue.com)
106
  * Add Indonesian language contributed by [ajoull](http://www.ajoull.com/)
1
  === Polylang ===
2
  Contributors: Chouby
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCWWYUUQV8F4E
4
+ Tags: multilingual, bilingual, translate, translation, language, multilanguage, international, localization
5
  Requires at least: 3.1
6
  Tested up to: 3.6
7
+ Stable tag: 1.1.6
8
  License: GPLv2 or later
9
 
10
  Polylang adds multilingual content management support to WordPress.
11
 
12
  == Description ==
13
 
14
+ [Polylang 1.2 beta is available for tests](http://polylang.wordpress.com/2013/10/01/polylang-1-2-beta-ready-for-tests/)
15
+
16
  = Features =
17
 
18
  Polylang allows you to create a bilingual or multilingual WordPress site. You write posts, pages and create categories and post tags as usual, and then define the language for each of them. The translation is optional. The plugin does not integrate automatic or professional translation.
26
 
27
  = Translators =
28
 
29
+ The plugin admin interface is currently available in 29 languages: English, French, German by [Christian Ries](http://www.singbyfoot.lu), Russian by [yoyurec](http://yoyurec.in.ua) and unostar, Greek by [theodotos](http://www.ubuntucy.org), Dutch by [AlbertGn](http://wordpress.org/support/profile/albertgn), Hebrew by [ArielK](http://www.arielk.net), Polish by [Peter Paciorkiewicz](http://www.paciorkiewicz.pl), Latvian by [@AndyDeGroo](http://twitter.com/AndyDeGroo), Italian by [Luca Barbetti](http://wordpress.org/support/profile/lucabarbetti), Danish by [Compute](http://wordpress.org/support/profile/compute), Spanish by Curro, Portuguese by [Vitor Carvalho](http://vcarvalho.com/), Lithuanian by [Naglis Jonaitis](http://najo.lt/), Turkish by [darchws](http://darch.ws/), Finnish by [Jani Alha](http://www.wysiwyg.fi), Bulgarian by [pavelsof](http://wordpress.org/support/profile/pavelsof), Belarusian by [Alexander Markevitch](http://fourfeathers.by/), Afrikaans by [Kobus Joubert](http://translate3d.com/), Hungarian by Csaba Erdei, Norwegian by [Tom Boersma](http://www.oransje.com/), Slovak by [Branco (WebHostingGeeks.com)](http://webhostinggeeks.com/user-reviews/), Swedish by [matsii](http://wordpress.org/support/profile/matsii), Catalan by [Núria Martínez Berenguer](http://nuriamb.capa.webfactional.com), Ukrainian by [cmd soft](http://www.cmd-soft.com/), Estonian by [Ahto Naris](http://profiles.wordpress.org/ahtonaris/), Venetian by Michele Brunelli, simplified Chinese by [Changmeng Hu](http://www.wpdaxue.com), Indonesian by [ajoull](http://www.ajoull.com/)
 
30
 
 
31
 
32
+ = Do you like Polylang? =
33
 
34
+ Don't hesitate to [give your feedback](http://wordpress.org/support/view/plugin-reviews/polylang#postform). It will help making the plugin better. Other [contributions](http://polylang.wordpress.com/documentation/contribute/) (such as new translations or helping other users on the support forum) are welcome !
35
 
36
  == Installation ==
37
 
53
  * Search the [support forum](http://wordpress.org/support/plugin/polylang). I know that searching in the WordPress forum is not very convenient, but please give it a try. You can use generic search engines such as Google too as the WordPress forum SEO is very good. You will most probably find your answer here.
54
  * If you still have a problem, open a new thread in the [support forum](http://wordpress.org/support/plugin/polylang).
55
 
56
+ = How to contribute? =
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
+ See http://polylang.wordpress.com/documentation/contribute/
59
 
60
+ == Screenshots ==
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
+ 1. The Polylang languages admin panel in WordPress 3.3.1
63
 
64
  == Upgrade Notice ==
65
 
66
+ = 1.1.6 =
67
  If you are using a version older than 0.8, please ugrade to 0.9.8 before ugrading to 1.0 or later
68
 
69
  == Changelog ==
70
 
71
+ = 1.1.6 (2013-10-13) =
72
+
73
+ * Add the possibility to display the upgrade notice on plugins page
74
+ * Bug correction: Illegal string offset 'taxonomy' in polylang/include/auto-translate.php
75
+ * Bug correction: user defined strings translations are not loaded on admin side
76
+ * Bug correction: untranslated post types are auto translated
77
+ * Bug correction: tags are not added to post when the name exists in several languages and they are not translations of each other
78
+
79
  = 1.1.5 (2013-09-15) =
80
 
81
  * Add compatibility with Aqua Resizer (often used in porfolio themes)
82
  * Add support of 'icl_get_default_language' function from the WPML API
83
  * Remove the 3 characters limitation for the language code
84
+ * Change default names for zh_CN, zh_HK, zh_TW
85
  * Bug correction: urls are modified in search forms
86
 
87
+ = 1.1.4 (2013-08-16) =
88
 
89
  * Add simplified Chinese language contributed by [Changmeng Hu](http://www.wpdaxue.com)
90
  * Add Indonesian language contributed by [ajoull](http://www.ajoull.com/)