Polylang - Version 0.9.4

Version Description

(2012-10-23) =

  • Add Afrikaans translation contributed by Kobus Joubert
  • Add Belarusian translation contributed by Alexander Markevitch
  • Add Afrikaans (af) and Belarusian (be_BY) to predefined languages list (automatic download and update of language files won't work)
  • Add the possibility to translate the date format and time format
  • Add compatibility with the 'icl_get_home_url' function from the WPML API
  • Bug correction: still some issues with string translations
  • Bug correction: search is not filtered by the (default) language when the language is set by content and the language code is hidden for the default language
  • Bug correction: posts & pages preview urls are broken when adding the language code to all urls
  • Bug correction: automatically added new top-level pages to menus are not filtered by language
  • Bug correction: the admin language filter messes the categories languages when editing a post and the parent dropdown list when editing a category
  • Bug correction: search form does not work when using a static front page (introduced in 0.9.2)
  • Bug correction: can't set languages for categories and post tags on blogs created after polylang has been activated at network level
  • Bug correction: menus don't work with catch box theme ('has_nav_menu' not correctly filtered)
Download this release

Release Info

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

Code changes from version 0.9.3 to 0.9.4

doc/documentation-en.odt CHANGED
Binary file
doc/documentation-en.pdf CHANGED
Binary file
flags/af.png ADDED
Binary file
flags/be_BY.png ADDED
Binary file
include/admin-filters.php CHANGED
@@ -6,7 +6,7 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
6
  parent::__construct();
7
 
8
  // additionnal filters and actions
9
- add_action('admin_init', array(&$this, 'admin_init'));
10
 
11
  // remove the customize menu section as it is unusable with Polylang
12
  add_action('customize_register', array(&$this, 'customize_register'), 20); // since WP 3.4
@@ -29,8 +29,8 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
29
 
30
  // add the language and translations columns in 'All Posts', 'All Pages' and 'Media library' panels
31
  foreach (PLL_MEDIA_SUPPORT ? array('posts', 'pages', 'media') : array('posts', 'pages') as $type) {
32
- add_filter('manage_'.$type.'_columns', array(&$this, 'add_post_column'), 10, 2);
33
- add_action('manage_'.$type.'_custom_column', array(&$this, 'post_column'), 10, 2);
34
  }
35
 
36
  // quick edit and bulk edit
@@ -79,14 +79,14 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
79
 
80
  foreach ($this->taxonomies as $tax) {
81
  // adds the language field in the 'Categories' and 'Post Tags' panels
82
- add_action($tax.'_add_form_fields', array(&$this, 'add_term_form'));
83
 
84
  // adds the language field and translations tables in the 'Edit Category' and 'Edit Tag' panels
85
- add_action($tax.'_edit_form_fields', array(&$this, 'edit_term_form'));
86
 
87
  // adds the language column in the 'Categories' and 'Post Tags' tables
88
  add_filter('manage_edit-'.$tax.'_columns', array(&$this, 'add_term_column'));
89
- add_action('manage_'.$tax.'_custom_column', array(&$this, 'term_column'), 10, 3);
90
 
91
  // adds action related to languages when deleting categories and post tags
92
  add_action('delete_'.$tax, array(&$this, 'delete_term'));
@@ -100,6 +100,9 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
100
  // ajax response for edit term form
101
  add_action('wp_ajax_term_lang_choice', array(&$this,'term_lang_choice'));
102
 
 
 
 
103
  // modifies the theme location nav menu metabox
104
  add_filter('admin_head-nav-menus.php', array(&$this, 'nav_menu_theme_locations'));
105
 
@@ -159,12 +162,12 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
159
  $post_type = isset($GLOBALS['post_type']) ? $GLOBALS['post_type'] : $_POST['post_type']; // 2nd case for quick edit
160
  $language = $this->get_language(substr($column, 9));
161
 
162
- // hidden field containing the post language for quick edit
163
  if ($column == $this->get_first_language_column())
164
  printf('<input type="hidden" name="lang_%d" value="%s" />', $post_id, $lang->slug);
165
 
166
  // link to edit post (or a translation)
167
- if ($id = $this->get_post($post_id, $language))
168
  printf('<a class="%1$s" title="%2$s" href="%3$s"></a>',
169
  $id == $post_id ? 'pll_icon_tick' : 'pll_icon_edit',
170
  esc_attr(get_post($id)->post_title),
@@ -200,23 +203,23 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
200
 
201
  // filters posts, pages and media by language
202
  function parse_query($query) {
203
- $qvars = &$query->query_vars;
204
 
205
  // do not filter post types such as nav_menu_item
206
  if (isset($qvars['post_type']) && !in_array($qvars['post_type'], $this->post_types)) {
207
  if (isset($qvars['lang']))
208
- unset ($qvars['lang']);
209
  return $query;
210
  }
211
 
212
  // filters the list of media by language when uploading from post
213
- if ($GLOBALS['pagenow'] == 'media-upload.php' && isset($_GET['post_id']) && $lang = $this->get_post_language($_GET['post_id']))
214
  $query->set('lang', $lang->slug);
215
 
216
  if (!isset($qvars['lang']) && $lg = get_user_meta(get_current_user_id(), 'pll_filter_content', true))
217
  $qvars['lang'] = $lg;
218
 
219
- if (isset($qvars['lang']) && $qvars['lang'] == 'all')
220
  unset ($qvars['lang']);
221
 
222
  return $query;
@@ -243,7 +246,7 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
243
  $post_type = get_post_type($post_ID);
244
 
245
  $lang = ($lg = $this->get_post_language($post_ID)) ? $lg :
246
- (isset($_GET['new_lang']) ? $this->get_language($_GET['new_lang']) :
247
  $this->get_default_language());
248
 
249
  // NOTE: the class "tags-input" allows to include the field in the autosave $_POST (see autosave.js)
@@ -543,7 +546,11 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
543
  $fields['language'] = array(
544
  'label' => __('Language', 'polylang'),
545
  'input' => 'html',
546
- 'html' => $this->dropdown_languages(array('name' => "attachments[$post_id][language]", 'class' => "media_lang_choice", 'selected' => $lang ? $lang->slug : ''))
 
 
 
 
547
  );
548
 
549
  // don't show translations except on edit media panel
@@ -593,8 +600,9 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
593
  $post = get_post($_GET['from_media']);
594
  $post_id = $post->ID;
595
 
596
- $post->ID = null; // to create a new attachment
597
- $post->post_parent = ($post->post_parent && $tr_parent = $this->get_translation('post', $post->post_parent, $_GET['new_lang'])) ? $tr_parent : 0; // translates attachment parent if exists
 
598
  $tr_id = wp_insert_attachment($post);
599
  add_post_meta($tr_id, '_wp_attachment_metadata', get_post_meta($post_id, '_wp_attachment_metadata', true));
600
  add_post_meta($tr_id, '_wp_attached_file', get_post_meta($post_id, '_wp_attached_file', true));
@@ -631,7 +639,10 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
631
  function wp_delete_file($file) {
632
  global $wpdb;
633
  $uploadpath = wp_upload_dir();
634
- $ids = $wpdb->get_col($wpdb->prepare("SELECT `post_id` FROM $wpdb->postmeta WHERE `meta_key` = '_wp_attached_file' AND `meta_value` = '%s'", ltrim($file, $uploadpath['basedir'])));
 
 
 
635
 
636
  if (!empty($ids)) {
637
  // regenerate intermediate sizes if it's an image (since we could not prevent WP deleting them before)
@@ -677,14 +688,18 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
677
  elseif (isset($_GET['new_lang']) && $_GET['new_lang'])
678
  $lang = $this->get_language($_GET['new_lang']);
679
 
680
- elseif (isset($_GET['lang']) && $_GET['lang']) {
 
 
681
  if ($_GET['lang'] != 'all')
682
  $lang = $this->get_language($_GET['lang']);
683
  elseif ($screen->base == 'edit-tags' && isset($args['class']))
684
  $lang = $this->get_default_language(); // parent dropdown
685
  }
686
 
687
- elseif ($lg = get_user_meta(get_current_user_id(), 'pll_filter_content', true))
 
 
688
  $lang = $this->get_language($lg);
689
 
690
  elseif (isset($_GET['post']))
@@ -744,7 +759,7 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
744
 
745
  // adds the language column (before the posts column) in the 'Categories' or 'Post Tags' table
746
  function add_term_column($columns) {
747
- return $this->add_column($columns, 'posts');
748
  }
749
 
750
  // fills the language column in the 'Categories' or 'Post Tags' table
@@ -796,7 +811,7 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
796
  // don't use term_lang_choice for quick edit to avoid conflict with the "add term" form
797
  if ($this->get_term_language($term_id)->slug != $_POST['inline_lang_choice'])
798
  $this->delete_translation('term', $term_id);
799
- $this->set_term_language($term_id, $_POST['inline_lang_choice']);
800
  }
801
  elseif (isset($_POST['post_lang_choice']))
802
  $this->set_term_language($term_id, $_POST['post_lang_choice']);
@@ -922,6 +937,24 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
922
  $x->send();
923
  }
924
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  // modifies the theme location nav menu metabox
926
  // thanks to: http://wordpress.stackexchange.com/questions/2770/how-to-add-a-custom-metabox-to-the-menu-management-admin-screen
927
  function nav_menu_theme_locations() {
@@ -953,10 +986,10 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
953
  esc_attr( $widget->id.'_lang_choice'),
954
  __('The widget is displayed for:', 'polylang'),
955
  $this->dropdown_languages(array(
956
- 'name' => $widget->id.'_lang_choice',
957
- 'class' => 'tags-input',
958
  'add_options' => array(array('value' => 0, 'text' => __('All languages', 'polylang'))),
959
- 'selected' => isset($widget_lang[$widget->id]) ? $widget_lang[$widget->id] : ''
960
  ))
961
  );
962
  }
@@ -981,9 +1014,9 @@ class Polylang_Admin_Filters extends Polylang_Admin_Base {
981
  printf("<tr><th><label for='user_lang'>%s</label></th><td>%s</td></tr>",
982
  __('Admin language', 'polylang'),
983
  $this->dropdown_languages(array(
984
- 'name' => 'user_lang',
985
- 'value' => 'description',
986
- 'selected' => get_user_meta($profileuser->ID, 'user_lang', true),
987
  'add_options' => array(array('value' => 0, 'text' => __('Wordpress default', 'polylang')))
988
  ))
989
  );
6
  parent::__construct();
7
 
8
  // additionnal filters and actions
9
+ add_action('admin_init', array(&$this, 'admin_init'));
10
 
11
  // remove the customize menu section as it is unusable with Polylang
12
  add_action('customize_register', array(&$this, 'customize_register'), 20); // since WP 3.4
29
 
30
  // add the language and translations columns in 'All Posts', 'All Pages' and 'Media library' panels
31
  foreach (PLL_MEDIA_SUPPORT ? array('posts', 'pages', 'media') : array('posts', 'pages') as $type) {
32
+ add_filter('manage_'.$type.'_columns', array(&$this, 'add_post_column'), 10, 2);
33
+ add_action('manage_'.$type.'_custom_column', array(&$this, 'post_column'), 10, 2);
34
  }
35
 
36
  // quick edit and bulk edit
79
 
80
  foreach ($this->taxonomies as $tax) {
81
  // adds the language field in the 'Categories' and 'Post Tags' panels
82
+ add_action($tax.'_add_form_fields', array(&$this, 'add_term_form'));
83
 
84
  // adds the language field and translations tables in the 'Edit Category' and 'Edit Tag' panels
85
+ add_action($tax.'_edit_form_fields', array(&$this, 'edit_term_form'));
86
 
87
  // adds the language column in the 'Categories' and 'Post Tags' tables
88
  add_filter('manage_edit-'.$tax.'_columns', array(&$this, 'add_term_column'));
89
+ add_action('manage_'.$tax.'_custom_column', array(&$this, 'term_column'), 10, 3);
90
 
91
  // adds action related to languages when deleting categories and post tags
92
  add_action('delete_'.$tax, array(&$this, 'delete_term'));
100
  // ajax response for edit term form
101
  add_action('wp_ajax_term_lang_choice', array(&$this,'term_lang_choice'));
102
 
103
+ // filter _wp_auto_add_pages_to_menu by language
104
+ add_action('transition_post_status', array(&$this, 'auto_add_pages_to_menu'), 5, 3); // before _wp_auto_add_pages_to_menu
105
+
106
  // modifies the theme location nav menu metabox
107
  add_filter('admin_head-nav-menus.php', array(&$this, 'nav_menu_theme_locations'));
108
 
162
  $post_type = isset($GLOBALS['post_type']) ? $GLOBALS['post_type'] : $_POST['post_type']; // 2nd case for quick edit
163
  $language = $this->get_language(substr($column, 9));
164
 
165
+ // hidden field containing the post language for quick edit
166
  if ($column == $this->get_first_language_column())
167
  printf('<input type="hidden" name="lang_%d" value="%s" />', $post_id, $lang->slug);
168
 
169
  // link to edit post (or a translation)
170
+ if ($id = $this->get_post($post_id, $language))
171
  printf('<a class="%1$s" title="%2$s" href="%3$s"></a>',
172
  $id == $post_id ? 'pll_icon_tick' : 'pll_icon_edit',
173
  esc_attr(get_post($id)->post_title),
203
 
204
  // filters posts, pages and media by language
205
  function parse_query($query) {
206
+ $qvars = &$query->query_vars;
207
 
208
  // do not filter post types such as nav_menu_item
209
  if (isset($qvars['post_type']) && !in_array($qvars['post_type'], $this->post_types)) {
210
  if (isset($qvars['lang']))
211
+ unset ($qvars['lang']);
212
  return $query;
213
  }
214
 
215
  // filters the list of media by language when uploading from post
216
+ if ($GLOBALS['pagenow'] == 'media-upload.php' && isset($_GET['post_id']) && $lang = $this->get_post_language($_GET['post_id']))
217
  $query->set('lang', $lang->slug);
218
 
219
  if (!isset($qvars['lang']) && $lg = get_user_meta(get_current_user_id(), 'pll_filter_content', true))
220
  $qvars['lang'] = $lg;
221
 
222
+ if (isset($qvars['lang']) && $qvars['lang'] == 'all')
223
  unset ($qvars['lang']);
224
 
225
  return $query;
246
  $post_type = get_post_type($post_ID);
247
 
248
  $lang = ($lg = $this->get_post_language($post_ID)) ? $lg :
249
+ (isset($_GET['new_lang']) ? $this->get_language($_GET['new_lang']) :
250
  $this->get_default_language());
251
 
252
  // NOTE: the class "tags-input" allows to include the field in the autosave $_POST (see autosave.js)
546
  $fields['language'] = array(
547
  'label' => __('Language', 'polylang'),
548
  'input' => 'html',
549
+ 'html' => $this->dropdown_languages(array(
550
+ 'name' => "attachments[$post_id][language]",
551
+ 'class' => "media_lang_choice",
552
+ 'selected' => $lang ? $lang->slug : ''
553
+ ))
554
  );
555
 
556
  // don't show translations except on edit media panel
600
  $post = get_post($_GET['from_media']);
601
  $post_id = $post->ID;
602
 
603
+ // create a new attachment (translate attachment parent if exists)
604
+ $post->ID = null; // will force the creation
605
+ $post->post_parent = ($post->post_parent && $tr_parent = $this->get_translation('post', $post->post_parent, $_GET['new_lang'])) ? $tr_parent : 0;
606
  $tr_id = wp_insert_attachment($post);
607
  add_post_meta($tr_id, '_wp_attachment_metadata', get_post_meta($post_id, '_wp_attachment_metadata', true));
608
  add_post_meta($tr_id, '_wp_attached_file', get_post_meta($post_id, '_wp_attached_file', true));
639
  function wp_delete_file($file) {
640
  global $wpdb;
641
  $uploadpath = wp_upload_dir();
642
+ $ids = $wpdb->get_col($wpdb->prepare(
643
+ "SELECT `post_id` FROM $wpdb->postmeta WHERE `meta_key` = '_wp_attached_file' AND `meta_value` = '%s'",
644
+ ltrim($file, $uploadpath['basedir'])
645
+ ));
646
 
647
  if (!empty($ids)) {
648
  // regenerate intermediate sizes if it's an image (since we could not prevent WP deleting them before)
688
  elseif (isset($_GET['new_lang']) && $_GET['new_lang'])
689
  $lang = $this->get_language($_GET['new_lang']);
690
 
691
+ // the language filter selection has just changed
692
+ // test $screen->base to avoid interference between the language filter and the post language selection and the category parent dropdown list
693
+ elseif (isset($_GET['lang']) && $_GET['lang'] && !in_array($screen->base, array('post', 'edit-tags'))) {
694
  if ($_GET['lang'] != 'all')
695
  $lang = $this->get_language($_GET['lang']);
696
  elseif ($screen->base == 'edit-tags' && isset($args['class']))
697
  $lang = $this->get_default_language(); // parent dropdown
698
  }
699
 
700
+ // again the language filter
701
+ elseif (($lg = get_user_meta(get_current_user_id(), 'pll_filter_content', true)) &&
702
+ $screen->base != 'post' && !($screen->base == 'edit-tags' && isset($args['class']))) // don't apply to post edit and the category parent dropdown list
703
  $lang = $this->get_language($lg);
704
 
705
  elseif (isset($_GET['post']))
759
 
760
  // adds the language column (before the posts column) in the 'Categories' or 'Post Tags' table
761
  function add_term_column($columns) {
762
+ return $this->add_column($columns, 'posts');
763
  }
764
 
765
  // fills the language column in the 'Categories' or 'Post Tags' table
811
  // don't use term_lang_choice for quick edit to avoid conflict with the "add term" form
812
  if ($this->get_term_language($term_id)->slug != $_POST['inline_lang_choice'])
813
  $this->delete_translation('term', $term_id);
814
+ $this->set_term_language($term_id, $_POST['inline_lang_choice']);
815
  }
816
  elseif (isset($_POST['post_lang_choice']))
817
  $this->set_term_language($term_id, $_POST['post_lang_choice']);
937
  $x->send();
938
  }
939
 
940
+ // filter _wp_auto_add_pages_to_menu by language
941
+ function auto_add_pages_to_menu( $new_status, $old_status, $post ) {
942
+ if ('publish' != $new_status || 'publish' == $old_status || 'page' != $post->post_type || ! empty($post->post_parent))
943
+ return;
944
+
945
+ // get all the menus in the post language
946
+ $menus = array();
947
+ $lang = $this->get_post_language($post->ID);
948
+ $menu_lang = get_option('polylang_nav_menus');
949
+ foreach ($menu_lang as $menu) {
950
+ if (isset($menu[$lang->slug]))
951
+ $menus[] = $menu[$lang->slug];
952
+ }
953
+ $menus = implode(',', $menus);
954
+
955
+ add_filter('option_nav_menu_options', create_function('$a', "\$a['auto_add'] = array_intersect(\$a['auto_add'], array($menus)); return \$a;"));
956
+ }
957
+
958
  // modifies the theme location nav menu metabox
959
  // thanks to: http://wordpress.stackexchange.com/questions/2770/how-to-add-a-custom-metabox-to-the-menu-management-admin-screen
960
  function nav_menu_theme_locations() {
986
  esc_attr( $widget->id.'_lang_choice'),
987
  __('The widget is displayed for:', 'polylang'),
988
  $this->dropdown_languages(array(
989
+ 'name' => $widget->id.'_lang_choice',
990
+ 'class' => 'tags-input',
991
  'add_options' => array(array('value' => 0, 'text' => __('All languages', 'polylang'))),
992
+ 'selected' => isset($widget_lang[$widget->id]) ? $widget_lang[$widget->id] : ''
993
  ))
994
  );
995
  }
1014
  printf("<tr><th><label for='user_lang'>%s</label></th><td>%s</td></tr>",
1015
  __('Admin language', 'polylang'),
1016
  $this->dropdown_languages(array(
1017
+ 'name' => 'user_lang',
1018
+ 'value' => 'description',
1019
+ 'selected' => get_user_meta($profileuser->ID, 'user_lang', true),
1020
  'add_options' => array(array('value' => 0, 'text' => __('Wordpress default', 'polylang')))
1021
  ))
1022
  );
include/admin.php CHANGED
@@ -57,7 +57,7 @@ class Polylang_Admin extends Polylang_Admin_Base {
57
  $menu_lang = get_option('polylang_nav_menus');
58
 
59
  // for widgets
60
- $widget_lang = get_option('polylang_widgets');
61
 
62
  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
63
 
@@ -109,8 +109,10 @@ class Polylang_Admin extends Polylang_Admin_Base {
109
  }
110
 
111
  // delete menus locations
112
- foreach ($locations as $location => $description)
113
- unset($menu_lang[$location][$lang_slug]);
 
 
114
  update_option('polylang_nav_menus', $menu_lang);
115
 
116
  // delete language option in widgets
@@ -267,9 +269,8 @@ class Polylang_Admin extends Polylang_Admin_Base {
267
  flush_rewrite_rules();
268
 
269
  // fills existing posts & terms with default language
270
- if (isset($_POST['fill_languages'])) {
271
  global $wpdb;
272
- $nolang = $this->get_objects_with_no_lang();
273
  $lang = $this->get_language($options['default_lang']);
274
 
275
  $values = array();
@@ -415,6 +416,8 @@ class Polylang_Admin extends Polylang_Admin_Base {
415
  // WP strings
416
  $this->register_string(__('Site Title'), get_option('blogname'));
417
  $this->register_string(__('Tagline'), get_option('blogdescription'));
 
 
418
 
419
  // widgets titles
420
  $sidebars = wp_get_sidebars_widgets();
57
  $menu_lang = get_option('polylang_nav_menus');
58
 
59
  // for widgets
60
+ $widget_lang = get_option('polylang_widgets', array()); // returns empty array if not set yet
61
 
62
  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
63
 
109
  }
110
 
111
  // delete menus locations
112
+ foreach ($locations as $location => $description) {
113
+ if (isset($menu_lang[$location][$lang_slug]))
114
+ unset($menu_lang[$location][$lang_slug]);
115
+ }
116
  update_option('polylang_nav_menus', $menu_lang);
117
 
118
  // delete language option in widgets
269
  flush_rewrite_rules();
270
 
271
  // fills existing posts & terms with default language
272
+ if (isset($_POST['fill_languages']) && $nolang = $this->get_objects_with_no_lang()) {
273
  global $wpdb;
 
274
  $lang = $this->get_language($options['default_lang']);
275
 
276
  $values = array();
416
  // WP strings
417
  $this->register_string(__('Site Title'), get_option('blogname'));
418
  $this->register_string(__('Tagline'), get_option('blogdescription'));
419
+ $this->register_string(__('Date Format'), get_option('date_format'));
420
+ $this->register_string(__('Time Format'), get_option('time_format'));
421
 
422
  // widgets titles
423
  $sidebars = wp_get_sidebars_widgets();
include/api.php CHANGED
@@ -49,14 +49,23 @@ function pll_e($string) {
49
  _e($string, 'pll_string');
50
  }
51
 
52
- // compatibility with WPML string translation API
53
- if (!function_exists('icl_register_string') && !function_exists('icl_t')) {
 
 
 
 
 
 
54
  function icl_register_string($context, $name, $string) {
55
  pll_register_string($name, $string);
56
  }
 
57
 
 
58
  function icl_t($context, $name, $string) {
59
  return pll__($string);
60
  }
61
  }
 
62
  ?>
49
  _e($string, 'pll_string');
50
  }
51
 
52
+ // compatibility with WPML API
53
+ if (!function_exists('icl_get_home_url')) {
54
+ function icl_get_home_url() {
55
+ return pll_home_url();
56
+ }
57
+ }
58
+
59
+ if (!function_exists('icl_register_string')) {
60
  function icl_register_string($context, $name, $string) {
61
  pll_register_string($name, $string);
62
  }
63
+ }
64
 
65
+ if (!function_exists('icl_t')) {
66
  function icl_t($context, $name, $string) {
67
  return pll__($string);
68
  }
69
  }
70
+
71
  ?>
include/base.php CHANGED
@@ -201,8 +201,14 @@ abstract class Polylang_Base {
201
  if (isset($this->links[$link]))
202
  return $this->links[$link];
203
 
204
- return $this->links[$link] = ('post_type_link' == current_filter() && !in_array($post->post_type, $this->post_types)) ?
205
- $link : $this->add_language_to_link($link, $this->get_post_language('_get_page_link' == current_filter() ? $post : $post->ID));
 
 
 
 
 
 
206
  }
207
 
208
  // modifies term link
201
  if (isset($this->links[$link]))
202
  return $this->links[$link];
203
 
204
+ if ('post_type_link' == current_filter() && !in_array($post->post_type, $this->post_types))
205
+ return $this->links[$link] = $link;
206
+
207
+ if ('_get_page_link' == current_filter()) // this filter uses the ID instead of the post object
208
+ $post = get_post($post);
209
+
210
+ // /!\ when post_status in not "publish", WP does not use pretty permalinks
211
+ return $this->links[$link] = $post->post_status != 'publish' ? $link : $this->add_language_to_link($link, $this->get_post_language($post->ID));
212
  }
213
 
214
  // modifies term link
include/core.php CHANGED
@@ -113,9 +113,8 @@ class Polylang_Core extends Polylang_base {
113
  add_filter('widget_display_callback', array(&$this, 'widget_display_callback'), 10, 3);
114
 
115
  // strings translation (must be applied before WordPress applies its default formatting filters)
116
- add_filter('widget_title', 'pll__', 1);
117
- add_filter('option_blogname', 'pll__', 1);
118
- add_filter('option_blogdescription', 'pll__', 1);
119
 
120
  // translates biography
121
  add_filter('get_user_metadata', array(&$this,'get_user_metadata'), 10, 4);
@@ -301,8 +300,6 @@ class Polylang_Core extends Polylang_base {
301
  // as done by xili_language: load text domains and reinitialize wp_locale with the action 'wp'
302
  // as done by qtranslate: define the locale with the action 'plugins_loaded', but in this case, the language must be specified in the url.
303
  function load_textdomains() {
304
- global $wp_rewrite, $l10n;
305
-
306
  // our override_load_textdomain filter has done its job. let's remove it before calling load_textdomain
307
  remove_filter('override_load_textdomain', array(&$this, 'mofile'));
308
  remove_filter('gettext', array(&$this, 'gettext'), 10, 3);
@@ -318,27 +315,28 @@ class Polylang_Core extends Polylang_base {
318
  // set all our language filters and actions
319
  $this->add_language_filters();
320
 
321
- if (!($this->options['force_lang'] && $wp_rewrite->using_permalinks() && PLL_LANG_EARLY) && $this->curlang->description != 'en_US') {
322
- // now we can load text domains with the right language
323
- $new_locale = get_locale();
324
- foreach ($this->list_textdomains as $textdomain)
325
- load_textdomain( $textdomain['domain'], str_replace($this->default_locale, $new_locale, $textdomain['mo']));
326
-
327
- // reinitializes wp_locale for weekdays and months, as well as for text direction
328
- unset($GLOBALS['wp_locale']);
329
- $GLOBALS['wp_locale'] = new WP_Locale();
330
- $GLOBALS['wp_locale']->text_direction = get_metadata('term', $this->curlang->term_id, '_rtl', true) ? 'rtl' : 'ltr';
331
-
332
- // translate labels of post types and taxonomies
333
- foreach ($GLOBALS['wp_taxonomies'] as $tax)
334
- $this->translate_labels($tax);
335
- foreach ($GLOBALS['wp_post_types'] as $pt)
336
- $this->translate_labels($pt);
 
 
337
 
338
  // and finally load user defined strings
339
- $l10n['pll_string'] = $this->mo_import($this->curlang);
340
  }
341
-
342
  }
343
 
344
  else {
@@ -384,18 +382,18 @@ class Polylang_Core extends Polylang_base {
384
  if (!$this->get_languages_list() || !did_action('wp_loaded') || $query->get('suppress_filters'))
385
  return $query;
386
 
387
- $qvars = $query->query_vars;
388
 
389
  // users may want to display content in a different language than the current one by setting it explicitely in the query
390
- if (!$this->first_query && $this->curlang && isset($qvars['lang']) && $qvars['lang'])
391
  return $query;
392
 
393
  $this->first_query = false;
394
 
395
  // detect our exclude pages query and returns to avoid conflicts
396
  // this test should be sufficient
397
- if (isset($qvars['tax_query'][0]['taxonomy']) && $qvars['tax_query'][0]['taxonomy'] == 'language' &&
398
- isset($qvars['tax_query'][0]['operator']) && $qvars['tax_query'][0]['operator'] == 'NOT IN')
399
  return $query;
400
 
401
  // special case for wp-signup.php & wp-activate.php
@@ -406,13 +404,13 @@ class Polylang_Core extends Polylang_base {
406
 
407
  // homepage is requested, let's set the language
408
  // take care to avoid posts page for which is_home = 1
409
- if (!$this->curlang && empty($query->query) && (is_home() || (is_page() && $qvars['page_id'] == $this->page_on_front)))
410
  $this->home_requested($query);
411
 
412
  // redirect the language page to the homepage
413
  if ($this->options['redirect_lang'] && is_tax('language') && $this->page_on_front && (count($query->query) == 1 || (is_paged() && count($query->query) == 2))) {
414
- $qvars['page_id'] = $this->get_post($this->page_on_front, $this->get_language(get_query_var('lang')));
415
- $query->parse_query($qvars);
416
  return $query;
417
  }
418
 
@@ -428,10 +426,10 @@ class Polylang_Core extends Polylang_base {
428
  if ($this->page_for_posts) {
429
  // If permalinks are used, WordPress does set and use $query->queried_object_id and sets $query->query_vars['page_id'] to 0
430
  // and does set and use $query->query_vars['page_id'] if permalinks are not used :(
431
- if (isset($qvars['pagename']) && $qvars['pagename'] && isset($query->queried_object_id))
432
  $page_id = $query->queried_object_id;
433
- elseif (isset($qvars['page_id']))
434
- $page_id = $qvars['page_id'];
435
 
436
  if (isset($page_id) && $page_id && $this->get_post($page_id, $this->get_post_language($this->page_for_posts)) == $this->page_for_posts) {
437
  $this->page_for_posts = $page_id;
@@ -444,49 +442,51 @@ class Polylang_Core extends Polylang_base {
444
  }
445
  }
446
 
447
- $is_post_type = isset($qvars['post_type']) && (in_array($qvars['post_type'], $this->post_types) ||
448
- (is_array($qvars['post_type']) && array_intersect($qvars['post_type'], $this->post_types)) );
449
 
450
  // FIXME to generalize as I probably forget things
451
- $is_archive = (count($query->query) == 1 && isset($qvars['paged']) && $qvars['paged']) ||
452
- (isset($qvars['m']) && $qvars['m']) ||
453
- (isset($qvars['author']) && $qvars['author']) ||
454
- (isset($qvars['post_type']) && is_post_type_archive() && $is_post_type);
455
 
456
  // sets 404 when the language is not set for archives needing the language in the url
457
- if (!$this->options['hide_default'] && !isset($qvars['lang']) && !$GLOBALS['wp_rewrite']->using_permalinks() && $is_archive)
458
  $query->set_404();
459
 
460
  // sets the language in case we hide the default language
461
- if ($this->options['hide_default'] && !isset($qvars['lang']) && ($is_archive || (count($query->query) == 1 && isset($qvars['feed']) && $qvars['feed']) ))
462
  $query->set('lang', $this->options['default_lang']);
463
 
464
  // allow filtering recent posts and secondary queries by the current language
465
  // take care not to break queries for non visible post types such as nav_menu_items, attachments...
466
- if (/*$query->is_home && */$this->curlang && (!isset($qvars['post_type']) || $is_post_type ))
467
  $query->set('lang', $this->curlang->slug);
468
 
469
  // remove pages query when the language is set unless we do a search
470
  // FIXME is only search broken by this ?
471
- if (isset($qvars['lang']) && $qvars['lang'] && !isset($qvars['post_type']) && !is_search())
472
  $query->set('post_type', 'post');
473
 
474
  // unset the is_archive flag for language pages to prevent loading the archive template
475
  // keep archive flag for comment feed otherwise the language filter does not work
476
- if (isset($qvars['lang']) && $qvars['lang'] && !is_comment_feed() &&
477
  !is_post_type_archive() && !is_date() && !is_author() && !is_category() && !is_tag() && !is_tax('post_format'))
478
  $query->is_archive = false;
479
 
480
  // unset the is_tax flag for authors pages and post types archives
481
  // FIXME Probably I should do this for other cases
482
- if (isset($qvars['lang']) && $qvars['lang'] && (is_author() || is_post_type_archive() || is_date())) {
483
  $query->is_tax = false;
484
  unset($query->queried_object);
485
  }
486
 
487
  // sets a language for theme preview
488
- if ($qvars['preview'])
 
489
  $query->set('lang', $this->curlang->slug);
 
490
 
491
  // to avoid conflict beetwen taxonomies
492
  if (isset($query->tax_query->queries))
@@ -531,8 +531,7 @@ class Polylang_Core extends Polylang_base {
531
 
532
  // modifies the page link in case the front page is not in the default language
533
  function page_link($link, $id) {
534
- if ($this->options['redirect_lang'] && $this->page_on_front) {
535
- $lang = $lang = $this->get_post_language($id);
536
  if (!isset($this->posts[$lang->slug][$this->page_on_front]))
537
  $this->posts[$lang->slug][$this->page_on_front] = $this->get_post($this->page_on_front, $lang);
538
  if ($id == $this->posts[$lang->slug][$this->page_on_front])
@@ -653,7 +652,7 @@ class Polylang_Core extends Polylang_base {
653
  return $this->translation_url[$language->slug];
654
 
655
  global $wp_query, $wp_rewrite;
656
- $qvars = $wp_query->query;
657
  $hide = $this->options['default_lang'] == $language->slug && $this->options['hide_default'];
658
 
659
  // post and attachment
@@ -689,22 +688,22 @@ class Polylang_Core extends Polylang_base {
689
  remove_filter($filter, array(&$this, 'archive_link'));
690
 
691
  if (is_author())
692
- $url = $this->add_language_to_link(get_author_posts_url(0, $qvars['author_name']), $language);
693
 
694
  if (is_year())
695
- $url = $this->add_language_to_link(get_year_link($qvars['year']), $language);
696
 
697
  if (is_month())
698
- $url = $this->add_language_to_link(get_month_link($qvars['year'], $qvars['monthnum']), $language);
699
 
700
  if (is_day())
701
- $url = $this->add_language_to_link(get_day_link($qvars['year'], $qvars['monthnum'], $qvars['day']), $language);
702
 
703
  if (is_post_type_archive())
704
- $url = $this->add_language_to_link(get_post_type_archive_link($qvars['post_type']), $language);
705
 
706
  if (is_tax('post_format'))
707
- $url = $this->add_language_to_link(get_post_format_link($qvars['post_format']), $language);
708
 
709
  // put our language filters again
710
  add_filter('term_link', array(&$this, 'term_link'), 10, 3);
@@ -733,14 +732,12 @@ class Polylang_Core extends Polylang_base {
733
  }
734
 
735
  // filters the nav menus according to the current language when called from get_nav_menu_locations()
736
- // mainly for Artisteer generated themes
737
  function nav_menu_locations($menus) {
738
- if (is_array($menus)) {
739
- foreach($menus as $location => $menu) {
740
- $menu_lang = get_option('polylang_nav_menus');
741
- if (isset($menu_lang[$location][$this->curlang->slug]))
742
- $menus[$location] = $menu_lang[$location][$this->curlang->slug];
743
- }
744
  }
745
  return $menus;
746
  }
@@ -809,18 +806,18 @@ class Polylang_Core extends Polylang_base {
809
  if ($language == '')
810
  $language = $this->curlang;
811
 
812
- if (isset($this->home_urls[$language->slug]))
813
- return $this->home_urls[$language->slug];
814
 
815
  if ($this->options['default_lang'] == $language->slug && $this->options['hide_default'])
816
- return $this->home_urls[$language->slug] = trailingslashit($this->home);
817
 
818
  // a static page is used as front page : /!\ don't use get_page_link to avoid infinite loop
819
  // don't use this for search form
820
  if (!$is_search && $this->page_on_front && $id = $this->get_post($this->page_on_front, $language))
821
- return $this->home_urls[$language->slug] = $this->page_link('', $id);
822
 
823
- return $this->home_urls[$language->slug] = get_term_link($language, 'language');
824
  }
825
 
826
  // displays (or returns) the language switcher
113
  add_filter('widget_display_callback', array(&$this, 'widget_display_callback'), 10, 3);
114
 
115
  // strings translation (must be applied before WordPress applies its default formatting filters)
116
+ foreach (array('widget_title', 'option_blogname', 'option_blogdescription', 'option_date_format', 'option_time_format') as $filter)
117
+ add_filter($filter, 'pll__', 1);
 
118
 
119
  // translates biography
120
  add_filter('get_user_metadata', array(&$this,'get_user_metadata'), 10, 4);
300
  // as done by xili_language: load text domains and reinitialize wp_locale with the action 'wp'
301
  // as done by qtranslate: define the locale with the action 'plugins_loaded', but in this case, the language must be specified in the url.
302
  function load_textdomains() {
 
 
303
  // our override_load_textdomain filter has done its job. let's remove it before calling load_textdomain
304
  remove_filter('override_load_textdomain', array(&$this, 'mofile'));
305
  remove_filter('gettext', array(&$this, 'gettext'), 10, 3);
315
  // set all our language filters and actions
316
  $this->add_language_filters();
317
 
318
+ if (!($this->options['force_lang'] && $GLOBALS['wp_rewrite']->using_permalinks() && PLL_LANG_EARLY)) {
319
+ if ($this->curlang->description != 'en_US') {
320
+ // now we can load text domains with the right language
321
+ $new_locale = get_locale();
322
+ foreach ($this->list_textdomains as $textdomain)
323
+ load_textdomain( $textdomain['domain'], str_replace($this->default_locale, $new_locale, $textdomain['mo']));
324
+
325
+ // reinitializes wp_locale for weekdays and months, as well as for text direction
326
+ unset($GLOBALS['wp_locale']);
327
+ $GLOBALS['wp_locale'] = new WP_Locale();
328
+ $GLOBALS['wp_locale']->text_direction = get_metadata('term', $this->curlang->term_id, '_rtl', true) ? 'rtl' : 'ltr';
329
+
330
+ // translate labels of post types and taxonomies
331
+ foreach ($GLOBALS['wp_taxonomies'] as $tax)
332
+ $this->translate_labels($tax);
333
+ foreach ($GLOBALS['wp_post_types'] as $pt)
334
+ $this->translate_labels($pt);
335
+ }
336
 
337
  // and finally load user defined strings
338
+ $GLOBALS['l10n']['pll_string'] = $this->mo_import($this->curlang);
339
  }
 
340
  }
341
 
342
  else {
382
  if (!$this->get_languages_list() || !did_action('wp_loaded') || $query->get('suppress_filters'))
383
  return $query;
384
 
385
+ $qv = $query->query_vars;
386
 
387
  // users may want to display content in a different language than the current one by setting it explicitely in the query
388
+ if (!$this->first_query && $this->curlang && isset($qv['lang']) && $qv['lang'])
389
  return $query;
390
 
391
  $this->first_query = false;
392
 
393
  // detect our exclude pages query and returns to avoid conflicts
394
  // this test should be sufficient
395
+ if (isset($qv['tax_query'][0]['taxonomy']) && $qv['tax_query'][0]['taxonomy'] == 'language' &&
396
+ isset($qv['tax_query'][0]['operator']) && $qv['tax_query'][0]['operator'] == 'NOT IN')
397
  return $query;
398
 
399
  // special case for wp-signup.php & wp-activate.php
404
 
405
  // homepage is requested, let's set the language
406
  // take care to avoid posts page for which is_home = 1
407
+ if (!$this->curlang && empty($query->query) && (is_home() || (is_page() && $qv['page_id'] == $this->page_on_front)))
408
  $this->home_requested($query);
409
 
410
  // redirect the language page to the homepage
411
  if ($this->options['redirect_lang'] && is_tax('language') && $this->page_on_front && (count($query->query) == 1 || (is_paged() && count($query->query) == 2))) {
412
+ $qv['page_id'] = $this->get_post($this->page_on_front, $this->get_language(get_query_var('lang')));
413
+ $query->parse_query($qv);
414
  return $query;
415
  }
416
 
426
  if ($this->page_for_posts) {
427
  // If permalinks are used, WordPress does set and use $query->queried_object_id and sets $query->query_vars['page_id'] to 0
428
  // and does set and use $query->query_vars['page_id'] if permalinks are not used :(
429
+ if (isset($qv['pagename']) && $qv['pagename'] && isset($query->queried_object_id))
430
  $page_id = $query->queried_object_id;
431
+ elseif (isset($qv['page_id']))
432
+ $page_id = $qv['page_id'];
433
 
434
  if (isset($page_id) && $page_id && $this->get_post($page_id, $this->get_post_language($this->page_for_posts)) == $this->page_for_posts) {
435
  $this->page_for_posts = $page_id;
442
  }
443
  }
444
 
445
+ $is_post_type = isset($qv['post_type']) && (in_array($qv['post_type'], $this->post_types) ||
446
+ (is_array($qv['post_type']) && array_intersect($qv['post_type'], $this->post_types)) );
447
 
448
  // FIXME to generalize as I probably forget things
449
+ $is_archive = (count($query->query) == 1 && isset($qv['paged']) && $qv['paged']) ||
450
+ (isset($qv['m']) && $qv['m']) ||
451
+ (isset($qv['author']) && $qv['author']) ||
452
+ (isset($qv['post_type']) && is_post_type_archive() && $is_post_type);
453
 
454
  // sets 404 when the language is not set for archives needing the language in the url
455
+ if (!$this->options['hide_default'] && !isset($qv['lang']) && !$GLOBALS['wp_rewrite']->using_permalinks() && $is_archive)
456
  $query->set_404();
457
 
458
  // sets the language in case we hide the default language
459
+ if ($this->options['hide_default'] && !isset($qv['lang']) && ($is_archive || is_search() || (count($query->query) == 1 && isset($qv['feed']) && $qv['feed']) ))
460
  $query->set('lang', $this->options['default_lang']);
461
 
462
  // allow filtering recent posts and secondary queries by the current language
463
  // take care not to break queries for non visible post types such as nav_menu_items, attachments...
464
+ if (/*$query->is_home && */$this->curlang && (!isset($qv['post_type']) || $is_post_type ))
465
  $query->set('lang', $this->curlang->slug);
466
 
467
  // remove pages query when the language is set unless we do a search
468
  // FIXME is only search broken by this ?
469
+ if (isset($qv['lang']) && $qv['lang'] && !isset($qv['post_type']) && !is_search())
470
  $query->set('post_type', 'post');
471
 
472
  // unset the is_archive flag for language pages to prevent loading the archive template
473
  // keep archive flag for comment feed otherwise the language filter does not work
474
+ if (isset($qv['lang']) && $qv['lang'] && !is_comment_feed() &&
475
  !is_post_type_archive() && !is_date() && !is_author() && !is_category() && !is_tag() && !is_tax('post_format'))
476
  $query->is_archive = false;
477
 
478
  // unset the is_tax flag for authors pages and post types archives
479
  // FIXME Probably I should do this for other cases
480
+ if (isset($qv['lang']) && $qv['lang'] && (is_author() || is_post_type_archive() || is_date() || is_search())) {
481
  $query->is_tax = false;
482
  unset($query->queried_object);
483
  }
484
 
485
  // sets a language for theme preview
486
+ if (is_preview() && is_front_page()) {
487
+ $this->curlang = $this->get_current_language();
488
  $query->set('lang', $this->curlang->slug);
489
+ }
490
 
491
  // to avoid conflict beetwen taxonomies
492
  if (isset($query->tax_query->queries))
531
 
532
  // modifies the page link in case the front page is not in the default language
533
  function page_link($link, $id) {
534
+ if ($this->options['redirect_lang'] && $this->page_on_front && $lang = $this->get_post_language($id)) {
 
535
  if (!isset($this->posts[$lang->slug][$this->page_on_front]))
536
  $this->posts[$lang->slug][$this->page_on_front] = $this->get_post($this->page_on_front, $lang);
537
  if ($id == $this->posts[$lang->slug][$this->page_on_front])
652
  return $this->translation_url[$language->slug];
653
 
654
  global $wp_query, $wp_rewrite;
655
+ $qv = $wp_query->query;
656
  $hide = $this->options['default_lang'] == $language->slug && $this->options['hide_default'];
657
 
658
  // post and attachment
688
  remove_filter($filter, array(&$this, 'archive_link'));
689
 
690
  if (is_author())
691
+ $url = $this->add_language_to_link(get_author_posts_url(0, $qv['author_name']), $language);
692
 
693
  if (is_year())
694
+ $url = $this->add_language_to_link(get_year_link($qv['year']), $language);
695
 
696
  if (is_month())
697
+ $url = $this->add_language_to_link(get_month_link($qv['year'], $qv['monthnum']), $language);
698
 
699
  if (is_day())
700
+ $url = $this->add_language_to_link(get_day_link($qv['year'], $qv['monthnum'], $qv['day']), $language);
701
 
702
  if (is_post_type_archive())
703
+ $url = $this->add_language_to_link(get_post_type_archive_link($qv['post_type']), $language);
704
 
705
  if (is_tax('post_format'))
706
+ $url = $this->add_language_to_link(get_post_format_link($qv['post_format']), $language);
707
 
708
  // put our language filters again
709
  add_filter('term_link', array(&$this, 'term_link'), 10, 3);
732
  }
733
 
734
  // filters the nav menus according to the current language when called from get_nav_menu_locations()
735
+ // mainly for Artisteer generated themes and themes which test has_nav_menu
736
  function nav_menu_locations($menus) {
737
+ $menu_lang = get_option('polylang_nav_menus');
738
+ foreach(get_registered_nav_menus() as $location => $menu) {
739
+ if (isset($menu_lang[$location][$this->curlang->slug]))
740
+ $menus[$location] = $menu_lang[$location][$this->curlang->slug];
 
 
741
  }
742
  return $menus;
743
  }
806
  if ($language == '')
807
  $language = $this->curlang;
808
 
809
+ if (isset($this->home_urls[$language->slug][$is_search]))
810
+ return $this->home_urls[$language->slug][$is_search];
811
 
812
  if ($this->options['default_lang'] == $language->slug && $this->options['hide_default'])
813
+ return $this->home_urls[$language->slug][$is_search] = trailingslashit($this->home);
814
 
815
  // a static page is used as front page : /!\ don't use get_page_link to avoid infinite loop
816
  // don't use this for search form
817
  if (!$is_search && $this->page_on_front && $id = $this->get_post($this->page_on_front, $language))
818
+ return $this->home_urls[$language->slug][$is_search] = $this->page_link('', $id);
819
 
820
+ return $this->home_urls[$language->slug][$is_search] = get_term_link($language, 'language');
821
  }
822
 
823
  // displays (or returns) the language switcher
include/languages.php CHANGED
@@ -5,7 +5,9 @@
5
  // [2] => name
6
  // [3] => not set for ltr scripts, 'rtl' otherwise
7
  $languages = array(
 
8
  array('ar', 'ar', 'العربية', 'rtl'),
 
9
  array('bg', 'bg_BG', 'български'),
10
  array('bs', 'bs_BA', 'Bosanski'),
11
  array('ca', 'ca', 'Català'),
5
  // [2] => name
6
  // [3] => not set for ltr scripts, 'rtl' otherwise
7
  $languages = array(
8
+ array('af', 'af', 'Afrikaans'),
9
  array('ar', 'ar', 'العربية', 'rtl'),
10
+ array('be', 'be_BY', 'Беларуская мова'),
11
  array('bg', 'bg_BG', 'български'),
12
  array('bs', 'bs_BA', 'Bosanski'),
13
  array('ca', 'ca', 'Català'),
languages/polylang-af.mo ADDED
Binary file
languages/polylang-af.po ADDED
@@ -0,0 +1,449 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: polylang\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-08-19 20:12+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Kobus Joubert <kobus@lewendewoord.co.za>\n"
8
+ "Language-Team: \n"
9
+ "Language: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2: nplural=n>1\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: _e;__;_x\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+ "X-Poedit-SearchPath-1: ../include\n"
19
+
20
+ #: ../polylang.php:111
21
+ #, php-format
22
+ msgid "You are using WordPress %s. Polylang requires at least WordPress %s."
23
+ msgstr "Jy gebruik WordPress %s. Polylang vereis ten minste WordPress %s."
24
+
25
+ #: ../polylang.php:125
26
+ msgid "For some reasons, Polylang could not create a table in your database."
27
+ msgstr "Vir een of ander rede kon Polylang nie 'n tabel in jou databasis stoor nie."
28
+
29
+ #: ../polylang.php:208
30
+ msgid "Error: Restore of local flags failed!"
31
+ msgstr "Fout: Herstel van plaaslike vlae het misluk!"
32
+
33
+ #: ../polylang.php:209
34
+ #, php-format
35
+ msgid "Please move your local flags from %s to %s"
36
+ msgstr "Beweeg jou plaaslike vlae van %s na %s"
37
+
38
+ #: ../include/calendar.php:106
39
+ #, php-format
40
+ msgid "%1$s %2$s"
41
+ msgstr "%1$s %2$s"
42
+
43
+ #: ../include/calendar.php:132
44
+ #: ../include/calendar.php:140
45
+ #, php-format
46
+ msgid "View posts for %1$s %2$s"
47
+ msgstr "Sien posts vir %1$s %2$s"
48
+
49
+ #: ../include/media-translations.php:3
50
+ #: ../include/admin-filters.php:194
51
+ #: ../include/admin-filters.php:525
52
+ #: ../include/admin-filters.php:696
53
+ #: ../include/admin-filters.php:714
54
+ #: ../include/post-translations.php:8
55
+ #: ../include/term-translations.php:15
56
+ msgid "Language"
57
+ msgstr "Taal"
58
+
59
+ #: ../include/media-translations.php:4
60
+ #: ../include/term-translations.php:16
61
+ msgid "Translation"
62
+ msgstr "Vertaling"
63
+
64
+ #: ../include/media-translations.php:18
65
+ #: ../include/post-translations.php:10
66
+ #: ../include/post-translations.php:33
67
+ #: ../include/term-translations.php:18
68
+ #: ../include/term-translations.php:65
69
+ msgid "Edit"
70
+ msgstr "Verander"
71
+
72
+ #: ../include/media-translations.php:26
73
+ #: ../include/post-translations.php:38
74
+ #: ../include/term-translations.php:54
75
+ msgid "Add new"
76
+ msgstr "Maak nuwe"
77
+
78
+ #: ../include/widget.php:6
79
+ msgid "Language Switcher"
80
+ msgstr "Taal Selektor"
81
+
82
+ #: ../include/widget.php:6
83
+ msgid "Displays a language switcher"
84
+ msgstr "Toon 'n taal selektor"
85
+
86
+ #: ../include/widget.php:73
87
+ msgid "Title:"
88
+ msgstr "Titel:"
89
+
90
+ #: ../include/admin-base.php:50
91
+ #: ../include/admin-base.php:176
92
+ #: ../include/admin.php:290
93
+ #: ../include/admin-filters.php:221
94
+ msgid "Languages"
95
+ msgstr "Tale"
96
+
97
+ #: ../include/admin-base.php:55
98
+ msgid "About Polylang"
99
+ msgstr "Oor Polylang"
100
+
101
+ #: ../include/admin-base.php:149
102
+ msgid "Displays language names"
103
+ msgstr "Toon taal name"
104
+
105
+ #: ../include/admin-base.php:150
106
+ msgid "Displays flags"
107
+ msgstr "Toon vlae"
108
+
109
+ #: ../include/admin-base.php:151
110
+ msgid "Forces link to front page"
111
+ msgstr "Dwing skakel na voorblad"
112
+
113
+ #: ../include/admin-base.php:152
114
+ msgid "Hides the current language"
115
+ msgstr "Verberg die huidige taal"
116
+
117
+ #: ../include/admin-base.php:154
118
+ msgid "Displays a language switcher at the end of the menu"
119
+ msgstr "Toon 'n taal selektor aan die einde van die kieslys"
120
+
121
+ #: ../include/admin-base.php:155
122
+ msgid "Displays as dropdown"
123
+ msgstr "Toon as dropdown"
124
+
125
+ #: ../include/admin-base.php:177
126
+ msgid "Filters content by language"
127
+ msgstr "Filtreer inhoud volgens taal"
128
+
129
+ #: ../include/admin-base.php:184
130
+ msgid "Show all languages"
131
+ msgstr "Toon alle tale"
132
+
133
+ #: ../include/admin.php:295
134
+ msgid "Menus"
135
+ msgstr "Kieslys"
136
+
137
+ #: ../include/admin.php:297
138
+ msgid "Strings translation"
139
+ msgstr "String vertaling"
140
+
141
+ #: ../include/admin.php:298
142
+ #: ../include/admin-filters.php:988
143
+ msgid "Settings"
144
+ msgstr "Instellings"
145
+
146
+ #: ../include/admin.php:317
147
+ msgid "Enter a valid WorPress locale"
148
+ msgstr "Gee 'n geldige WorPress locale"
149
+
150
+ #: ../include/admin.php:318
151
+ msgid "The language code must be 2 characters long"
152
+ msgstr "Die taal kode moet 2 karakters lank wees"
153
+
154
+ #: ../include/admin.php:319
155
+ msgid "The language code must be unique"
156
+ msgstr "Die taal kode moet uniek wees"
157
+
158
+ #: ../include/admin.php:320
159
+ msgid "The language must have a name"
160
+ msgstr "Die taal moet 'n naam hê"
161
+
162
+ #: ../include/admin.php:321
163
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
164
+ msgstr "Die taal is geskep, maar die WordPress taallêer is nie afgelaai nie. Installeer dit asseblief by hand."
165
+
166
+ #: ../include/admin.php:409
167
+ msgid "Site Title"
168
+ msgstr "Werf Titel"
169
+
170
+ #: ../include/admin.php:410
171
+ msgid "Tagline"
172
+ msgstr ""
173
+
174
+ #: ../include/admin.php:428
175
+ msgid "Widget title"
176
+ msgstr "Widget titel"
177
+
178
+ #: ../include/admin-filters.php:176
179
+ #: ../include/admin-filters.php:753
180
+ msgid "Add new translation"
181
+ msgstr "Las 'n nuwe vertaling by"
182
+
183
+ #: ../include/admin-filters.php:190
184
+ msgid "&mdash; No Change &mdash;"
185
+ msgstr "&mdash; Geen Verandering &mdash;"
186
+
187
+ #: ../include/admin-filters.php:244
188
+ msgid "Page's language:"
189
+ msgstr "Bladsy se taal:"
190
+
191
+ #: ../include/admin-filters.php:244
192
+ msgid "Post's language:"
193
+ msgstr "Post se taal:"
194
+
195
+ #: ../include/admin-filters.php:305
196
+ msgid "(no parent)"
197
+ msgstr "(geen ouer)"
198
+
199
+ #: ../include/admin-filters.php:536
200
+ #: ../include/admin-filters.php:561
201
+ #: ../include/term-translations.php:6
202
+ #: ../include/term-translations.php:11
203
+ msgid "Translations"
204
+ msgstr "Vertalings"
205
+
206
+ #: ../include/admin-filters.php:698
207
+ #: ../include/admin-filters.php:717
208
+ msgid "Sets the language"
209
+ msgstr "Stel die taal"
210
+
211
+ #: ../include/admin-filters.php:879
212
+ msgid "None"
213
+ msgstr "Geen"
214
+
215
+ #: ../include/admin-filters.php:910
216
+ msgid "Theme locations and languages"
217
+ msgstr "Tema plekke en tale"
218
+
219
+ #: ../include/admin-filters.php:916
220
+ #, php-format
221
+ msgid "Please go to the %slanguages page%s to set theme locations and languages"
222
+ msgstr "Gaan asseblief na die %stale ​​bladsy%s toe om die tema se plekke en tale op te stel"
223
+
224
+ #: ../include/admin-filters.php:931
225
+ msgid "The widget is displayed for:"
226
+ msgstr "Die widget is vertoon vir:"
227
+
228
+ #: ../include/admin-filters.php:935
229
+ msgid "All languages"
230
+ msgstr "Alle tale"
231
+
232
+ #: ../include/admin-filters.php:959
233
+ msgid "Admin language"
234
+ msgstr "Admin taal"
235
+
236
+ #: ../include/admin-filters.php:964
237
+ msgid "Wordpress default"
238
+ msgstr ""
239
+
240
+ #: ../include/admin-filters.php:994
241
+ msgid "Upgrading language files&#8230;"
242
+ msgstr "Opgradering van taal lêers&#8230;"
243
+
244
+ #: ../include/languages-form.php:38
245
+ msgid "Edit language"
246
+ msgstr "Verander tale"
247
+
248
+ #: ../include/languages-form.php:38
249
+ #: ../include/languages-form.php:105
250
+ msgid "Add new language"
251
+ msgstr "Las nuwe taal by"
252
+
253
+ #: ../include/languages-form.php:60
254
+ msgid "Choose a language"
255
+ msgstr "Kies a taal"
256
+
257
+ #: ../include/languages-form.php:68
258
+ msgid "You can choose a language in the list or directly edit it below."
259
+ msgstr "Jy kan 'n taal in die lys kies of dit direk verander hieronder."
260
+
261
+ #: ../include/languages-form.php:72
262
+ msgid "Full name"
263
+ msgstr "Volle naam"
264
+
265
+ #: ../include/languages-form.php:74
266
+ msgid "The name is how it is displayed on your site (for example: English)."
267
+ msgstr "Die naam is hoe dit vertoon word op jou webwerf (byvoorbeeld: Afrikaans)."
268
+
269
+ #: ../include/languages-form.php:78
270
+ msgid "Locale"
271
+ msgstr ""
272
+
273
+ #: ../include/languages-form.php:81
274
+ msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
275
+ msgstr "Wordpress Locale vir die taal (byvoorbeeld: af_ZA). Jy gaan nodig hê om die .mo leêr te installeer vir die taal."
276
+
277
+ #: ../include/languages-form.php:85
278
+ msgid "Language code"
279
+ msgstr "Taal kode"
280
+
281
+ #: ../include/languages-form.php:87
282
+ msgid "2-letters ISO 639-1 language code (for example: en)"
283
+ msgstr "2 letters ISO 639-1 taal-kode (byvoorbeeld: af)"
284
+
285
+ #: ../include/languages-form.php:91
286
+ msgid "Text direction"
287
+ msgstr "Skrif rigting"
288
+
289
+ #: ../include/languages-form.php:93
290
+ msgid "left to right"
291
+ msgstr "links na regs"
292
+
293
+ #: ../include/languages-form.php:95
294
+ msgid "right to left"
295
+ msgstr "regs na links"
296
+
297
+ #: ../include/languages-form.php:96
298
+ msgid "Choose the text direction for the language"
299
+ msgstr "Kies die skrif rigting vir die taal"
300
+
301
+ #: ../include/languages-form.php:100
302
+ msgid "Order"
303
+ msgstr "Orde"
304
+
305
+ #: ../include/languages-form.php:102
306
+ msgid "Position of the language in the language switcher"
307
+ msgstr "Posisie van die taal in die taal selektor"
308
+
309
+ #: ../include/languages-form.php:105
310
+ msgid "Update"
311
+ msgstr "Opdateer"
312
+
313
+ #: ../include/languages-form.php:151
314
+ msgid "Language switcher"
315
+ msgstr "Taal selektor"
316
+
317
+ #: ../include/languages-form.php:175
318
+ msgid "Clean strings translation database"
319
+ msgstr "Skoon stringe vertaling databasis"
320
+
321
+ #: ../include/languages-form.php:191
322
+ msgid "Default language"
323
+ msgstr "Default taal"
324
+
325
+ #: ../include/languages-form.php:203
326
+ msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
327
+ msgstr "Daar is posts, bladsye, kategorieë of tags sonder 'n taal gestel. Wil jy hulle almal stel na die standaard taal?"
328
+
329
+ #: ../include/languages-form.php:211
330
+ msgid "Detect browser language"
331
+ msgstr "Spoor browser taal op"
332
+
333
+ #: ../include/languages-form.php:217
334
+ msgid "When the front page is visited, set the language according to the browser preference"
335
+ msgstr "Wanneer die voorblad besoek word, stel die taal volgens die browser se voorkeur"
336
+
337
+ #: ../include/languages-form.php:224
338
+ msgid "URL modifications"
339
+ msgstr "URL veranderinge"
340
+
341
+ #: ../include/languages-form.php:230
342
+ msgid "The language is set from content. Posts, pages, categories and tags urls are not modified."
343
+ msgstr "Die taal is gestel vanaf die inhoud. Posts, bladsye, kategorieë en tags URL's is nie verander nie."
344
+
345
+ #: ../include/languages-form.php:238
346
+ msgid "The language code, for example /en/, is added to all urls when using pretty permalinks."
347
+ msgstr "Die taal kode, byvoorbeeld /af/, word bygevoeg aan al die URL's wanneer mooi permanente skakels gebruik word."
348
+
349
+ #: ../include/languages-form.php:247
350
+ msgid "Remove /language/ in pretty permalinks. Example:"
351
+ msgstr "Verwyder /taal/ in mooi permanente skakels. Voorbeeld:"
352
+
353
+ #: ../include/languages-form.php:256
354
+ msgid "Keep /language/ in pretty permalinks. Example:"
355
+ msgstr "Hou /taal/ in mooi permanente skakels. Voorbeeld:"
356
+
357
+ #: ../include/languages-form.php:265
358
+ msgid "Hide URL language information for default language"
359
+ msgstr "Verberg URL taal inligting vir standaard taal"
360
+
361
+ #: ../include/languages-form.php:274
362
+ #, php-format
363
+ msgid "When using static front page, redirect the language page (example: %s) to the front page in the right language"
364
+ msgstr "Wanneer 'n statiese voorblad gebruik word, herlei die taal bladsy (byvoorbeeld: %s) na die voorblad in die regte taal"
365
+
366
+ #: ../include/languages-form.php:281
367
+ msgid "Synchronization"
368
+ msgstr "Sinkronisering"
369
+
370
+ #: ../include/languages-form.php:287
371
+ msgid "Allow to synchronize categories, tags, featured image and other metas between translations of a post or page"
372
+ msgstr "Laat kategorieë, tags, verskynede beeld en ander metas tussen vertalings van 'n ​​post of bladsy te sinkroniseer"
373
+
374
+ #: ../include/post-translations.php:5
375
+ msgid "ID of pages in other languages:"
376
+ msgstr "ID van bladsye in ander tale:"
377
+
378
+ #: ../include/post-translations.php:5
379
+ msgid "ID of posts in other languages:"
380
+ msgstr "ID van posts in ander tale:"
381
+
382
+ #: ../include/post-translations.php:9
383
+ msgid "Page ID"
384
+ msgstr "Bladsy ID"
385
+
386
+ #: ../include/post-translations.php:9
387
+ msgid "Post ID"
388
+ msgstr ""
389
+
390
+ #: ../include/about.php:3
391
+ #, php-format
392
+ msgid "Polylang is provided with an extensive %sdocumentation%s (in English only). It includes information on how to set up your multilingual site and use it on a daily basis, a FAQ, as well as a documentation for programmers to adapt their plugins and themes."
393
+ msgstr "Polylang word voorsien met 'n uitgebreide %s dokumentasie %s (slegs in Engels). Dit sluit inligting in oor hoe om jou veeltalige werf op te stel en dit op 'n daaglikse basis te gebruik, 'n FAQ, sowel as 'n dokumentasie vir programmeerders om hul plugins en temas aan te pas."
394
+
395
+ #: ../include/about.php:8
396
+ #, php-format
397
+ msgid "You will also find useful information in the %ssupport forum%s. However don't forget to make a search before posting a new topic."
398
+ msgstr "Jy sal ook nuttige inligting in die %s support forum %s vind. Maar moenie vergeet om 'n soektog te maak voordat 'n nuwe onderwerp gepos word nie."
399
+
400
+ #: ../include/about.php:14
401
+ #, php-format
402
+ msgid "Polylang is free of charge and is released under the same license as WordPress, the %sGPL%s."
403
+ msgstr "Polylang is gratis en is vrygestel onder dieselfde lisensie as WordPress, die %sGPL%s."
404
+
405
+ #: ../include/about.php:18
406
+ #, php-format
407
+ msgid "If you wonder how you can help the project, just %sread this%s."
408
+ msgstr "As jy wonder hoe jy die projek kan help, %slees hierdie%s."
409
+
410
+ #: ../include/about.php:22
411
+ msgid "Finally if you like this plugin or if it helps your business, donations to the author are greatly appreciated."
412
+ msgstr "Laastens as jy van hierdie plugin hou, of as dit jou besigheid help, sal donasies aan die skrywer opreg waardeer word."
413
+
414
+ #: ../include/core.php:547
415
+ msgid "Search"
416
+ msgstr "Soek"
417
+
418
+ #: ../include/term-translations.php:48
419
+ msgid "No untranslated term"
420
+ msgstr "Geen onvertaalde term"
421
+
422
+ #: ../include/list-table.php:27
423
+ msgid "Delete"
424
+ msgstr "Verwyder"
425
+
426
+ #: ../include/list-table.php:47
427
+ msgid "Code"
428
+ msgstr "Kode"
429
+
430
+ #: ../include/list-table.php:49
431
+ msgid "Flag"
432
+ msgstr "Vlag"
433
+
434
+ #: ../include/list-table.php:50
435
+ msgid "Posts"
436
+ msgstr ""
437
+
438
+ #: ../include/list-table.php:105
439
+ msgid "Strings translations"
440
+ msgstr "String vertalings"
441
+
442
+ #: ../include/list-table.php:131
443
+ msgid "Name"
444
+ msgstr "Naam"
445
+
446
+ #: ../include/list-table.php:132
447
+ msgid "String"
448
+ msgstr ""
449
+
languages/polylang-be_BY.mo ADDED
Binary file
languages/polylang-be_BY.po ADDED
@@ -0,0 +1,566 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: polylang\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-08-19 20:20+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Alexander <alexander.markevitch@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "Language: ru_RU\n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
+ "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: .\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "X-Generator: Poedit 1.5.4\n"
20
+ "X-Poedit-SearchPath-0: ..\n"
21
+
22
+ # @ polylang
23
+ #: ../polylang.php:111
24
+ #, php-format
25
+ msgid "You are using WordPress %s. Polylang requires at least WordPress %s."
26
+ msgstr ""
27
+ "Вы выкарыстоўваеце WordPress %s. Polylang патрабуе па меньшае WordPress %s."
28
+
29
+ # @ polylang
30
+ #: ../polylang.php:125
31
+ msgid "For some reasons, Polylang could not create a table in your database."
32
+ msgstr ""
33
+ "Па некаторых прычынах, Polylang не мае магчымасьці стварыць табліцу ў базе "
34
+ "даных."
35
+
36
+ # @ polylang
37
+ #: ../polylang.php:208
38
+ msgid "Error: Restore of local flags failed!"
39
+ msgstr ""
40
+ "Памылка: Не атрымалася ўзнавіць карыстальніцкія іконкі-сьцягі з рэзэрвовай "
41
+ "копіі!"
42
+
43
+ # @ polylang
44
+ #: ../polylang.php:209
45
+ #, fuzzy, php-format
46
+ msgid "Please move your local flags from %s to %s"
47
+ msgstr "Калі ласка, перамясьціце "
48
+
49
+ # @ default
50
+ #: ../include/calendar.php:106
51
+ #, php-format
52
+ msgctxt "calendar caption"
53
+ msgid "%1$s %2$s"
54
+ msgstr "%1$s %2$s"
55
+
56
+ # @ default
57
+ #: ../include/calendar.php:132 ../include/calendar.php:140
58
+ #, php-format
59
+ msgid "View posts for %1$s %2$s"
60
+ msgstr "Адлюстроўваць запісы для %1$s %2$s"
61
+
62
+ # @ polylang
63
+ #: ../include/media-translations.php:3 ../include/admin-filters.php:194
64
+ #: ../include/admin-filters.php:525 ../include/admin-filters.php:696
65
+ #: ../include/admin-filters.php:714 ../include/post-translations.php:8
66
+ #: ../include/term-translations.php:15
67
+ msgid "Language"
68
+ msgstr "Мова"
69
+
70
+ # @ polylang
71
+ #: ../include/media-translations.php:4 ../include/term-translations.php:16
72
+ msgid "Translation"
73
+ msgstr "Пераклад"
74
+
75
+ # @ polylang
76
+ #: ../include/media-translations.php:18 ../include/post-translations.php:10
77
+ #: ../include/post-translations.php:33 ../include/term-translations.php:18
78
+ #: ../include/term-translations.php:65
79
+ msgid "Edit"
80
+ msgstr "Рэдагаваць"
81
+
82
+ # @ polylang
83
+ #: ../include/media-translations.php:26 ../include/post-translations.php:38
84
+ #: ../include/term-translations.php:54
85
+ msgid "Add new"
86
+ msgstr "Дадаць новую"
87
+
88
+ # @ polylang
89
+ #: ../include/widget.php:6
90
+ msgid "Language Switcher"
91
+ msgstr "Пераключальнік моў"
92
+
93
+ # @ polylang
94
+ #: ../include/widget.php:6
95
+ msgid "Displays a language switcher"
96
+ msgstr "Паказвае пераключальнік моў"
97
+
98
+ # @ polylang
99
+ #: ../include/widget.php:73
100
+ msgid "Title:"
101
+ msgstr "Назва:"
102
+
103
+ # @ polylang
104
+ #: ../include/admin-base.php:50 ../include/admin-base.php:176
105
+ #: ../include/admin.php:290 ../include/admin-filters.php:221
106
+ msgid "Languages"
107
+ msgstr "Мовы"
108
+
109
+ # @ polylang
110
+ #: ../include/admin-base.php:55
111
+ msgid "About Polylang"
112
+ msgstr "Аб Polylang"
113
+
114
+ # @ polylang
115
+ #: ../include/admin-base.php:149
116
+ msgid "Displays language names"
117
+ msgstr "Паказваць назвы моў"
118
+
119
+ # @ polylang
120
+ #: ../include/admin-base.php:150
121
+ msgid "Displays flags"
122
+ msgstr "Паказваць сьцягі"
123
+
124
+ # @ polylang
125
+ #: ../include/admin-base.php:151
126
+ msgid "Forces link to front page"
127
+ msgstr "Прымусова пераходзіць на галоўную старонку сайта пры зьмене мовы"
128
+
129
+ # @ polylang
130
+ #: ../include/admin-base.php:152
131
+ msgid "Hides the current language"
132
+ msgstr "Схаваць выкарыстоўваемую мову"
133
+
134
+ # @ polylang
135
+ #: ../include/admin-base.php:154
136
+ msgid "Displays a language switcher at the end of the menu"
137
+ msgstr "Паказвае пераключальнік моў"
138
+
139
+ # @ polylang
140
+ #: ../include/admin-base.php:155
141
+ msgid "Displays as dropdown"
142
+ msgstr "Паказвае як выпадальны сьпіс"
143
+
144
+ # @ polylang
145
+ #: ../include/admin-base.php:177
146
+ msgid "Filters content by language"
147
+ msgstr "Адбіраць зьмесьціва паводле мовы"
148
+
149
+ # @ polylang
150
+ #: ../include/admin-base.php:184
151
+ msgid "Show all languages"
152
+ msgstr "Адлюстраваць усе мовы"
153
+
154
+ # @ polylang
155
+ #: ../include/admin.php:295
156
+ msgid "Menus"
157
+ msgstr "Меню"
158
+
159
+ # @ polylang
160
+ #: ../include/admin.php:297
161
+ msgid "Strings translation"
162
+ msgstr "Пераклад радкоў"
163
+
164
+ # @ default
165
+ # @ polylang
166
+ #: ../include/admin.php:298 ../include/admin-filters.php:988
167
+ msgid "Settings"
168
+ msgstr "Наладкі"
169
+
170
+ # @ polylang
171
+ #: ../include/admin.php:317
172
+ msgid "Enter a valid WorPress locale"
173
+ msgstr "Вызначце карэктную WordPress лакаль"
174
+
175
+ # @ polylang
176
+ #: ../include/admin.php:318
177
+ msgid "The language code must be 2 characters long"
178
+ msgstr "Код мовы павінен складацца з 2 сімвалаў"
179
+
180
+ # @ polylang
181
+ #: ../include/admin.php:319
182
+ msgid "The language code must be unique"
183
+ msgstr "Код мовы павінны быць унікальным"
184
+
185
+ # @ polylang
186
+ #: ../include/admin.php:320
187
+ msgid "The language must have a name"
188
+ msgstr "Мова павінна мець назву"
189
+
190
+ # @ polylang
191
+ #: ../include/admin.php:321
192
+ msgid ""
193
+ "The language was created, but the WordPress language file was not "
194
+ "downloaded. Please install it manually."
195
+ msgstr ""
196
+ "Мова была створана, але патрабуемые моўныя файлы не былі запампованы. Калі "
197
+ "ласка, запампуйце ды устанавіце іх самастойна."
198
+
199
+ # @ default
200
+ #: ../include/admin.php:409
201
+ msgid "Site Title"
202
+ msgstr "Назва сайту"
203
+
204
+ # @ default
205
+ #: ../include/admin.php:410
206
+ msgid "Tagline"
207
+ msgstr "Радок тагаў"
208
+
209
+ # @ polylang
210
+ #: ../include/admin.php:428
211
+ msgid "Widget title"
212
+ msgstr "Назва віджэту"
213
+
214
+ # @ polylang
215
+ #: ../include/admin-filters.php:176 ../include/admin-filters.php:753
216
+ msgid "Add new translation"
217
+ msgstr "Дадаць новы пераклад"
218
+
219
+ #: ../include/admin-filters.php:190
220
+ msgid "&mdash; No Change &mdash;"
221
+ msgstr "&mdash; Бяз зьмены &mdash;"
222
+
223
+ # @ polylang
224
+ #: ../include/admin-filters.php:244
225
+ msgid "Page's language:"
226
+ msgstr "Мова старонкі"
227
+
228
+ # @ polylang
229
+ #: ../include/admin-filters.php:244
230
+ msgid "Post's language:"
231
+ msgstr "Мова запісу"
232
+
233
+ # @ default
234
+ #: ../include/admin-filters.php:305
235
+ msgid "(no parent)"
236
+ msgstr ""
237
+
238
+ # @ polylang
239
+ #: ../include/admin-filters.php:536 ../include/admin-filters.php:561
240
+ #: ../include/term-translations.php:6 ../include/term-translations.php:11
241
+ msgid "Translations"
242
+ msgstr "Пераклады"
243
+
244
+ # @ polylang
245
+ #: ../include/admin-filters.php:698 ../include/admin-filters.php:717
246
+ msgid "Sets the language"
247
+ msgstr "Вызначае мову"
248
+
249
+ # @ default
250
+ #: ../include/admin-filters.php:879
251
+ msgid "None"
252
+ msgstr "Не"
253
+
254
+ # @ polylang
255
+ #: ../include/admin-filters.php:910
256
+ msgid "Theme locations and languages"
257
+ msgstr "Разьмяшчэнне тэмы ды моў"
258
+
259
+ # @ polylang
260
+ #: ../include/admin-filters.php:916
261
+ #, php-format
262
+ msgid ""
263
+ "Please go to the %slanguages page%s to set theme locations and languages"
264
+ msgstr ""
265
+ "Калі ласка, перайдзіце на %slanguages page%s для таго, каб зазначыць "
266
+ "разьмяшчэнне тэмы ды моў"
267
+
268
+ # @ polylang
269
+ #: ../include/admin-filters.php:931
270
+ msgid "The widget is displayed for:"
271
+ msgstr "Паказваць віджэт для"
272
+
273
+ # @ polylang
274
+ #: ../include/admin-filters.php:935
275
+ msgid "All languages"
276
+ msgstr "Усе мовы"
277
+
278
+ # @ polylang
279
+ #: ../include/admin-filters.php:959
280
+ msgid "Admin language"
281
+ msgstr "Мова панэлі адміністратара"
282
+
283
+ #: ../include/admin-filters.php:964
284
+ msgid "Wordpress default"
285
+ msgstr ""
286
+
287
+ # @ polylang
288
+ #: ../include/admin-filters.php:994
289
+ msgid "Upgrading language files&#8230;"
290
+ msgstr ""
291
+
292
+ # @ polylang
293
+ #: ../include/languages-form.php:38
294
+ msgid "Edit language"
295
+ msgstr "Рэдагаваць мову"
296
+
297
+ # @ polylang
298
+ #: ../include/languages-form.php:38 ../include/languages-form.php:105
299
+ msgid "Add new language"
300
+ msgstr "Дадаць новую мову"
301
+
302
+ # @ polylang
303
+ #: ../include/languages-form.php:60
304
+ msgid "Choose a language"
305
+ msgstr "Абраць мову"
306
+
307
+ # @ polylang
308
+ #: ../include/languages-form.php:68
309
+ msgid "You can choose a language in the list or directly edit it below."
310
+ msgstr "Абярыце мову са сьпісу альбо ўкажыце самастойна."
311
+
312
+ # @ polylang
313
+ #: ../include/languages-form.php:72
314
+ msgid "Full name"
315
+ msgstr "Поўная назва"
316
+
317
+ # @ polylang
318
+ #: ../include/languages-form.php:74
319
+ msgid "The name is how it is displayed on your site (for example: English)."
320
+ msgstr "Назва для адлюстравання на сайце (напрыклад: Беларускі)."
321
+
322
+ # @ polylang
323
+ #: ../include/languages-form.php:78
324
+ msgid "Locale"
325
+ msgstr "Лакаль"
326
+
327
+ # @ polylang
328
+ #: ../include/languages-form.php:81
329
+ msgid ""
330
+ "Wordpress Locale for the language (for example: en_US). You will need to "
331
+ "install the .mo file for this language."
332
+ msgstr ""
333
+ "Лакаль Wordpress для мовы (напрыклад: be_BY). Вы павінны устанавіць файлы ."
334
+ "mo для панэлі адміністратара ды выкарыстоўваемай тэмы."
335
+
336
+ # @ polylang
337
+ #: ../include/languages-form.php:85
338
+ msgid "Language code"
339
+ msgstr "Код мовы"
340
+
341
+ # @ polylang
342
+ #: ../include/languages-form.php:87
343
+ msgid "2-letters ISO 639-1 language code (for example: en)"
344
+ msgstr "Дзвюхлітарны код мовы ISO 639-1 (напрыклад: by)"
345
+
346
+ # @ polylang
347
+ #: ../include/languages-form.php:91
348
+ msgid "Text direction"
349
+ msgstr "Напрамак тэксту"
350
+
351
+ # @ polylang
352
+ #: ../include/languages-form.php:93
353
+ msgid "left to right"
354
+ msgstr "зьлева направа"
355
+
356
+ # @ polylang
357
+ #: ../include/languages-form.php:95
358
+ msgid "right to left"
359
+ msgstr "справа налева"
360
+
361
+ # @ polylang
362
+ #: ../include/languages-form.php:96
363
+ msgid "Choose the text direction for the language"
364
+ msgstr ""
365
+
366
+ # @ polylang
367
+ #: ../include/languages-form.php:100
368
+ msgid "Order"
369
+ msgstr ""
370
+
371
+ # @ polylang
372
+ #: ../include/languages-form.php:102
373
+ msgid "Position of the language in the language switcher"
374
+ msgstr ""
375
+
376
+ # @ default
377
+ #: ../include/languages-form.php:105
378
+ msgid "Update"
379
+ msgstr "Аднавіць"
380
+
381
+ # @ polylang
382
+ #: ../include/languages-form.php:151
383
+ msgid "Language switcher"
384
+ msgstr "Выбар моў"
385
+
386
+ #: ../include/languages-form.php:175
387
+ msgid "Clean strings translation database"
388
+ msgstr ""
389
+
390
+ # @ polylang
391
+ #: ../include/languages-form.php:191
392
+ msgid "Default language"
393
+ msgstr "Мова выкарыстання"
394
+
395
+ # @ polylang
396
+ #: ../include/languages-form.php:203
397
+ msgid ""
398
+ "There are posts, pages, categories or tags without language set. Do you want "
399
+ "to set them all to default language ?"
400
+ msgstr ""
401
+ "Былі знойдзены запісы, старонкі, катэгорыі ды тагі без зазначэньня мовы. "
402
+ "Вызначыць мову выкарыстання?"
403
+
404
+ # @ polylang
405
+ #: ../include/languages-form.php:211
406
+ msgid "Detect browser language"
407
+ msgstr "Вызначыць мову браузэра"
408
+
409
+ # @ polylang
410
+ #: ../include/languages-form.php:217
411
+ msgid ""
412
+ "When the front page is visited, set the language according to the browser "
413
+ "preference"
414
+ msgstr "Вызначыць мову сайта паводле наладак браузэра"
415
+
416
+ # @ polylang
417
+ #: ../include/languages-form.php:224
418
+ msgid "URL modifications"
419
+ msgstr "Мадыфікацыі URL"
420
+
421
+ #: ../include/languages-form.php:230
422
+ msgid ""
423
+ "The language is set from content. Posts, pages, categories and tags urls are "
424
+ "not modified."
425
+ msgstr ""
426
+
427
+ #: ../include/languages-form.php:238
428
+ msgid ""
429
+ "The language code, for example /en/, is added to all urls when using pretty "
430
+ "permalinks."
431
+ msgstr ""
432
+
433
+ # @ polylang
434
+ #: ../include/languages-form.php:247
435
+ msgid "Remove /language/ in pretty permalinks. Example:"
436
+ msgstr "Выдаліць /language/ са спасылцы. Напрыклад:"
437
+
438
+ # @ polylang
439
+ #: ../include/languages-form.php:256
440
+ msgid "Keep /language/ in pretty permalinks. Example:"
441
+ msgstr "Пакінуць /language/ са спасылцы. Напрыклад:"
442
+
443
+ # @ polylang
444
+ #: ../include/languages-form.php:265
445
+ msgid "Hide URL language information for default language"
446
+ msgstr "Схаваць назву мовы з URL"
447
+
448
+ #: ../include/languages-form.php:274
449
+ #, php-format
450
+ msgid ""
451
+ "When using static front page, redirect the language page (example: %s) to "
452
+ "the front page in the right language"
453
+ msgstr ""
454
+
455
+ #: ../include/languages-form.php:281
456
+ msgid "Synchronization"
457
+ msgstr ""
458
+
459
+ #: ../include/languages-form.php:287
460
+ msgid ""
461
+ "Allow to synchronize categories, tags, featured image and other metas "
462
+ "between translations of a post or page"
463
+ msgstr ""
464
+
465
+ # @ polylang
466
+ #: ../include/post-translations.php:5
467
+ msgid "ID of pages in other languages:"
468
+ msgstr "ID старонак на другіх мовах:"
469
+
470
+ # @ polylang
471
+ #: ../include/post-translations.php:5
472
+ msgid "ID of posts in other languages:"
473
+ msgstr "ID запісаў на другіх мовах:"
474
+
475
+ # @ polylang
476
+ #: ../include/post-translations.php:9
477
+ msgid "Page ID"
478
+ msgstr "ID старонкі"
479
+
480
+ # @ polylang
481
+ #: ../include/post-translations.php:9
482
+ msgid "Post ID"
483
+ msgstr "ID запісу"
484
+
485
+ # @ polylang
486
+ #: ../include/about.php:3
487
+ #, php-format
488
+ msgid ""
489
+ "Polylang is provided with an extensive %sdocumentation%s (in English only). "
490
+ "It includes information on how to set up your multilingual site and use it "
491
+ "on a daily basis, a FAQ, as well as a documentation for programmers to adapt "
492
+ "their plugins and themes."
493
+ msgstr ""
494
+
495
+ # @ polylang
496
+ #: ../include/about.php:8
497
+ #, php-format
498
+ msgid ""
499
+ "You will also find useful information in the %ssupport forum%s. However "
500
+ "don't forget to make a search before posting a new topic."
501
+ msgstr ""
502
+
503
+ # @ polylang
504
+ #: ../include/about.php:14
505
+ #, php-format
506
+ msgid ""
507
+ "Polylang is free of charge and is released under the same license as "
508
+ "WordPress, the %sGPL%s."
509
+ msgstr ""
510
+
511
+ # @ polylang
512
+ #: ../include/about.php:18
513
+ #, php-format
514
+ msgid "If you wonder how you can help the project, just %sread this%s."
515
+ msgstr "Аб тым, як вы можаце дапамагчы праэкту, вы можаце прачытаць %sтут%s."
516
+
517
+ # @ polylang
518
+ #: ../include/about.php:22
519
+ msgid ""
520
+ "Finally if you like this plugin or if it helps your business, donations to "
521
+ "the author are greatly appreciated."
522
+ msgstr ""
523
+
524
+ #: ../include/core.php:547
525
+ msgid "Search"
526
+ msgstr "Пошук"
527
+
528
+ # @ polylang
529
+ #: ../include/term-translations.php:48
530
+ msgid "No untranslated term"
531
+ msgstr ""
532
+
533
+ # @ polylang
534
+ #: ../include/list-table.php:27
535
+ msgid "Delete"
536
+ msgstr "Выдаліць"
537
+
538
+ # @ polylang
539
+ #: ../include/list-table.php:47
540
+ msgid "Code"
541
+ msgstr "Код"
542
+
543
+ # @ polylang
544
+ #: ../include/list-table.php:49
545
+ msgid "Flag"
546
+ msgstr "Сьцяг"
547
+
548
+ # @ polylang
549
+ #: ../include/list-table.php:50
550
+ msgid "Posts"
551
+ msgstr "Запісы"
552
+
553
+ # @ polylang
554
+ #: ../include/list-table.php:105
555
+ msgid "Strings translations"
556
+ msgstr "Пераклад радкоў"
557
+
558
+ # @ polylang
559
+ #: ../include/list-table.php:131
560
+ msgid "Name"
561
+ msgstr "Імя"
562
+
563
+ # @ polylang
564
+ #: ../include/list-table.php:132
565
+ msgid "String"
566
+ msgstr "Радок"
polylang.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
- Version: 0.9.3
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
@@ -24,7 +24,7 @@ Description: Adds multilingual capability to Wordpress
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
- define('POLYLANG_VERSION', '0.9.3');
28
  define('PLL_MIN_WP_VERSION', '3.1');
29
 
30
  define('POLYLANG_DIR', dirname(__FILE__)); // our directory
@@ -66,13 +66,16 @@ class Polylang extends Polylang_Base {
66
  global $polylang; // globalize the variable to access it in the API
67
 
68
  // manages plugin activation and deactivation
69
- register_activation_hook( __FILE__, array(&$this, 'activate') );
70
- register_deactivation_hook( __FILE__, array(&$this, 'deactivate') );
71
 
72
  // stopping here if we are going to deactivate the plugin avoids breaking rewrite rules
73
  if (isset($_GET['action']) && $_GET['action'] == 'deactivate' && isset($_GET['plugin']) && $_GET['plugin'] == 'polylang/polylang.php')
74
  return;
75
 
 
 
 
76
  // manages plugin upgrade
77
  add_filter('upgrader_post_install', array(&$this, 'post_upgrade'));
78
  add_action('admin_init', array(&$this, 'admin_init'));
@@ -106,24 +109,22 @@ class Polylang extends Polylang_Base {
106
  // plugin activation for multisite
107
  function activate() {
108
  global $wp_version, $wpdb;
109
- $style = '<p style = "font-family: sans-serif; font-size: 12px; color: #333; margin: -5px">%s</p>';
110
 
111
  if (version_compare($wp_version, PLL_MIN_WP_VERSION , '<'))
112
- die (sprintf($style, sprintf(__('You are using WordPress %s. Polylang requires at least WordPress %s.', 'polylang'), $wp_version, PLL_MIN_WP_VERSION)));
 
113
 
114
  // check if it is a network activation - if so, run the activation function for each blog
115
  if (is_multisite() && isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
116
  foreach ($wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")) as $blog_id) {
117
  switch_to_blog($blog_id);
118
- $r = $this->_activate();
119
  }
120
  restore_current_blog();
121
  }
122
  else
123
- $r = $this->_activate();
124
-
125
- if (!$r)
126
- die (sprintf($style, __('For some reasons, Polylang could not create a table in your database.', 'polylang')));
127
  }
128
 
129
  // plugin activation
@@ -146,7 +147,8 @@ class Polylang extends Polylang_Base {
146
  ) $charset_collate;");
147
 
148
  if ($r === false)
149
- return false;
 
150
 
151
  // codex tells to use the init action to call register_taxonomy but I need it now for my rewrite rules
152
  register_taxonomy('language', null , array('label' => false, 'query_var'=>'lang'));
@@ -168,7 +170,6 @@ class Polylang extends Polylang_Base {
168
  $this->add_post_types_taxonomies();
169
  $this->prepare_rewrite_rules();
170
  flush_rewrite_rules();
171
- return true;
172
  }
173
 
174
  // plugin deactivation for multisite
@@ -192,6 +193,13 @@ class Polylang extends Polylang_Base {
192
  flush_rewrite_rules();
193
  }
194
 
 
 
 
 
 
 
 
195
  // restores the local_flags directory after upgrade from version 0.5.1 or older
196
  function post_upgrade() {
197
  // nothing to restore
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
+ Version: 0.9.4
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ define('POLYLANG_VERSION', '0.9.4');
28
  define('PLL_MIN_WP_VERSION', '3.1');
29
 
30
  define('POLYLANG_DIR', dirname(__FILE__)); // our directory
66
  global $polylang; // globalize the variable to access it in the API
67
 
68
  // manages plugin activation and deactivation
69
+ register_activation_hook( __FILE__, array(&$this, 'activate'));
70
+ register_deactivation_hook( __FILE__, array(&$this, 'deactivate'));
71
 
72
  // stopping here if we are going to deactivate the plugin avoids breaking rewrite rules
73
  if (isset($_GET['action']) && $_GET['action'] == 'deactivate' && isset($_GET['plugin']) && $_GET['plugin'] == 'polylang/polylang.php')
74
  return;
75
 
76
+ // blog creation on multisite
77
+ add_action('wpmu_new_blog', array(&$this, 'wpmu_new_blog'));
78
+
79
  // manages plugin upgrade
80
  add_filter('upgrader_post_install', array(&$this, 'post_upgrade'));
81
  add_action('admin_init', array(&$this, 'admin_init'));
109
  // plugin activation for multisite
110
  function activate() {
111
  global $wp_version, $wpdb;
112
+ load_plugin_textdomain('polylang', false, basename(POLYLANG_DIR).'/languages'); // plugin i18n
113
 
114
  if (version_compare($wp_version, PLL_MIN_WP_VERSION , '<'))
115
+ die (sprintf('<p style = "font-family: sans-serif; font-size: 12px; color: #333; margin: -5px">%s</p>',
116
+ sprintf(__('You are using WordPress %s. Polylang requires at least WordPress %s.', 'polylang'), $wp_version, PLL_MIN_WP_VERSION)));
117
 
118
  // check if it is a network activation - if so, run the activation function for each blog
119
  if (is_multisite() && isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) {
120
  foreach ($wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")) as $blog_id) {
121
  switch_to_blog($blog_id);
122
+ $this->_activate();
123
  }
124
  restore_current_blog();
125
  }
126
  else
127
+ $this->_activate();
 
 
 
128
  }
129
 
130
  // plugin activation
147
  ) $charset_collate;");
148
 
149
  if ($r === false)
150
+ die (sprintf('<p style = "font-family: sans-serif; font-size: 12px; color: #333; margin: -5px">%s</p>',
151
+ __('For some reasons, Polylang could not create a table in your database.', 'polylang')));
152
 
153
  // codex tells to use the init action to call register_taxonomy but I need it now for my rewrite rules
154
  register_taxonomy('language', null , array('label' => false, 'query_var'=>'lang'));
170
  $this->add_post_types_taxonomies();
171
  $this->prepare_rewrite_rules();
172
  flush_rewrite_rules();
 
173
  }
174
 
175
  // plugin deactivation for multisite
193
  flush_rewrite_rules();
194
  }
195
 
196
+ // blog creation on multisite
197
+ function wpmu_new_blog($blog_id) {
198
+ switch_to_blog($blog_id);
199
+ $r = $this->_activate();
200
+ restore_current_blog();
201
+ }
202
+
203
  // restores the local_flags directory after upgrade from version 0.5.1 or older
204
  function post_upgrade() {
205
  // nothing to restore
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, i18n, international, l10n, localization
5
  Requires at least: 3.1
6
  Tested up to: 3.4.2
7
- Stable tag: 0.9.3
8
 
9
  Polylang adds multilingual content management support to WordPress.
10
 
@@ -21,7 +21,7 @@ You write posts, pages and create categories and post tags as usual, and then de
21
  * A language switcher is provided as a widget or in the nav menu
22
  * As a bonus, each user can set the WordPress admin language in its profile
23
 
24
- The plugin admin interface is currently available in 17 languages: English, French, German contributed by [Christian Ries](http://www.singbyfoot.lu), Russian contributed by [yoyurec](http://yoyurec.in.ua), 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)
25
 
26
 
27
  Other [contributions](http://wordpress.org/extend/plugins/polylang/other_notes/) are welcome !
@@ -80,7 +80,7 @@ You can subscribe to the tag ['polylang-dev'](http://wordpress.org/tags/polylang
80
 
81
  = Translate the admin interface =
82
 
83
- Polylang is already available in 17 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.
84
 
85
  = Communicate =
86
 
@@ -92,6 +92,22 @@ Every suggestions are welcome.
92
 
93
  == Changelog ==
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  = 0.9.3 (2012-10-08) =
96
 
97
  * Add Bulgarian translation contributed by [pavelsof](http://wordpress.org/support/profile/pavelsof)
4
  Tags: multilingual, bilingual, translate, translation, language, multilanguage, i18n, international, l10n, localization
5
  Requires at least: 3.1
6
  Tested up to: 3.4.2
7
+ Stable tag: 0.9.4
8
 
9
  Polylang adds multilingual content management support to WordPress.
10
 
21
  * A language switcher is provided as a widget or in the nav menu
22
  * As a bonus, each user can set the WordPress admin language in its profile
23
 
24
+ The plugin admin interface is currently available in 19 languages: English, French, German contributed by [Christian Ries](http://www.singbyfoot.lu), Russian contributed by [yoyurec](http://yoyurec.in.ua), 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/)
25
 
26
 
27
  Other [contributions](http://wordpress.org/extend/plugins/polylang/other_notes/) are welcome !
80
 
81
  = Translate the admin interface =
82
 
83
+ Polylang is already available in 19 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.
84
 
85
  = Communicate =
86
 
92
 
93
  == Changelog ==
94
 
95
+ = 0.9.4 (2012-10-23) =
96
+
97
+ * Add Afrikaans translation contributed by [Kobus Joubert](http://translate3d.com/)
98
+ * Add Belarusian translation contributed by [Alexander Markevitch](http://fourfeathers.by/)
99
+ * Add Afrikaans (af) and Belarusian (be_BY) to predefined languages list (automatic download and update of language files won't work)
100
+ * Add the possibility to translate the date format and time format
101
+ * Add compatibility with the 'icl_get_home_url' function from the WPML API
102
+ * Bug correction: still some issues with string translations
103
+ * Bug correction: search is not filtered by the (default) language when the language is set by content and the language code is hidden for the default language
104
+ * Bug correction: posts & pages preview urls are broken when adding the language code to all urls
105
+ * Bug correction: automatically added new top-level pages to menus are not filtered by language
106
+ * Bug correction: the admin language filter messes the categories languages when editing a post and the parent dropdown list when editing a category
107
+ * Bug correction: search form does not work when using a static front page (introduced in 0.9.2)
108
+ * Bug correction: can't set languages for categories and post tags on blogs created after polylang has been activated at network level
109
+ * Bug correction: menus don't work with catch box theme ('has_nav_menu' not correctly filtered)
110
+
111
  = 0.9.3 (2012-10-08) =
112
 
113
  * Add Bulgarian translation contributed by [pavelsof](http://wordpress.org/support/profile/pavelsof)