Polylang - Version 0.6

Version Description

(2012-01-07) =

  • Add Greek translation contributed by theodotos
  • WordPress languages files are now automatically downloaded when creating a new langage (and updated when updating WordPress)
  • Add the possibility to change the order of the languages in the language switcher
  • Add the possibility to translate the site title, tagline and widgets titles
  • Categories, post tags, featured image, page parent, page template and menu order are now copied when adding a new translation
  • Translations are now accessibles in the "Posts", "Pages", "Categories" and "Post tags" admin panels
  • Improve the dropdown language switcher widget (sends now to translated page or home page based on options)
  • Move custom flags from polylang/local_flags to wp_content/polylang
  • Add two options to "pll_the_languages" ('hide_if_no_translation' and 'hide_current'). The function does not output ul tag anymore
  • Improve API
  • Bug correction: Twenty eleven custom Header problem with v0.5.1
  • Bug correction: front-page.php not loaded for translated front page
Download this release

Release Info

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

Code changes from version 0.5.1 to 0.6

css/admin.css CHANGED
@@ -1,19 +1,24 @@
1
  #term-translations table {
2
- width: 100%;
3
  }
4
 
5
  #term-translations th {
6
- padding: 0px;
7
- font-weight: bold;
8
- text-align: left;
9
  }
10
 
11
  #term-translations td {
12
- padding: 0px;
 
 
 
 
 
 
 
13
  }
14
 
15
- #term-translations select {
16
- width: 15em;
17
  }
18
 
19
  #post-translations table {
@@ -26,3 +31,24 @@
26
  #post-translations td {
27
  font-size: 11px;
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #term-translations table {
2
+ width: 97%;
3
  }
4
 
5
  #term-translations th {
6
+ padding: 8px 10px;
 
 
7
  }
8
 
9
  #term-translations td {
10
+ font-size: 12px;
11
+ line-height: 26px;
12
+ margin-bottom: 9px;
13
+ padding: 4px 10px;
14
+ }
15
+
16
+ .tr-language-column {
17
+ width: 35%;
18
  }
19
 
20
+ .tr-edit-column {
21
+ width: 15%;
22
  }
23
 
24
  #post-translations table {
31
  #post-translations td {
32
  font-size: 11px;
33
  }
34
+
35
+ .stringstranslations .column-name {
36
+ width: 10%;
37
+ }
38
+
39
+ .stringstranslations .column-string {
40
+ width: 36%;
41
+ }
42
+
43
+ .translation label {
44
+ display: inline-block;
45
+ width: 23%;
46
+ }
47
+
48
+ .translation input {
49
+ width: 72%;
50
+ }
51
+
52
+ .column-term_group, .column-flag, .column-count {
53
+ width : 10%;
54
+ }
doc/documentation-en.odt CHANGED
Binary file
doc/documentation-en.pdf CHANGED
Binary file
flags/ar.png CHANGED
Binary file
flags/eo.png CHANGED
Binary file
flags/my_MM.png CHANGED
Binary file
img/add.png ADDED
Binary file
img/edit.png ADDED
Binary file
include/admin-filters.php CHANGED
@@ -7,10 +7,9 @@ class Polylang_Admin_Filters extends Polylang_Base {
7
  add_action('admin_init', array(&$this, 'admin_init'));
8
 
9
  // setup js scripts andd css styles
10
- add_action('admin_print_scripts', array(&$this,'admin_js'));
11
- add_action('admin_print_styles', array(&$this,'admin_css'));
12
 
13
- // add the language column (as well as a filter by language) in 'All Posts' an 'All Pages' panels
14
  add_filter('manage_posts_columns', array(&$this, 'add_post_column'), 10, 2);
15
  add_filter('manage_pages_columns', array(&$this, 'add_post_column'));
16
  add_action('manage_posts_custom_column', array(&$this, 'post_column'), 10, 2);
@@ -24,13 +23,22 @@ class Polylang_Admin_Filters extends Polylang_Base {
24
  // ajax response for changing the language in the post metabox
25
  add_action('wp_ajax_post_lang_choice', array(&$this,'post_lang_choice'));
26
 
27
- // adds actions related to languages when saving or deleting posts and pages
 
 
 
 
 
28
  add_action('save_post', array(&$this, 'save_post'));
29
  add_action('before_delete_post', array(&$this, 'delete_post'));
30
 
31
  // filters categories and post tags by language
32
  add_filter('terms_clauses', array(&$this, 'terms_clauses'), 10, 3);
33
 
 
 
 
 
34
  // ajax response for edit term form
35
  add_action('wp_ajax_term_lang_choice', array(&$this,'term_lang_choice'));
36
 
@@ -63,24 +71,25 @@ class Polylang_Admin_Filters extends Polylang_Base {
63
  add_filter('manage_edit-'.$tax.'_columns', array(&$this, 'add_term_column'));
64
  add_action('manage_'.$tax.'_custom_column', array(&$this, 'term_column'), 10, 3);
65
 
66
- // adds actions related to languages when saving or deleting categories and post tags
67
- add_action('created_'.$tax, array(&$this, 'save_term'));
68
- add_action('edited_'.$tax, array(&$this, 'save_term'));
69
  add_action('delete_'.$tax, array(&$this, 'delete_term'));
70
  }
71
  }
72
 
73
- // setup js scripts
74
- function admin_js() {
75
- wp_enqueue_script('polylang_admin', WP_PLUGIN_URL .'/polylang/js/admin.js');
76
- }
77
-
78
- // setup css styles
79
- function admin_css() {
80
- wp_enqueue_style('polylang_admin', WP_PLUGIN_URL .'/polylang/css/admin.css');
 
 
 
81
  }
82
 
83
- // adds the language column (before the date column) in the posts and pages list table
84
  function add_post_column($columns, $post_type ='') {
85
  if ($post_type == '' || get_post_type_object($post_type)->show_ui) {
86
  foreach (array( 'date', 'comments' ) as $k) {
@@ -88,7 +97,8 @@ class Polylang_Admin_Filters extends Polylang_Base {
88
  $end[$k] = array_pop($columns);
89
  }
90
 
91
- $columns['language'] = __('Language', 'polylang');
 
92
 
93
  if (isset($end))
94
  $columns = array_merge($columns, $end);
@@ -96,10 +106,29 @@ class Polylang_Admin_Filters extends Polylang_Base {
96
  return $columns;
97
  }
98
 
99
- // fills the language column in the posts table
100
  function post_column($column, $post_id) {
101
- if ($column == 'language' && $lang = $this->get_post_language($post_id))
102
- echo esc_html($lang->name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
 
105
  // converts language term_id to slug in $query
@@ -168,6 +197,7 @@ class Polylang_Admin_Filters extends Polylang_Base {
168
  $x = new WP_Ajax_Response(array('what' => 'translations', 'data' => ob_get_contents()));
169
  ob_end_clean();
170
 
 
171
  if (isset($_POST['taxonomies'])) {
172
  // not set for pages
173
  foreach ($_POST['taxonomies'] as $taxname) {
@@ -196,22 +226,52 @@ class Polylang_Admin_Filters extends Polylang_Base {
196
  }
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  $x->send();
200
  }
201
 
202
- // saves translations for posts or terms
203
- // the underscore in '_lang' hides the post meta in the Custom Fields metabox in the Edit Post screen
204
- function save_translations($type, $id) {
205
- $lang = call_user_func(array(&$this, 'get_'.$type.'_language'), $id);
206
- if (!$lang)
207
- return;
 
 
 
 
 
 
 
208
 
209
- if (isset($_POST['tr_lang']) && is_array($_POST['tr_lang'])) {
210
- $tr = serialize(array_merge(array($lang->slug => $id), $_POST['tr_lang']));
211
- update_metadata($type, $id, '_translations', $tr);
212
 
213
- foreach($_POST['tr_lang'] as $key=>$p)
214
- update_metadata($type, $p, '_translations', $tr);
 
 
 
 
 
 
 
215
  }
216
  }
217
 
@@ -224,10 +284,81 @@ class Polylang_Admin_Filters extends Polylang_Base {
224
  if ($id = wp_is_post_revision($post_id))
225
  $post_id = $id;
226
 
227
- if (isset($_POST['post_lang_choice']))
228
- wp_set_post_terms($post_id, $_POST['post_lang_choice'], 'language' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
 
230
- $this->save_translations('post', $post_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
231
  }
232
 
233
  // called when a post (or page) is deleted
@@ -242,7 +373,7 @@ class Polylang_Admin_Filters extends Polylang_Base {
242
  function terms_clauses($clauses, $taxonomies, $args) {
243
  // does nothing except on taxonomies which have show_ui set to 1 (includes category and post_tags)
244
  foreach ($taxonomies as $tax) {
245
- if(!get_taxonomy($tax)->show_ui)
246
  return $clauses;
247
  }
248
 
@@ -258,6 +389,10 @@ class Polylang_Admin_Filters extends Polylang_Base {
258
  // *FIXME I want all categories in the dropdown list and only the ones in the right language in the inline edit
259
  // It seems that I need javascript to get the post_id as inline edit data are manipulated in inline-edit-post.js
260
 
 
 
 
 
261
  global $post_ID;
262
  $options = get_option('polylang');
263
 
@@ -316,7 +451,8 @@ class Polylang_Admin_Filters extends Polylang_Base {
316
  if (array_key_exists('posts', $columns))
317
  $end = array_pop($columns);
318
 
319
- $columns['language'] = __('Language', 'polylang');
 
320
 
321
  if (isset($end))
322
  $columns['posts'] = $end;
@@ -326,22 +462,76 @@ class Polylang_Admin_Filters extends Polylang_Base {
326
 
327
  // fills the language column in the 'Categories' or Post Tags table
328
  function term_column($empty, $column, $term_id) {
329
- if ($column == 'language' && $lang = $this->get_term_language($term_id))
330
- echo esc_html($lang->name);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
  }
332
 
333
  // called when a category or post tag is created or edited
334
- function save_term($term_id) {
 
 
 
 
335
  // avoids breaking translations when using inline edit
336
- if(isset($_POST['_inline_edit']))
337
  return;
338
 
339
  if (isset($_POST['term_lang_choice']) && $_POST['term_lang_choice'])
340
- $this->update_term_language($term_id, $_POST['term_lang_choice']);
341
  else
342
  $this->delete_term_language($term_id);
343
 
344
- $this->save_translations('term', $term_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
345
  }
346
 
347
  // called when a category or post tag is deleted
7
  add_action('admin_init', array(&$this, 'admin_init'));
8
 
9
  // setup js scripts andd css styles
10
+ add_action('admin_enqueue_scripts', array(&$this,'admin_enqueue_scripts'));
 
11
 
12
+ // add the language and translations columns (as well as a filter by language) in 'All Posts' an 'All Pages' panels
13
  add_filter('manage_posts_columns', array(&$this, 'add_post_column'), 10, 2);
14
  add_filter('manage_pages_columns', array(&$this, 'add_post_column'));
15
  add_action('manage_posts_custom_column', array(&$this, 'post_column'), 10, 2);
23
  // ajax response for changing the language in the post metabox
24
  add_action('wp_ajax_post_lang_choice', array(&$this,'post_lang_choice'));
25
 
26
+ // filters the pages by language in the parent dropdown list in the page attributes metabox
27
+ add_filter('page_attributes_dropdown_pages_args', array(&$this, 'page_attributes_dropdown_pages_args'), 10, 2);
28
+
29
+ // adds actions and filters related to languages when creating, saving or deleting posts and pages
30
+ add_filter('wp_insert_post_parent', array(&$this, 'wp_insert_post_parent'), 10, 4);
31
+ add_action('dbx_post_advanced', array(&$this, 'dbx_post_advanced'));
32
  add_action('save_post', array(&$this, 'save_post'));
33
  add_action('before_delete_post', array(&$this, 'delete_post'));
34
 
35
  // filters categories and post tags by language
36
  add_filter('terms_clauses', array(&$this, 'terms_clauses'), 10, 3);
37
 
38
+ // adds actions related to languages when saving categories and post tags
39
+ add_action('created_term', array(&$this, 'save_term'), 10, 3);
40
+ add_action('edited_term', array(&$this, 'save_term'), 10, 3);
41
+
42
  // ajax response for edit term form
43
  add_action('wp_ajax_term_lang_choice', array(&$this,'term_lang_choice'));
44
 
71
  add_filter('manage_edit-'.$tax.'_columns', array(&$this, 'add_term_column'));
72
  add_action('manage_'.$tax.'_custom_column', array(&$this, 'term_column'), 10, 3);
73
 
74
+ // adds action related to languages when deleting categories and post tags
 
 
75
  add_action('delete_'.$tax, array(&$this, 'delete_term'));
76
  }
77
  }
78
 
79
+ // setup js scripts & css styles
80
+ function admin_enqueue_scripts() {
81
+ wp_enqueue_script('polylang_admin', POLYLANG_URL .'/js/admin.js');
82
+ wp_enqueue_style('polylang_admin', POLYLANG_URL .'/css/admin.css');
83
+
84
+ // style languages columns in edit and edit-tags
85
+ foreach ($this->get_languages_list() as $language)
86
+ $classes[] = '.column-language_'.esc_attr($language->slug);
87
+
88
+ if (isset($classes))
89
+ echo '<style type="text/css">'.implode(',', $classes).' { width: 24px; }</style>';
90
  }
91
 
92
+ // adds the language and translations columns (before the date column) in the posts and pages list table
93
  function add_post_column($columns, $post_type ='') {
94
  if ($post_type == '' || get_post_type_object($post_type)->show_ui) {
95
  foreach (array( 'date', 'comments' ) as $k) {
97
  $end[$k] = array_pop($columns);
98
  }
99
 
100
+ foreach ($this->get_languages_list() as $language)
101
+ $columns['language_'.$language->slug] = ($flag = $this->get_flag($language)) ? $flag : esc_html($language->slug);
102
 
103
  if (isset($end))
104
  $columns = array_merge($columns, $end);
106
  return $columns;
107
  }
108
 
109
+ // fills the language and translations columns in the posts table
110
  function post_column($column, $post_id) {
111
+ if (false === strpos($column, 'language_') || !$this->get_post_language($post_id))
112
+ return;
113
+
114
+ global $post_type;
115
+ $language = $this->get_language(substr($column, 9));
116
+
117
+ // link to edit post (or a translation)
118
+ if ($id = $this->get_post($post_id, $language))
119
+ printf('<a title="%1$s" href="%2$s"><img src="%3$s"></a>',
120
+ esc_attr(get_post($id)->post_title),
121
+ esc_url(get_edit_post_link($id, true )),
122
+ esc_url(POLYLANG_URL.'/img/edit.png')
123
+ );
124
+
125
+ // link to add a new translation
126
+ else
127
+ printf('<a title="%1$s" href="%2$s"><img src="%3$s"></a>',
128
+ __('Add new translation', 'polylang'),
129
+ esc_url(admin_url('post-new.php?post_type=' . $post_type . '&from_post=' . $post_id . '&new_lang=' . $language->slug)),
130
+ esc_url(POLYLANG_URL.'/img/add.png')
131
+ );
132
  }
133
 
134
  // converts language term_id to slug in $query
197
  $x = new WP_Ajax_Response(array('what' => 'translations', 'data' => ob_get_contents()));
198
  ob_end_clean();
199
 
200
+ // categories
201
  if (isset($_POST['taxonomies'])) {
202
  // not set for pages
203
  foreach ($_POST['taxonomies'] as $taxname) {
226
  }
227
  }
228
 
229
+ // parent dropdown list (only for hierarchical post types)
230
+ // $dropdown_args copied from page_attributes_meta_box
231
+ if (in_array($post_type, get_post_types(array('hierarchical' => true)))) {
232
+ $post = get_post($post_ID);
233
+ $dropdown_args = array(
234
+ 'post_type' => $post->post_type,
235
+ 'exclude_tree' => $post->ID,
236
+ 'selected' => $post->post_parent,
237
+ 'name' => 'parent_id',
238
+ 'show_option_none' => __('(no parent)'),
239
+ 'sort_column' => 'menu_order, post_title',
240
+ 'echo' => 0,
241
+ );
242
+ $dropdown_args = apply_filters('page_attributes_dropdown_pages_args', $dropdown_args, $post);
243
+ $x->Add(array('what' => 'pages', 'data' => wp_dropdown_pages($dropdown_args)));
244
+ }
245
+
246
  $x->send();
247
  }
248
 
249
+ // filters the pages by language in the parent dropdown list in the page attributes metabox
250
+ function page_attributes_dropdown_pages_args($dropdown_args, $post) {
251
+ $lang = isset($_POST['lang']) ? $this->get_language($_POST['lang']) : $this->get_post_language($post->ID); // ajax or not ?
252
+ $pages = implode(',', $this->exclude_pages($lang));
253
+ $dropdown_args['exclude'] = isset($dropdown_args['exclude']) ? $dropdown_args['exclude'].','.$pages : $pages;
254
+ return $dropdown_args;
255
+ }
256
+
257
+ // translate post parent if exists when using "Add new" (translation)
258
+ function wp_insert_post_parent($post_parent, $post_ID, $keys, $postarr) {
259
+ if (isset($_GET['from_post']) && isset($_GET['new_lang']) && $id = wp_get_post_parent_id($_GET['from_post']))
260
+ if ($post_parent = $this->get_translation('post', $id, $_GET['new_lang']))
261
+ return $post_parent;
262
 
263
+ return $post_parent;
264
+ }
 
265
 
266
+ // copy page template and menu order if exist when using "Add new" (translation)
267
+ // the hook was probably not intended for that but did not find a better one
268
+ // copy the meta '_wp_page_template' in save_post is not sufficient (the dropdown list in the metabox is not updated)
269
+ // We need to set $post->page_template (ans so need to wait for the availability of $post)
270
+ function dbx_post_advanced() {
271
+ if (isset($_GET['from_post']) && isset($_GET['new_lang'])) {
272
+ global $post;
273
+ $post->menu_order = get_post($_GET['from_post'])->menu_order;
274
+ $post->page_template = get_post_meta($_GET['from_post'], '_wp_page_template', true);
275
  }
276
  }
277
 
284
  if ($id = wp_is_post_revision($post_id))
285
  $post_id = $id;
286
 
287
+ // the hook is called when the post is created
288
+ // let's use it to initialize some things when using "Add new" (translation)
289
+ if (isset($_GET['from_post']) && isset($_GET['new_lang'])) {
290
+
291
+ // translate terms if exist
292
+ foreach (get_taxonomies(array('show_ui'=>true)) as $tax) {
293
+ $newterms = array();
294
+ $terms = get_the_terms($_GET['from_post'], $tax);
295
+ if (is_array($terms)) {
296
+ foreach ($terms as $term) {
297
+ if ($id = $this->get_translation('term', $term->term_id, $_GET['new_lang']))
298
+ $newterms[] = (int) $id; // cast is important otherwise we get 'numeric' tags
299
+ }
300
+ }
301
+ if (!empty($newterms))
302
+ wp_set_object_terms($post_id, $newterms, $tax);
303
+ }
304
+
305
+ // copy metas and allow plugins to do the same
306
+ $metas = apply_filters('pll_copy_post_metas', array('_wp_page_template', '_thumbnail_id'));
307
+ foreach ($metas as $meta) {
308
+ if ($value = get_post_meta($_GET['from_post'], $meta, true))
309
+ update_post_meta($post_id, $meta, $value);
310
+ }
311
+ }
312
+
313
+ if (!isset($_POST['post_lang_choice']))
314
+ return;
315
 
316
+ // save language and translations
317
+ $this->set_post_language($post_id, $_POST['post_lang_choice']);
318
+ $this->save_translations('post', $post_id, $_POST['post_tr_lang']);
319
+
320
+ // synchronise terms and metas in translations
321
+ foreach ($_POST['post_tr_lang'] as $lang=>$tr_id) {
322
+ if (!$tr_id)
323
+ continue;
324
+
325
+ // terms
326
+ foreach (get_taxonomies(array('show_ui'=>true)) as $tax) {
327
+ $newterms = array();
328
+ $terms = get_the_terms($post_id, $tax);
329
+ if (is_array($terms)) {
330
+ foreach ($terms as $term) {
331
+ if ($term_id = $this->get_translation('term', $term->term_id, $lang))
332
+ $newterms[] = (int) $term_id; // cast is important otherwise we get 'numeric' tags
333
+ }
334
+ }
335
+ // for some reasons, the user may have untranslated terms in the translation. don't forget them.
336
+ $tr_terms = get_the_terms($tr_id, $tax);
337
+ if (is_array($tr_terms)) {
338
+ foreach ($tr_terms as $term) {
339
+ if (!$this->get_translation('term', $term->term_id, $_POST['post_lang_choice']))
340
+ $newterms[] = (int) $term->term_id;
341
+ }
342
+ }
343
+ wp_set_object_terms($tr_id, $newterms, $tax); // replace terms in translation
344
+ }
345
+
346
+ // copy metas and allow plugins to do the same
347
+ $metas = apply_filters('pll_copy_metas', array('_wp_page_template', '_thumbnail_id'));
348
+ foreach ($metas as $meta) {
349
+ if ($value = get_post_meta($_GET['from_post'], $meta, true))
350
+ update_post_meta($tr_id, $meta, get_post_meta($post_id, $meta, true));
351
+ else
352
+ delete_post_meta($tr_id, $meta);
353
+ }
354
+
355
+ // post parent
356
+ if ($parent_id = wp_get_post_parent_id($post_id));
357
+ $post_parent = $this->get_translation('post', $parent_id, $lang);
358
+
359
+ global $wpdb;
360
+ $wpdb->update($wpdb->posts, array('post_parent'=> isset($post_parent) ? $post_parent : 0), array( 'ID' => $tr_id ));
361
+ }
362
  }
363
 
364
  // called when a post (or page) is deleted
373
  function terms_clauses($clauses, $taxonomies, $args) {
374
  // does nothing except on taxonomies which have show_ui set to 1 (includes category and post_tags)
375
  foreach ($taxonomies as $tax) {
376
+ if (!get_taxonomy($tax)->show_ui)
377
  return $clauses;
378
  }
379
 
389
  // *FIXME I want all categories in the dropdown list and only the ones in the right language in the inline edit
390
  // It seems that I need javascript to get the post_id as inline edit data are manipulated in inline-edit-post.js
391
 
392
+ // The only ajax response I want to deal with is when changing the language in post metabox
393
+ if (isset($_POST['action']) && $_POST['action'] != 'post_lang_choice')
394
+ return $clauses;
395
+
396
  global $post_ID;
397
  $options = get_option('polylang');
398
 
451
  if (array_key_exists('posts', $columns))
452
  $end = array_pop($columns);
453
 
454
+ foreach ($this->get_languages_list() as $language)
455
+ $columns['language_'.$language->slug] = ($flag = $this->get_flag($language)) ? $flag : esc_html($language->slug);
456
 
457
  if (isset($end))
458
  $columns['posts'] = $end;
462
 
463
  // fills the language column in the 'Categories' or Post Tags table
464
  function term_column($empty, $column, $term_id) {
465
+ if (false === strpos($column, 'language_') || !$this->get_term_language($term_id))
466
+ return;
467
+
468
+ global $post_type, $taxonomy;
469
+ $language = $this->get_language(substr($column, 9));
470
+
471
+ // link to edit term (or a translation)
472
+ if ($id = $this->get_term($term_id, $language))
473
+ printf('<a title="%1$s" href="%2$s"><img src="%3$s"></a>',
474
+ esc_attr(get_term($id, $taxonomy)->name),
475
+ esc_url(get_edit_term_link($id, $taxonomy, $post_type)),
476
+ esc_url(POLYLANG_URL.'/img/edit.png')
477
+ );
478
+
479
+ // link to add a new translation
480
+ else
481
+ printf('<a title="%1$s" href="%2$s"><img src="%3$s"></a>',
482
+ __('Add new translation', 'polylang'),
483
+ esc_url(admin_url(sprintf('edit-tags.php?taxonomy=%1$s&from_tag=%2$d&new_lang=%3$s', $taxonomy, $term_id, $language->slug))),
484
+ esc_url(POLYLANG_URL.'/img/add.png')
485
+ );
486
  }
487
 
488
  // called when a category or post tag is created or edited
489
+ function save_term($term_id, $tt_id, $taxonomy) {
490
+ // does nothing except on taxonomies which have show_ui set to 1 (includes category and post_tags)
491
+ if (!get_taxonomy($taxonomy)->show_ui)
492
+ return;
493
+
494
  // avoids breaking translations when using inline edit
495
+ if (isset($_POST['_inline_edit']))
496
  return;
497
 
498
  if (isset($_POST['term_lang_choice']) && $_POST['term_lang_choice'])
499
+ $this->set_term_language($term_id, $_POST['term_lang_choice']);
500
  else
501
  $this->delete_term_language($term_id);
502
 
503
+ if (!isset($_POST['term_tr_lang']))
504
+ return;
505
+
506
+ foreach ($_POST['term_tr_lang'] as $key=>$tr_id)
507
+ $translations[$key] = (int) $tr_id;
508
+
509
+ $this->save_translations('term', $term_id, $translations);
510
+
511
+ // synchronize translations of this term in all posts
512
+
513
+ // get all posts associated to this term
514
+ $posts = get_posts(array(
515
+ 'numberposts'=>-1,
516
+ 'post_type' => 'any',
517
+ 'post_status'=>'any',
518
+ 'fields' => 'ids',
519
+ 'tax_query' => array(array(
520
+ 'taxonomy'=> $taxonomy,
521
+ 'field' => 'id',
522
+ 'terms'=> array($term_id)+array_values($translations),
523
+ ))
524
+ ));
525
+
526
+ // associate translated term to translated post
527
+ foreach ($this->get_languages_list() as $language) {
528
+ if ($translated_term = $this->get_term($term_id, $language)) {
529
+ foreach ($posts as $post_id) {
530
+ if ($translated_post = $this->get_post($post_id, $language))
531
+ wp_set_object_terms($translated_post, $translated_term, $taxonomy, true);
532
+ }
533
+ }
534
+ }
535
  }
536
 
537
  // called when a category or post tag is deleted
include/admin.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- require_once(PLL_INC.'/list-table.php');
4
  require_once(PLL_INC.'/admin-filters.php');
 
5
 
6
  // setups the Polylang admin panel and calls for other admin related classes
7
  class Polylang_Admin extends Polylang_Base {
@@ -14,6 +14,10 @@ class Polylang_Admin extends Polylang_Base {
14
 
15
  // adds the link to the languages panel in the wordpress admin menu
16
  add_action('admin_menu', array(&$this, 'add_menus'));
 
 
 
 
17
  }
18
 
19
  // adds a 'settings' link in the plugins table
@@ -57,15 +61,16 @@ class Polylang_Admin extends Polylang_Base {
57
  function languages_page() {
58
  global $wp_rewrite;
59
  $options = get_option('polylang');
60
-
61
  $listlanguages = $this->get_languages_list();
62
- $list_table = new Polylang_List_Table();
63
 
64
  // for nav menus form
65
  $locations = get_registered_nav_menus();
66
  $menus = wp_get_nav_menus();
67
  $menu_lang = get_option('polylang_nav_menus');
68
 
 
 
 
69
  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
70
 
71
  switch ($action) {
@@ -74,13 +79,15 @@ class Polylang_Admin extends Polylang_Base {
74
  $error = $this->validate_lang();
75
 
76
  if ($error == 0) {
77
- wp_insert_term($_POST['name'],'language',array('slug'=>$_POST['slug'], 'description'=>$_POST['description']));
78
  $wp_rewrite->flush_rules(); // refresh rewrite rules
79
 
80
  if (!isset($options['default_lang'])) { // if this is the first language created, set it as default language
81
  $options['default_lang'] = $_POST['slug'];
82
  update_option('polylang', $options);
83
  }
 
 
84
  }
85
 
86
  wp_redirect('admin.php?page=mlang'. ($error ? '&error='.$error : '') ); // to refresh the page (possible thanks to the $_GET['noheader']=true)
@@ -102,16 +109,28 @@ class Polylang_Admin extends Polylang_Base {
102
  // update the language slug in categories & post tags meta
103
  $terms= get_terms(get_taxonomies(array('show_ui'=>true)), array('get'=>'all', 'fields'=>'ids'));
104
  $this->delete_translations('term', $terms, $lang_slug);
105
-
106
- foreach ($terms as $id)
107
- $this->delete_term_language($id); // delete language of this term
 
 
 
108
 
109
  // delete menus locations
110
- foreach ($locations as $location => $description) {
111
  unset($menu_lang[$location][$lang_slug]);
112
- }
113
  update_option('polylang_nav_menus', $menu_lang);
114
 
 
 
 
 
 
 
 
 
 
 
115
  // delete the language itself
116
  wp_delete_term($lang_id, 'language');
117
  $wp_rewrite->flush_rules(); // refresh rewrite rules
@@ -162,6 +181,13 @@ class Polylang_Admin extends Polylang_Base {
162
  }
163
  update_option('polylang_nav_menus', $menu_lang);
164
 
 
 
 
 
 
 
 
165
  // update the default language option if necessary
166
  if ($options['default_lang'] == $old_slug) {
167
  $options['default_lang'] = $_POST['slug'];
@@ -170,7 +196,8 @@ class Polylang_Admin extends Polylang_Base {
170
  }
171
 
172
  // and finally update the language itself
173
- wp_update_term($lang_id, 'language', array('name'=>$_POST['name'], 'slug'=>$_POST['slug'], 'description'=>$_POST['description']));
 
174
  $wp_rewrite->flush_rules(); // refresh rewrite rules
175
  }
176
 
@@ -189,6 +216,24 @@ class Polylang_Admin extends Polylang_Base {
189
  update_option('polylang_nav_menus', $menu_lang);
190
  break;
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  case 'options':
193
  check_admin_referer( 'options-lang', '_wpnonce_options-lang' );
194
 
@@ -206,12 +251,12 @@ class Polylang_Admin extends Polylang_Base {
206
  if (isset($_POST['fill_languages'])) {
207
  if(isset($_POST['posts'])) {
208
  foreach(explode(',', $_POST['posts']) as $post_id) {
209
- wp_set_post_terms($post_id, $options['default_lang'], 'language' );
210
  }
211
  }
212
  if(isset($_POST['terms'])) {
213
  foreach(explode(',', $_POST['terms']) as $term_id) {
214
- $this->update_term_language($term_id, $this->get_language($options['default_lang']));
215
  }
216
  }
217
  }
@@ -225,10 +270,11 @@ class Polylang_Admin extends Polylang_Base {
225
  $tabs = array(
226
  'lang' => __('Languages','polylang'),
227
  'menus' => __('Menus','polylang'),
 
228
  'settings' => __('Settings', 'polylang')
229
  );
230
  if (!current_theme_supports( 'menus' ))
231
- unset($tabs['menus']); // don't display the menu tab if the active them does not support nav menus
232
 
233
  $active_tab = isset($_GET['tab']) && $_GET['tab'] ? $_GET['tab'] : 'lang';
234
 
@@ -239,12 +285,15 @@ class Polylang_Admin extends Polylang_Base {
239
  foreach ($listlanguages as $lang)
240
  $data[] = array_merge( (array) $lang, array('flag' => $this->get_flag($lang)) ) ;
241
 
 
242
  $list_table->prepare_items($data);
243
 
 
244
  $errors[1] = __('Enter a valid WorPress locale', 'polylang');
245
  $errors[2] = __('The language code must be 2 characters long', 'polylang');
246
  $errors[3] = __('The language code must be unique', 'polylang');
247
  $errors[4] = __('The language must have a name', 'polylang');
 
248
  break;
249
 
250
  case 'menus':
@@ -263,6 +312,49 @@ class Polylang_Admin extends Polylang_Base {
263
 
264
  break;
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  case 'settings':
267
  //FIXME rework this as it would not be efficient in case of thousands posts or terms !
268
  // detects posts & pages without language set
@@ -318,6 +410,74 @@ class Polylang_Admin extends Polylang_Base {
318
  return isset($error) ? $error : 0;
319
  }
320
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  } // class Polylang_Admin
322
 
323
  ?>
1
  <?php
2
 
 
3
  require_once(PLL_INC.'/admin-filters.php');
4
+ require_once(PLL_INC.'/list-table.php');
5
 
6
  // setups the Polylang admin panel and calls for other admin related classes
7
  class Polylang_Admin extends Polylang_Base {
14
 
15
  // adds the link to the languages panel in the wordpress admin menu
16
  add_action('admin_menu', array(&$this, 'add_menus'));
17
+
18
+ // ugrades languages files after a core upgrade (timing is important)
19
+ // FIXME private action ? is there a better way to do this ?
20
+ add_action( '_core_updated_successfully', array(&$this, 'upgrade_languages'), 1); // since WP 3.3
21
  }
22
 
23
  // adds a 'settings' link in the plugins table
61
  function languages_page() {
62
  global $wp_rewrite;
63
  $options = get_option('polylang');
 
64
  $listlanguages = $this->get_languages_list();
 
65
 
66
  // for nav menus form
67
  $locations = get_registered_nav_menus();
68
  $menus = wp_get_nav_menus();
69
  $menu_lang = get_option('polylang_nav_menus');
70
 
71
+ // for widgets
72
+ $widget_lang = get_option('polylang_widgets');
73
+
74
  $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
75
 
76
  switch ($action) {
79
  $error = $this->validate_lang();
80
 
81
  if ($error == 0) {
82
+ wp_insert_term($_POST['name'],'language',array('slug'=>$_POST['slug'], 'description'=>$_POST['description'], 'term_group'=>$_POST['term_group']));
83
  $wp_rewrite->flush_rules(); // refresh rewrite rules
84
 
85
  if (!isset($options['default_lang'])) { // if this is the first language created, set it as default language
86
  $options['default_lang'] = $_POST['slug'];
87
  update_option('polylang', $options);
88
  }
89
+ if (!$this->download_mo($_POST['description']))
90
+ $error = 5;
91
  }
92
 
93
  wp_redirect('admin.php?page=mlang'. ($error ? '&error='.$error : '') ); // to refresh the page (possible thanks to the $_GET['noheader']=true)
109
  // update the language slug in categories & post tags meta
110
  $terms= get_terms(get_taxonomies(array('show_ui'=>true)), array('get'=>'all', 'fields'=>'ids'));
111
  $this->delete_translations('term', $terms, $lang_slug);
112
+
113
+ // FIXME should find something more efficient (with a sql query ?)
114
+ foreach ($terms as $id) {
115
+ if ($this->get_term_language($id)->term_id == $lang_id)
116
+ $this->delete_term_language($id); // delete language of this term
117
+ }
118
 
119
  // delete menus locations
120
+ foreach ($locations as $location => $description)
121
  unset($menu_lang[$location][$lang_slug]);
 
122
  update_option('polylang_nav_menus', $menu_lang);
123
 
124
+ // delete language option in widgets
125
+ foreach ($widget_lang as $key=>$lang) {
126
+ if ($lang == $lang_slug)
127
+ unset ($widget_lang[$key]);
128
+ }
129
+ update_option('polylang_widgets', $widget_lang);
130
+
131
+ // delete the string translations
132
+ delete_option('polylang_mo'.$lang_id);
133
+
134
  // delete the language itself
135
  wp_delete_term($lang_id, 'language');
136
  $wp_rewrite->flush_rules(); // refresh rewrite rules
181
  }
182
  update_option('polylang_nav_menus', $menu_lang);
183
 
184
+ // update language option in widgets
185
+ foreach ($widget_lang as $key=>$lang) {
186
+ if ($lang == $old_slug)
187
+ $widget_lang[$key] = $_POST['slug'];
188
+ }
189
+ update_option('polylang_widgets', $widget_lang);
190
+
191
  // update the default language option if necessary
192
  if ($options['default_lang'] == $old_slug) {
193
  $options['default_lang'] = $_POST['slug'];
196
  }
197
 
198
  // and finally update the language itself
199
+ $args = array('name'=>$_POST['name'], 'slug'=>$_POST['slug'], 'description'=>$_POST['description'], 'term_group'=>$_POST['term_group']);
200
+ wp_update_term($lang_id, 'language', $args);
201
  $wp_rewrite->flush_rules(); // refresh rewrite rules
202
  }
203
 
216
  update_option('polylang_nav_menus', $menu_lang);
217
  break;
218
 
219
+ case 'string-translation':
220
+ check_admin_referer( 'string-translation', '_wpnonce_string-translation' );
221
+
222
+ $mo = new MO();
223
+ foreach ($listlanguages as $language) {
224
+ $reader = new POMO_StringReader(base64_decode(get_option('polylang_mo'.$language->term_id)));
225
+ $mo->import_from_reader($reader);
226
+
227
+ foreach ($_POST['string'] as $key=>$string) {
228
+ $string = stripslashes($string);
229
+ $mo->add_entry($mo->make_entry($string, stripslashes($_POST['translation'][$language->name][$key])));
230
+ }
231
+ // FIXME should I clean the mo object to remove unused strings ?
232
+ // use base64_encode to store binary mo data in database text field
233
+ update_option('polylang_mo'.$language->term_id, base64_encode($mo->export()));
234
+ }
235
+ break;
236
+
237
  case 'options':
238
  check_admin_referer( 'options-lang', '_wpnonce_options-lang' );
239
 
251
  if (isset($_POST['fill_languages'])) {
252
  if(isset($_POST['posts'])) {
253
  foreach(explode(',', $_POST['posts']) as $post_id) {
254
+ $this->set_post_language($post_id, $options['default_lang']);
255
  }
256
  }
257
  if(isset($_POST['terms'])) {
258
  foreach(explode(',', $_POST['terms']) as $term_id) {
259
+ $this->set_term_language($term_id, $options['default_lang']);
260
  }
261
  }
262
  }
270
  $tabs = array(
271
  'lang' => __('Languages','polylang'),
272
  'menus' => __('Menus','polylang'),
273
+ 'strings' => __('Strings translation','polylang'),
274
  'settings' => __('Settings', 'polylang')
275
  );
276
  if (!current_theme_supports( 'menus' ))
277
+ unset($tabs['menus']); // don't display the menu tab if the active theme does not support nav menus
278
 
279
  $active_tab = isset($_GET['tab']) && $_GET['tab'] ? $_GET['tab'] : 'lang';
280
 
285
  foreach ($listlanguages as $lang)
286
  $data[] = array_merge( (array) $lang, array('flag' => $this->get_flag($lang)) ) ;
287
 
288
+ $list_table = new Polylang_List_Table();
289
  $list_table->prepare_items($data);
290
 
291
+ // error messages for data validation
292
  $errors[1] = __('Enter a valid WorPress locale', 'polylang');
293
  $errors[2] = __('The language code must be 2 characters long', 'polylang');
294
  $errors[3] = __('The language code must be unique', 'polylang');
295
  $errors[4] = __('The language must have a name', 'polylang');
296
+ $errors[5] = __('The language was created, but the WordPress language file was not downloaded. Please install it manually.', 'polylang');
297
  break;
298
 
299
  case 'menus':
312
 
313
  break;
314
 
315
+ case 'strings':
316
+ global $wp_registered_widgets;
317
+
318
+ // WP strings
319
+ $this->register_string(__('Site Title'), get_option('blogname'));
320
+ $this->register_string(__('Tagline'), get_option('blogdescription'));
321
+
322
+ // widgets titles
323
+ $sidebars = wp_get_sidebars_widgets();
324
+ foreach ($sidebars as $sidebar => $widgets) {
325
+ if ($sidebar == 'wp_inactive_widgets')
326
+ continue;
327
+
328
+ foreach ($widgets as $widget) {
329
+ if (!isset($wp_registered_widgets[$widget]))
330
+ continue;
331
+
332
+ $widget_settings = $wp_registered_widgets[$widget]['callback'][0]->get_settings();
333
+ $number = $wp_registered_widgets[$widget]['params'][0]['number'];
334
+ $title = $widget_settings[$number]['title'];
335
+ if(isset($title) && $title)
336
+ $this->register_string(__('Widget title'), $title);
337
+ }
338
+ }
339
+
340
+ $data = &$this->strings;
341
+
342
+ // load translations
343
+ $mo = new MO();
344
+ foreach ($listlanguages as $language) {
345
+ $reader = new POMO_StringReader(base64_decode(get_option('polylang_mo'.$language->term_id)));
346
+ $mo->import_from_reader($reader);
347
+
348
+ foreach ($data as $key=>$row) {
349
+ $data[$key]['translations'][$language->name] = $mo->translate($data[$key]['string']);
350
+ $data[$key]['row'] = $key; // store the row number for convenience
351
+ }
352
+ }
353
+
354
+ $string_table = new Polylang_String_Table();
355
+ $string_table->prepare_items($data);
356
+ break;
357
+
358
  case 'settings':
359
  //FIXME rework this as it would not be efficient in case of thousands posts or terms !
360
  // detects posts & pages without language set
410
  return isset($error) ? $error : 0;
411
  }
412
 
413
+ // downloads mofiles
414
+ function download_mo($locale, $upgrade = false) {
415
+ global $wp_version;
416
+ $mofile = WP_LANG_DIR."/$locale.mo";
417
+
418
+ // does file exists ?
419
+ if ((file_exists($mofile) && !$upgrade) || $locale == 'en_US')
420
+ return true;
421
+
422
+ // does language directory exists ?
423
+ if(!is_dir(WP_LANG_DIR)) {
424
+ if(!@mkdir(WP_LANG_DIR))
425
+ return false;
426
+ }
427
+
428
+ // will first look in tags/ (most languages) then in branches/ (only Greek ?)
429
+ $base = 'http://svn.automattic.com/wordpress-i18n/'.$locale;
430
+ $bases = array($base.'/tags/', $base.'/branches/');
431
+
432
+ foreach ($bases as $base) {
433
+ // get all the versions available in the subdirectory
434
+ $resp = wp_remote_get($base);
435
+ if (is_wp_error($resp) || 200 != $resp['response']['code'])
436
+ continue;
437
+
438
+ preg_match_all('#>([0-9\.]+)\/#', $resp['body'], $matches);
439
+ if (empty($matches[1]))
440
+ continue;
441
+
442
+ rsort($matches[1]);
443
+ $versions = $matches[1];
444
+
445
+ $newest = $upgrade ? $upgrade : $wp_version;
446
+ foreach ($versions as $key=>$version) {
447
+ // will not try to download a too recent mofile
448
+ if (version_compare($version, $newest, '>'))
449
+ unset($versions[$key]);
450
+ // will not download an older version if we are upgrading
451
+ if ($upgrade && version_compare($version, $wp_version, '<='))
452
+ unset($versions[$key]);
453
+ }
454
+
455
+ $versions = array_splice($versions, 0, 5); // reduce the number of versions to test to 5
456
+
457
+ // try to download the file
458
+ foreach ($versions as $version) {
459
+ $resp = wp_remote_get($base."$version/messages/$locale.mo", array('timeout' => 30, 'stream' => true, 'filename' => $mofile));
460
+ if (is_wp_error($resp) || 200 != $resp['response']['code'])
461
+ continue;
462
+
463
+ // try to download ms and continents-cities files if exist (will not return false if failed)
464
+ foreach (array("ms-$locale.mo", "continent-cities-$locale.mo") as $file)
465
+ wp_remote_get($base."$version/messages/$file", array('timeout' => 30, 'stream' => true, 'filename' => WP_LANG_DIR."/$file"));
466
+
467
+ return true;
468
+ }
469
+ }
470
+ // we did not succeeded to download a file :(
471
+ return false;
472
+ }
473
+
474
+ // ugrades languages files after a core upgrade
475
+ function upgrade_languages($version) {
476
+ apply_filters('update_feedback', __('Upgrading language files&#8230;', 'polylang'));
477
+ foreach ($this->get_languages_list() as $language)
478
+ $this->download_mo($language->description, $version);
479
+ }
480
+
481
  } // class Polylang_Admin
482
 
483
  ?>
include/api.php CHANGED
@@ -24,4 +24,20 @@ function pll_is_front_page() {
24
  return isset($polylang) ? $polylang->is_front_page() : null;
25
  }
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  ?>
24
  return isset($polylang) ? $polylang->is_front_page() : null;
25
  }
26
 
27
+ // register strings for translation in the "strings translation" panel
28
+ function pll_register_string($name, $string) {
29
+ global $polylang;
30
+ if ($polylang)
31
+ $polylang->register_string($name, $string);
32
+ }
33
+
34
+ // translates string (previously registered with pll_register_string)
35
+ function pll__($string) {
36
+ return __($string, 'pll_string');
37
+ }
38
+
39
+ // echoes translated string (previously registered with pll_register_string)
40
+ function pll_e($string) {
41
+ _e($string, 'pll_string');
42
+ }
43
  ?>
include/base.php CHANGED
@@ -1,15 +1,16 @@
1
  <?php
2
 
3
- // setups basic functions
4
  abstract class Polylang_Base {
5
-
 
6
  // returns the query variables of the referer
7
  function get_referer_vars() {
8
  $qvars = array();
9
  $referer = wp_get_referer();
10
  if ($referer) {
11
  $urlparts = parse_url($referer);
12
- if (isset($urlparts['query'])) {
13
  parse_str($urlparts['query'], $qvars);
14
  }
15
  }
@@ -18,19 +19,40 @@ abstract class Polylang_Base {
18
 
19
  // returns the list of available languages
20
  function get_languages_list($hide_empty = false) {
21
- return get_terms('language', array('hide_empty'=>$hide_empty));
22
  }
23
 
24
  // returns the language by its id or its slug
25
- // Note: it seems that the first option is better for performance (3.2.1)
26
  function get_language($value) {
27
- if (is_numeric($value))
28
- return get_term($value, 'language');
 
 
29
  elseif (is_string($value))
30
  return get_term_by('slug', $value , 'language'); // seems it is not cached in 3.2.1
31
  return null;
32
  }
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  // deletes a translation of a post or term
35
  function delete_translation($type, $id) {
36
  $translations = unserialize(get_metadata($type, $id, '_translations', true));
@@ -39,16 +61,24 @@ abstract class Polylang_Base {
39
  unset($translations[$slug]);
40
  $tr = serialize($translations);
41
  foreach($translations as $key=>$p)
42
- update_metadata($type, $p, '_translations', $tr);
43
  delete_metadata($type, $id, '_translations');
44
  }
45
  }
46
 
47
  // returns the id of the translation of a post or term
 
 
 
48
  function get_translation($type, $id, $lang) {
49
  $translations = unserialize(get_metadata($type, $id, '_translations', true));
50
- $slug = is_string($lang) ? $lang : $lang->slug;
51
- return isset($translations[$slug]) ? $translations[$slug] : '';
 
 
 
 
 
52
  }
53
 
54
  // returns the language of a post
@@ -59,21 +89,16 @@ abstract class Polylang_Base {
59
 
60
  // among the post and its translations, returns the id of the post which is in $lang
61
  function get_post($post_id, $lang) {
62
- $slug = is_string($lang) ? $lang : $lang->slug;
63
- return $this->get_post_language($post_id)->slug == $slug ? $post_id : $this->get_translation('post', $post_id, $lang);
64
  }
65
 
66
- function update_term_language($term_id, $lang) {
67
- if (is_numeric($lang))
68
- $lang_id = $lang;
69
- elseif(is_string($lang))
70
- $lang_id = $this->get_language($lang)->term_id;
71
- else
72
- $lang_id = $lang->term_id;
73
-
74
- update_metadata('term', $term_id, '_language', $lang_id );
75
  }
76
 
 
77
  function delete_term_language($term_id) {
78
  delete_metadata('term', $term_id, '_language');
79
  }
@@ -89,30 +114,57 @@ abstract class Polylang_Base {
89
 
90
  // among the term and its translations, returns the id of the term which is in $lang
91
  function get_term($term_id, $lang) {
92
- $slug = is_string($lang) ? $lang : $lang->slug;
93
- return $this->get_term_language($term_id)->slug == $slug ? $term_id : $this->get_translation('term', $term_id, $lang);
94
  }
95
 
96
  // returns the html link to the flag if exists
 
97
  function get_flag($lang) {
98
- return ( !is_admin() && ( // never use local flags on admin side
99
- file_exists(POLYLANG_DIR.($file = '/local_flags/'.$lang->description.'.png')) ||
100
- file_exists(POLYLANG_DIR.($file = '/local_flags/'.$lang->description.'.jpg')) )) ||
101
- file_exists(POLYLANG_DIR.($file = '/flags/'.$lang->description.'.png')) ?
102
- '<img src="'.esc_url(WP_PLUGIN_URL.'/polylang'.$file).'" alt="'.esc_attr($lang->name).'" />' : '';
 
 
 
 
 
103
  }
104
 
105
  // adds terms clauses to get_terms - used in both frontend and admin
106
  function _terms_clauses($clauses, $lang, $display_all = false) {
107
  global $wpdb;
108
  if (isset($lang) && !is_wp_error($lang)) {
109
- $clauses['join'] .= " LEFT JOIN $wpdb->termmeta AS tm ON t.term_id = tm.term_id";
110
  $where_lang = $wpdb->prepare("tm.meta_key = '_language' AND tm.meta_value = %d", $lang->term_id); // add terms in the right language
111
- $where_all = "t.term_id NOT IN (SELECT term_id FROM $wpdb->termmeta WHERE meta_key IN ('_language'))"; // add terms with no language set
112
- $clauses['where'] .= $display_all ? " AND (($where_lang) OR ($where_all))" : " AND $where_lang";
113
  }
114
  return $clauses;
115
  }
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  } //class Polylang_Base
118
  ?>
1
  <?php
2
 
3
+ // setups basic functions used for admin and frontend
4
  abstract class Polylang_Base {
5
+ var $strings; // strings to translate
6
+
7
  // returns the query variables of the referer
8
  function get_referer_vars() {
9
  $qvars = array();
10
  $referer = wp_get_referer();
11
  if ($referer) {
12
  $urlparts = parse_url($referer);
13
+ if (isset($urlparts['query'])) {
14
  parse_str($urlparts['query'], $qvars);
15
  }
16
  }
19
 
20
  // returns the list of available languages
21
  function get_languages_list($hide_empty = false) {
22
+ return get_terms('language', array('hide_empty'=>$hide_empty, 'orderby'=>'term_group' ));
23
  }
24
 
25
  // returns the language by its id or its slug
26
+ // Note: it seems that a numeric value is better for performance (3.2.1)
27
  function get_language($value) {
28
+ if (is_object($value))
29
+ return $value;
30
+ if (is_numeric($value) || (int) $value)
31
+ return get_term((int) $value, 'language');
32
  elseif (is_string($value))
33
  return get_term_by('slug', $value , 'language'); // seems it is not cached in 3.2.1
34
  return null;
35
  }
36
 
37
+ // saves translations for posts or terms
38
+ // the underscore in '_lang' hides the post meta in the Custom Fields metabox in the Edit Post screen
39
+ // $type: either 'post' or 'term'
40
+ // $id: post id or term id
41
+ // $translations: an associative array of translations with language code as key and translation id as value
42
+ function save_translations($type, $id, $translations) {
43
+ $lang = call_user_func(array(&$this, 'get_'.$type.'_language'), $id);
44
+ if (!$lang)
45
+ return;
46
+
47
+ if (isset($translations) && is_array($translations)) {
48
+ $tr = serialize(array_merge(array($lang->slug => $id), $translations));
49
+ update_metadata($type, $id, '_translations', $tr);
50
+
51
+ foreach($translations as $key=>$p)
52
+ update_metadata($type, (int) $p, '_translations', $tr);
53
+ }
54
+ }
55
+
56
  // deletes a translation of a post or term
57
  function delete_translation($type, $id) {
58
  $translations = unserialize(get_metadata($type, $id, '_translations', true));
61
  unset($translations[$slug]);
62
  $tr = serialize($translations);
63
  foreach($translations as $key=>$p)
64
+ update_metadata($type, (int) $p, '_translations', $tr);
65
  delete_metadata($type, $id, '_translations');
66
  }
67
  }
68
 
69
  // returns the id of the translation of a post or term
70
+ // $type: either 'post' or 'term'
71
+ // $id: post id or term id
72
+ // $lang: object or slug (in the order of preference latest to avoid)
73
  function get_translation($type, $id, $lang) {
74
  $translations = unserialize(get_metadata($type, $id, '_translations', true));
75
+ $slug = $this->get_language($lang)->slug;
76
+ return isset($translations[$slug]) ? (int) $translations[$slug] : '';
77
+ }
78
+
79
+ // store the post language in the database
80
+ function set_post_language($post_id, $lang) {
81
+ wp_set_post_terms($post_id, $this->get_language($lang)->slug, 'language' );
82
  }
83
 
84
  // returns the language of a post
89
 
90
  // among the post and its translations, returns the id of the post which is in $lang
91
  function get_post($post_id, $lang) {
92
+ $lang = $this->get_language($lang);
93
+ return $this->get_post_language($post_id)->term_id == $lang->term_id ? $post_id : $this->get_translation('post', $post_id, $lang);
94
  }
95
 
96
+ // store the term language in the database
97
+ function set_term_language($term_id, $lang) {
98
+ update_metadata('term', $term_id, '_language', $this->get_language($lang)->term_id);
 
 
 
 
 
 
99
  }
100
 
101
+ // remove the term language in the database
102
  function delete_term_language($term_id) {
103
  delete_metadata('term', $term_id, '_language');
104
  }
114
 
115
  // among the term and its translations, returns the id of the term which is in $lang
116
  function get_term($term_id, $lang) {
117
+ $lang = $this->get_language($lang);
118
+ return $this->get_term_language($term_id)->term_id == $lang->term_id ? $term_id : $this->get_translation('term', $term_id, $lang);
119
  }
120
 
121
  // returns the html link to the flag if exists
122
+ // $lang: object
123
  function get_flag($lang) {
124
+ if (file_exists(POLYLANG_DIR.($file = '/flags/'.$lang->description.'.png')))
125
+ $url = POLYLANG_URL.$file;
126
+
127
+ // overwrite with custom flags
128
+ if (!is_admin() && ( // never use custom flags on admin side
129
+ file_exists(PLL_LOCAL_DIR.($file = '/'.$lang->description.'.png')) ||
130
+ file_exists(PLL_LOCAL_DIR.($file = '/'.$lang->description.'.jpg')) ))
131
+ $url = PLL_LOCAL_URL.$file;
132
+
133
+ return isset($url) ? '<img src="'.esc_url($url).'" alt="'.esc_attr($lang->name).'" />' : '';
134
  }
135
 
136
  // adds terms clauses to get_terms - used in both frontend and admin
137
  function _terms_clauses($clauses, $lang, $display_all = false) {
138
  global $wpdb;
139
  if (isset($lang) && !is_wp_error($lang)) {
140
+ $clauses['join'] .= $wpdb->prepare(" LEFT JOIN $wpdb->termmeta AS tm ON t.term_id = tm.term_id");
141
  $where_lang = $wpdb->prepare("tm.meta_key = '_language' AND tm.meta_value = %d", $lang->term_id); // add terms in the right language
142
+ $where_all = $wpdb->prepare("t.term_id NOT IN (SELECT term_id FROM $wpdb->termmeta WHERE meta_key IN ('_language'))"); // add terms with no language set
143
+ $clauses['where'] .= $display_all ? " AND (($where_lang) OR ($where_all))" : " AND $where_lang";
144
  }
145
  return $clauses;
146
  }
147
 
148
+ // returns all page ids *not in* language defined by $lang_id
149
+ function exclude_pages($lang_id) {
150
+ $q = array(
151
+ 'numberposts'=>-1,
152
+ 'post_type' => 'page',
153
+ 'fields' => 'ids',
154
+ 'tax_query' => array(array(
155
+ 'taxonomy'=>'language',
156
+ 'fields' => 'id',
157
+ 'terms'=>$lang_id,
158
+ 'operator'=>'NOT IN'
159
+ ))
160
+ );
161
+ return get_posts($q);
162
+ }
163
+
164
+ // register strings for translation
165
+ function register_string($name, $string) {
166
+ $this->strings[] = array('name'=> $name, 'string' => $string);
167
+ }
168
+
169
  } //class Polylang_Base
170
  ?>
include/core.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
- // filters posts and terms by language, rewrites links to include the language, etc...
 
3
  class Polylang_Core extends Polylang_base {
4
  private $curlang; // current language
5
  private $default_locale;
@@ -14,7 +15,7 @@ class Polylang_Core extends Polylang_base {
14
 
15
  function __construct() {
16
 
17
- // options often needed
18
  $this->options = get_option('polylang');
19
  $this->home = get_option('home');
20
  $this->page_for_posts = get_option('page_for_posts');
@@ -22,12 +23,17 @@ class Polylang_Core extends Polylang_base {
22
 
23
  // text domain management
24
  add_action('init', array(&$this, 'init'));
25
- add_filter('locale', array(&$this, 'get_locale'));
26
  add_filter('override_load_textdomain', array(&$this, 'mofile'), 10, 3);
27
  add_action('wp', array(&$this, 'load_textdomains'));
28
 
29
  // filters posts according to the language
30
- add_filter('pre_get_posts', array(&$this, 'pre_get_posts'));
 
 
 
 
 
 
31
 
32
  // filters categories and post tags by language
33
  add_filter('terms_clauses', array(&$this, 'terms_clauses'), 10, 3);
@@ -49,23 +55,23 @@ class Polylang_Core extends Polylang_base {
49
  // filters the pages according to the current language in wp_list_pages
50
  add_filter('wp_list_pages_excludes', array(&$this, 'wp_list_pages_excludes'));
51
 
52
- // filters the comments according to the current language
53
  add_filter('comments_clauses', array(&$this, 'comments_clauses'), 10, 2);
54
 
55
- // rewrites feed links to filter them by language
56
  add_filter('feed_link', array(&$this, 'feed_link'), 10, 2);
57
 
58
- // rewrites archives links to filter them by language
59
  add_filter('getarchives_join', array(&$this, 'posts_join'));
60
  add_filter('getarchives_where', array(&$this, 'posts_where'));
61
 
62
- // rewrites author and date links to filter them by language
63
  add_filter('author_link', array(&$this, 'archive_link'));
64
  add_filter('year_link', array(&$this, 'archive_link'));
65
  add_filter('month_link', array(&$this, 'archive_link'));
66
  add_filter('day_link', array(&$this, 'archive_link'));
67
 
68
- // rewrites next and previous post links to filter them by language
69
  add_filter('get_previous_post_join', array(&$this, 'posts_join'));
70
  add_filter('get_next_post_join', array(&$this, 'posts_join'));
71
  add_filter('get_previous_post_where', array(&$this, 'posts_where'));
@@ -80,6 +86,13 @@ class Polylang_Core extends Polylang_base {
80
  // filters the widgets according to the current language
81
  add_filter('widget_display_callback', array(&$this, 'widget_display_callback'), 10, 3);
82
 
 
 
 
 
 
 
 
83
  // modifies the home url
84
  add_filter('home_url', array(&$this, 'home_url'));
85
 
@@ -99,7 +112,7 @@ class Polylang_Core extends Polylang_base {
99
  return $this->get_language($_COOKIE['wordpress_polylang']);
100
 
101
  // sets the browsing language according to the browser preferences
102
- // code adapted from http://www.thefutureoftheweb.com/blog/use-accept-language-header
103
  if ($this->options['browser']) {
104
  $accept_langs = array();
105
 
@@ -113,7 +126,7 @@ class Polylang_Core extends Polylang_base {
113
  // set default to 1 for any without q factor
114
  foreach ($accept_langs as $accept_lang => $val) {
115
  if ($val === '') $accept_langs[$accept_lang] = 1;
116
- }
117
  arsort($accept_langs, SORT_NUMERIC); // sort list based on value
118
  }
119
  }
@@ -129,11 +142,8 @@ class Polylang_Core extends Polylang_base {
129
  }
130
  } // options['browser']
131
 
132
- // either there is no preference in the browser or preferences does not match our language list or it is requested not to use the browser preference
133
- if (!isset($pref_lang))
134
- $pref_lang = $this->get_language($this->options['default_lang']);
135
-
136
- return $pref_lang;
137
  }
138
 
139
  // returns the current language
@@ -158,19 +168,17 @@ class Polylang_Core extends Polylang_base {
158
  }
159
  }
160
 
161
- return (isset($lang)) ? $lang : NULL;
162
  }
163
 
164
  // save the default locale before we start any language manipulation
165
  function init() {
166
- $this->default_locale = get_locale();
167
  }
168
 
169
  // returns the locale based on current language
170
  function get_locale($locale) {
171
- if ($this->curlang)
172
- $locale = $this->curlang->description;
173
- return $locale;
174
  }
175
 
176
  // saves all text domains in a table for later usage
@@ -179,13 +187,17 @@ class Polylang_Core extends Polylang_base {
179
  return true; // prevents WP loading text domains as we will load them all later
180
  }
181
 
182
- // NOTE: I believe there are two ways for a plugin to force the WP language
183
  // as done by xili_language and here: load text domains and reinitialize wp_locale with the action 'wp'
184
  // as done by qtranslate: define the locale with the action 'plugins_loaded', but in this case, the language must be specified in the url.
185
  function load_textdomains() {
186
- // sets the current language and set a cookie to remember it
187
- if ($this->curlang = $this->get_current_language())
188
- setcookie('wordpress_polylang', $this->curlang->slug, time() + 31536000 /* 1 year */, COOKIEPATH, COOKIE_DOMAIN);
 
 
 
 
189
 
190
  // our override_load_textdomain filter has done its job. let's remove it before calling load_textdomain
191
  remove_filter('override_load_textdomain', array(&$this, 'mofile'));
@@ -195,8 +207,16 @@ class Polylang_Core extends Polylang_base {
195
  foreach ($this->list_textdomains as $textdomain)
196
  load_textdomain( $textdomain['domain'], str_replace($this->default_locale, $new_locale, $textdomain['mo']));
197
 
 
 
 
 
 
 
 
 
198
  global $wp_locale;
199
- $wp_locale->init(); // reinitializes wp_locale for weekdays and months
200
  }
201
 
202
  // filters posts according to the language
@@ -209,18 +229,22 @@ class Polylang_Core extends Polylang_base {
209
  if (isset($qvars['tax_query'][0]) && isset($qvars['tax_query'][0]['taxonomy']) && isset($qvars['tax_query'][0]['operator']))
210
  return;
211
 
 
212
  if (empty($query->query)) {
213
- if ( $this->options['hide_default'] && isset($_COOKIE['wordpress_polylang']) )
 
214
  $this->curlang = $this->get_language($this->options['default_lang']);
215
  else
216
  $this->curlang = $this->get_preferred_language(); // sets the language according to browser preference or default language
217
 
 
218
  if ($this->options['default_lang'] == $this->curlang->slug && $this->options['hide_default']) {
219
  if ($this->page_on_front && $link_id = $this->get_post($this->page_on_front, $this->curlang))
220
  $query->set('page_id', $link_id);
221
  else
222
  $query->set('lang', $this->curlang->slug);
223
  }
 
224
  else {
225
  if ($this->page_on_front && $link_id = $this->get_post($this->page_on_front, $this->curlang))
226
  $url = _get_page_link($link_id);
@@ -249,7 +273,7 @@ class Polylang_Core extends Polylang_base {
249
 
250
  if (isset($page_id) && $page_id && $this->get_post($page_id, $this->get_post_language($this->page_for_posts)) == $this->page_for_posts) {
251
  $query->set('lang',$this->get_post_language($page_id)->slug);
252
- $query->queried_object_id = $this->page_for_posts;
253
  $query->query_vars['page_id'] = $this->page_for_posts; // FIXME the trick works but breaks .current-menu-item and .current_page_item
254
  $query->is_page = false;
255
  $query->is_home = true;
@@ -260,19 +284,16 @@ class Polylang_Core extends Polylang_base {
260
 
261
  // FIXME to generalize as I probably forget things
262
  // sets the language in case we hide the default language
263
- if ( $this->options['hide_default'] && !isset($qvars['lang']) && (
264
  (count($query->query) == 1 && isset($qvars['paged']) && $qvars['paged']) ||
265
  isset($qvars['m']) && $qvars['m'] ||
266
  isset($qvars['feed']) && $qvars['feed'] ||
267
  isset($qvars['author']) && $qvars['author']))
268
  $query->set('lang', $this->options['default_lang']);
269
 
270
- // filters recent posts to the current language
271
- // FIXME if $qvars['post_type'] == 'nav_menu_item', setting lang breaks custom menus.
272
- // since to get nav_menu_items, get_post is used and no language is linked to nav_menu_items
273
- // if ($query->is_home && $this->curlang && !isset($qvars['post_type']))
274
- // FIXME generalize to all non visible post types
275
- if ($query->is_home && $this->curlang && (!isset($qvars['post_type']) || $qvars['post_type'] != 'nav_menu_item'))
276
  $query->set('lang', $this->curlang->slug);
277
 
278
  // remove pages query when the language is set unless we do a search
@@ -313,14 +334,14 @@ class Polylang_Core extends Polylang_base {
313
  }
314
 
315
  // adds our clauses to filter by current language
316
- return isset($this->curlang) ? $this->_terms_clauses($clauses, $this->curlang, PLL_DISPLAY_ALL) : $clauses;
317
  }
318
 
319
  // meta in the html head section
320
  function wp_head() {
321
  // modifies the canonical link to the homepage
322
  if (is_singular()) {
323
- global $wp_the_query;
324
  if ($id = $wp_the_query->get_queried_object_id()) {
325
  if (is_page())
326
  $link = _get_page_link($id); // ignores page_on_front unlike get_permalink
@@ -339,36 +360,32 @@ class Polylang_Core extends Polylang_base {
339
 
340
  // prevents redirection of the homepage
341
  function redirect_canonical($redirect_url, $requested_url) {
342
- if($requested_url == _get_page_link($this->page_on_front))
343
- return false;
344
- return $redirect_url;
345
  }
346
 
347
  // adds some javascript workaround knowing it's not perfect...
348
  function wp_print_footer_scripts() {
349
- if ($this->curlang) {
350
- $js = '';
351
-
352
- // modifies the search form since filtering get_search_form won't work if the template uses searchform.php
353
- // don't use directly e[0] just in case there is somewhere else an element named 's'
354
- // check before if the hidden input has not already been introduced by get_search_form
355
- if (!$this->search_form_filter) {
356
- $lang = esc_js($this->curlang->slug);
357
- $js .= "e = document.getElementsByName('s');
358
- for (i = 0; i < e.length; i++) {
359
- if (e[i] == '[object HTMLInputElement]') {
360
- var ih = document.createElement('input');
361
- ih.type = 'hidden';
362
- ih.name = 'lang';
363
- ih.value = '$lang';
364
- e[i].parentNode.appendChild(ih);
365
- }
366
- }";
367
- }
368
-
369
- if ($js)
370
- echo "<script type='text/javascript'>" .$js. "</script>";
371
  }
 
 
 
372
  }
373
 
374
  // adds the language information in the search form
@@ -384,86 +401,50 @@ class Polylang_Core extends Polylang_base {
384
  // excludes pages which are not in the current language for wp_list_pages
385
  // useful for the pages widget
386
  function wp_list_pages_excludes($pages) {
387
- if (isset($this->curlang)) {
388
- $q = array(
389
- 'numberposts'=>-1,
390
- 'post_type' => 'page',
391
- 'fields' => 'ids',
392
- 'tax_query' => array(array(
393
- 'taxonomy'=>'language',
394
- 'fields' => 'id',
395
- 'terms'=>$this->curlang->term_id,
396
- 'operator'=>'NOT IN'
397
- ))
398
- );
399
- $pages = array_merge($pages, get_posts($q));
400
- }
401
- return $pages;
402
  }
403
 
404
  // filters the comments according to the current language mainly for the recent comments widget
405
  function comments_clauses($clauses, $comment_query) {
406
  // first test if wp_posts.ID already available in the query
407
- if ($this->curlang && strpos($clauses['join'], '.ID')) {
408
  global $wpdb;
409
- $clauses['join'] .= " INNER JOIN $wpdb->term_relationships AS tr ON tr.object_id = ID";
410
  $clauses['where'] .= $wpdb->prepare(" AND tr.term_taxonomy_id = %d", $this->curlang->term_taxonomy_id);
411
  }
412
  return $clauses;
413
  }
414
 
 
 
 
 
 
 
 
415
  // Modifies the feed link to add the language parameter
416
  function feed_link($url, $feed) {
417
- global $wp_rewrite;
418
-
419
- if ($this->curlang) {
420
- if ($wp_rewrite->using_permalinks()) {
421
- $base = $this->options['rewrite'] ? '/' : '/language/';
422
- $slug = $this->options['default_lang'] == $this->curlang->slug && $this->options['hide_default'] ? '' : $base.$this->curlang->slug;
423
- $url = esc_url(str_replace($this->home, $this->home.$slug, $url));
424
- }
425
- elseif ($feed)
426
- $url = esc_url(home_url('?lang='.$this->curlang->slug.'&feed='.$feed));
427
-
428
- }
429
- return $url;
430
  }
431
 
432
  // modifies the sql request for wp_get_archives an get_adjacent_post to filter by the current language
433
  function posts_join($sql) {
434
- if ($this->curlang) {
435
- global $wpdb;
436
- $sql .= " INNER JOIN $wpdb->term_relationships ON object_id = ID";
437
- }
438
- return $sql;
439
  }
440
 
441
  // modifies the sql request for wp_get_archives and get_adjacent_post to filter by the current language
442
  function posts_where($sql) {
443
- if ($this->curlang) {
444
- global $wpdb;
445
- $sql .= $wpdb->prepare(" AND term_taxonomy_id = %d", $this->curlang->term_taxonomy_id);
446
- }
447
- return $sql;
448
  }
449
 
450
  // modifies the author and date links to add the language parameter
451
  function archive_link($link) {
452
- if ($this->curlang) {
453
- global $wp_rewrite;
454
-
455
- if ($wp_rewrite->using_permalinks()) {
456
- $base = $this->options['rewrite'] ? '/' : '/language/';
457
- $slug = $this->options['default_lang'] == $this->curlang->slug && $this->options['hide_default'] ? '' : $base.$this->curlang->slug;
458
- $link = esc_url(str_replace($this->home, $this->home.$slug, $link));
459
- }
460
- else
461
- $link = esc_url(str_replace($this->home.'/?', $this->home.'/?lang='.$this->curlang->slug.'&amp;', $link));
462
- }
463
- return $link;
464
  }
465
 
466
- // returns the url of the translation (if exists) of the current page
467
  function get_translation_url($language) {
468
  global $wp_query, $wp_rewrite;
469
  $qvars = $wp_query->query;
@@ -474,18 +455,13 @@ class Polylang_Core extends Polylang_base {
474
  $url = get_permalink($id);
475
 
476
  // page for posts
477
- elseif (get_option('show_on_front') == 'page' && // necessary for twentyeleven
478
- isset($wp_query->queried_object_id) &&
479
- $wp_query->queried_object_id == $this->page_for_posts
480
- )
481
  $url = get_permalink($this->get_post($this->page_for_posts, $language));
482
 
483
  elseif (is_page() && $id = $this->get_post($wp_query->queried_object_id, $language))
484
- $url = $hide && $id == $this->get_post($this->page_on_front, $language) ?
485
- $this->home :
486
- _get_page_link($id);
487
 
488
- elseif ( !is_tax ('language') && (is_category() || is_tag() || is_tax () ) ) {
489
  $term = get_queried_object();
490
  $lang = $this->get_term_language($term->term_id);
491
  $taxonomy = $term->taxonomy;
@@ -527,9 +503,9 @@ class Polylang_Core extends Polylang_base {
527
 
528
  // filters the nav menus according to the current language
529
  function wp_nav_menu_args($args) {
530
- if (!$args['menu'] && $args['theme_location'] && $this->curlang) {
531
  $menu_lang = get_option('polylang_nav_menus');
532
- $args['menu'] = $menu_lang[$args['theme_location']][$this->curlang->slug];
533
  }
534
  return $args;
535
  }
@@ -538,22 +514,19 @@ class Polylang_Core extends Polylang_base {
538
  function widget_display_callback($instance, $widget, $args) {
539
  $widget_lang = get_option('polylang_widgets');
540
  // don't display if a language filter is set and this is not the current one
541
- if (isset($this->curlang) && isset($widget_lang[$widget->id]) && $widget_lang[$widget->id] && $widget_lang[$widget->id] != $this->curlang->slug)
542
- return false;
543
-
544
- return $instance;
545
  }
546
 
547
  // adds the language switcher at the end of the menu
548
  function wp_nav_menu_items($items, $args) {
549
  $menu_lang = get_option('polylang_nav_menus');
550
- return $menu_lang[$args->theme_location]['switcher'] ?
551
  $items . $this->the_languages(array(
552
  'menu' => 1,
553
  'show_names' => $menu_lang[$args->theme_location]['show_names'],
554
  'show_flags' => $menu_lang[$args->theme_location]['show_flags'],
555
  'force_home' => $menu_lang[$args->theme_location]['force_home'],
556
- 'echo' => 0)) :
557
  $items;
558
  }
559
 
@@ -606,23 +579,36 @@ class Polylang_Core extends Polylang_base {
606
  return $menu;
607
  }
608
 
 
 
 
 
 
 
 
 
 
 
609
  // acts as is_front_page but knows about translated front page
610
  function is_front_page() {
611
- if ('page' == get_option('show_on_front') &&
612
- get_option('page_on_front') &&
613
- is_page($this->get_post(get_option('page_on_front'), $this->get_current_language()))
614
- )
615
  return true;
616
-
617
  elseif(is_tax('language'))
618
  return true;
619
-
620
- return is_front_page();
 
 
 
 
 
621
  }
622
 
623
  // filters the home url to get the right language
624
  function home_url($url) {
625
- if ( !(did_action('template_redirect') && rtrim($url,'/') == rtrim($this->home,'/') && $this->curlang) )
626
  return $url;
627
 
628
  // don't like this but at least for WP_Widget_Categories::widget, it seems to be the only solution
@@ -654,12 +640,12 @@ class Polylang_Core extends Polylang_base {
654
  // adds 'lang_url' as possible value to the 'show' parameter of bloginfo to display the home url in the correct language
655
  // FIXME not tested
656
  function bloginfo_url($output, $show) {
657
- if ($show == 'lang_url' && $this->curlang) {
658
  $url = $this->get_home_url($this->curlang);
659
  $output = isset($url) ? $url : $this->home;
660
  }
661
  return $output;
662
- }
663
 
664
  // displays the language switcher
665
  function the_languages($args = '') {
@@ -671,6 +657,8 @@ class Polylang_Core extends Polylang_base {
671
  'show_flags' => 0, // don't show flags
672
  'show_names' => 1, // show language names
673
  'force_home' => 0, // tries to find a translation (available only if display != dropdown)
 
 
674
  );
675
  extract(wp_parse_args($args, $defaults));
676
 
@@ -679,15 +667,23 @@ class Polylang_Core extends Polylang_base {
679
 
680
  foreach ($listlanguages as $language) {
681
  if ($dropdown) {
682
- $output .= sprintf(
683
- "<option value='%s'%s>%s</option>\n",
684
  esc_attr($language->slug),
685
  $language->term_id == $this->curlang->term_id ? ' selected="selected"' : '',
686
  esc_html($language->name)
687
  );
688
  }
689
  else {
 
 
 
 
690
  $url = $force_home ? null : $this->get_translation_url($language);
 
 
 
 
 
691
  $url = isset($url) ? $url : $this->get_home_url($language); // if the page is not translated, link to the home page
692
 
693
  $class = 'lang-item lang-item-'.esc_attr($language->term_id);
@@ -701,10 +697,7 @@ class Polylang_Core extends Polylang_base {
701
  }
702
  }
703
 
704
- if ($dropdown)
705
- $output = "<select name='lang_choice' id='lang_choice'>\n" . $output . "</select>\n";
706
- elseif (!$menu)
707
- $output = "<ul>\n" . $output . "</ul>\n";
708
 
709
  if ($echo)
710
  echo $output;
1
  <?php
2
+ // filters posts and terms by language, rewrites links to include the language, etc...
3
+ // used only for frontend
4
  class Polylang_Core extends Polylang_base {
5
  private $curlang; // current language
6
  private $default_locale;
15
 
16
  function __construct() {
17
 
18
+ // init options often needed
19
  $this->options = get_option('polylang');
20
  $this->home = get_option('home');
21
  $this->page_for_posts = get_option('page_for_posts');
23
 
24
  // text domain management
25
  add_action('init', array(&$this, 'init'));
 
26
  add_filter('override_load_textdomain', array(&$this, 'mofile'), 10, 3);
27
  add_action('wp', array(&$this, 'load_textdomains'));
28
 
29
  // filters posts according to the language
30
+ add_filter('pre_get_posts', array(&$this, 'pre_get_posts'));
31
+ }
32
+
33
+ // set these filters and actions only once the current language has been defined
34
+ function add_language_filters() {
35
+ // filters the WordPress locale
36
+ add_filter('locale', array(&$this, 'get_locale'));
37
 
38
  // filters categories and post tags by language
39
  add_filter('terms_clauses', array(&$this, 'terms_clauses'), 10, 3);
55
  // filters the pages according to the current language in wp_list_pages
56
  add_filter('wp_list_pages_excludes', array(&$this, 'wp_list_pages_excludes'));
57
 
58
+ // filters the comments according to the current language
59
  add_filter('comments_clauses', array(&$this, 'comments_clauses'), 10, 2);
60
 
61
+ // rewrites feed links to filter them by language
62
  add_filter('feed_link', array(&$this, 'feed_link'), 10, 2);
63
 
64
+ // rewrites archives links to filter them by language
65
  add_filter('getarchives_join', array(&$this, 'posts_join'));
66
  add_filter('getarchives_where', array(&$this, 'posts_where'));
67
 
68
+ // rewrites author and date links to filter them by language
69
  add_filter('author_link', array(&$this, 'archive_link'));
70
  add_filter('year_link', array(&$this, 'archive_link'));
71
  add_filter('month_link', array(&$this, 'archive_link'));
72
  add_filter('day_link', array(&$this, 'archive_link'));
73
 
74
+ // rewrites next and previous post links to filter them by language
75
  add_filter('get_previous_post_join', array(&$this, 'posts_join'));
76
  add_filter('get_next_post_join', array(&$this, 'posts_join'));
77
  add_filter('get_previous_post_where', array(&$this, 'posts_where'));
86
  // filters the widgets according to the current language
87
  add_filter('widget_display_callback', array(&$this, 'widget_display_callback'), 10, 3);
88
 
89
+ // strings translation (must be applied before WordPress applies its default formatting filters)
90
+ add_filter('widget_title', array(&$this, 'widget_title'), 1);
91
+ add_filter('bloginfo', array(&$this,'bloginfo'), 1, 2);
92
+
93
+ // loads front page template on translated front page
94
+ add_filter('template_include', array(&$this, 'template_include'));
95
+
96
  // modifies the home url
97
  add_filter('home_url', array(&$this, 'home_url'));
98
 
112
  return $this->get_language($_COOKIE['wordpress_polylang']);
113
 
114
  // sets the browsing language according to the browser preferences
115
+ // code adapted from http://www.thefutureoftheweb.com/blog/use-accept-language-header
116
  if ($this->options['browser']) {
117
  $accept_langs = array();
118
 
126
  // set default to 1 for any without q factor
127
  foreach ($accept_langs as $accept_lang => $val) {
128
  if ($val === '') $accept_langs[$accept_lang] = 1;
129
+ }
130
  arsort($accept_langs, SORT_NUMERIC); // sort list based on value
131
  }
132
  }
142
  }
143
  } // options['browser']
144
 
145
+ // return default if there is no preferences in the browser or preferences does not match our languages or it is requested not to use the browser preference
146
+ return isset($pref_lang) ? $pref_lang : $this->get_language($this->options['default_lang']);
 
 
 
147
  }
148
 
149
  // returns the current language
168
  }
169
  }
170
 
171
+ return (isset($lang)) ? $lang : false;
172
  }
173
 
174
  // save the default locale before we start any language manipulation
175
  function init() {
176
+ $this->default_locale = get_locale();
177
  }
178
 
179
  // returns the locale based on current language
180
  function get_locale($locale) {
181
+ return $this->curlang->description;
 
 
182
  }
183
 
184
  // saves all text domains in a table for later usage
187
  return true; // prevents WP loading text domains as we will load them all later
188
  }
189
 
190
+ // NOTE: I believe there are two ways for a plugin to force the WP language
191
  // as done by xili_language and here: load text domains and reinitialize wp_locale with the action 'wp'
192
  // as done by qtranslate: define the locale with the action 'plugins_loaded', but in this case, the language must be specified in the url.
193
  function load_textdomains() {
194
+ // sets the current language
195
+ if (!($this->curlang = $this->get_current_language()))
196
+ return; // something went wrong
197
+
198
+ // set a cookie to remember the language and then set all our language filters and actions
199
+ setcookie('wordpress_polylang', $this->curlang->slug, time() + 31536000 /* 1 year */, COOKIEPATH, COOKIE_DOMAIN);
200
+ $this->add_language_filters();
201
 
202
  // our override_load_textdomain filter has done its job. let's remove it before calling load_textdomain
203
  remove_filter('override_load_textdomain', array(&$this, 'mofile'));
207
  foreach ($this->list_textdomains as $textdomain)
208
  load_textdomain( $textdomain['domain'], str_replace($this->default_locale, $new_locale, $textdomain['mo']));
209
 
210
+ // and finally load user defined strings
211
+ global $l10n;
212
+ $mo = new MO();
213
+ $reader = new POMO_StringReader(base64_decode(get_option('polylang_mo'.$this->curlang->term_id)));
214
+ $mo->import_from_reader($reader);
215
+ $l10n['pll_string'] = &$mo;
216
+
217
+ // reinitializes wp_locale for weekdays and months
218
  global $wp_locale;
219
+ $wp_locale->init();
220
  }
221
 
222
  // filters posts according to the language
229
  if (isset($qvars['tax_query'][0]) && isset($qvars['tax_query'][0]['taxonomy']) && isset($qvars['tax_query'][0]['operator']))
230
  return;
231
 
232
+ // homepage is requested, let's set the language
233
  if (empty($query->query)) {
234
+ // find out the language
235
+ if ($this->options['hide_default'] && isset($_COOKIE['wordpress_polylang']))
236
  $this->curlang = $this->get_language($this->options['default_lang']);
237
  else
238
  $this->curlang = $this->get_preferred_language(); // sets the language according to browser preference or default language
239
 
240
+ // we are already on the right page
241
  if ($this->options['default_lang'] == $this->curlang->slug && $this->options['hide_default']) {
242
  if ($this->page_on_front && $link_id = $this->get_post($this->page_on_front, $this->curlang))
243
  $query->set('page_id', $link_id);
244
  else
245
  $query->set('lang', $this->curlang->slug);
246
  }
247
+ // redirect to the home page in the right language
248
  else {
249
  if ($this->page_on_front && $link_id = $this->get_post($this->page_on_front, $this->curlang))
250
  $url = _get_page_link($link_id);
273
 
274
  if (isset($page_id) && $page_id && $this->get_post($page_id, $this->get_post_language($this->page_for_posts)) == $this->page_for_posts) {
275
  $query->set('lang',$this->get_post_language($page_id)->slug);
276
+ $query->queried_object_id = $this->page_for_posts;
277
  $query->query_vars['page_id'] = $this->page_for_posts; // FIXME the trick works but breaks .current-menu-item and .current_page_item
278
  $query->is_page = false;
279
  $query->is_home = true;
284
 
285
  // FIXME to generalize as I probably forget things
286
  // sets the language in case we hide the default language
287
+ if ($this->options['hide_default'] && !isset($qvars['lang']) && (
288
  (count($query->query) == 1 && isset($qvars['paged']) && $qvars['paged']) ||
289
  isset($qvars['m']) && $qvars['m'] ||
290
  isset($qvars['feed']) && $qvars['feed'] ||
291
  isset($qvars['author']) && $qvars['author']))
292
  $query->set('lang', $this->options['default_lang']);
293
 
294
+ // allow filtering recent posts by the current language
295
+ // take care not to break queries for non visible post types such as nav_menu_items, attachments...
296
+ if ($query->is_home && $this->curlang && (!isset($qvars['post_type']) || !in_array($qvars['post_type'], get_post_types(array('show_ui' => false)))))
 
 
 
297
  $query->set('lang', $this->curlang->slug);
298
 
299
  // remove pages query when the language is set unless we do a search
334
  }
335
 
336
  // adds our clauses to filter by current language
337
+ return $this->_terms_clauses($clauses, $this->curlang, PLL_DISPLAY_ALL);
338
  }
339
 
340
  // meta in the html head section
341
  function wp_head() {
342
  // modifies the canonical link to the homepage
343
  if (is_singular()) {
344
+ global $wp_the_query;
345
  if ($id = $wp_the_query->get_queried_object_id()) {
346
  if (is_page())
347
  $link = _get_page_link($id); // ignores page_on_front unlike get_permalink
360
 
361
  // prevents redirection of the homepage
362
  function redirect_canonical($redirect_url, $requested_url) {
363
+ return $requested_url == _get_page_link($this->page_on_front) ? false : $redirect_url;
 
 
364
  }
365
 
366
  // adds some javascript workaround knowing it's not perfect...
367
  function wp_print_footer_scripts() {
368
+ $js = '';
369
+
370
+ // modifies the search form since filtering get_search_form won't work if the template uses searchform.php
371
+ // don't use directly e[0] just in case there is somewhere else an element named 's'
372
+ // check before if the hidden input has not already been introduced by get_search_form
373
+ if (!$this->search_form_filter) {
374
+ $lang = esc_js($this->curlang->slug);
375
+ $js .= "e = document.getElementsByName('s');
376
+ for (i = 0; i < e.length; i++) {
377
+ if (e[i] == '[object HTMLInputElement]') {
378
+ var ih = document.createElement('input');
379
+ ih.type = 'hidden';
380
+ ih.name = 'lang';
381
+ ih.value = '$lang';
382
+ e[i].parentNode.appendChild(ih);
383
+ }
384
+ }";
 
 
 
 
 
385
  }
386
+
387
+ if ($js)
388
+ echo "<script type='text/javascript'>" .$js. "</script>";
389
  }
390
 
391
  // adds the language information in the search form
401
  // excludes pages which are not in the current language for wp_list_pages
402
  // useful for the pages widget
403
  function wp_list_pages_excludes($pages) {
404
+ return array_merge($pages, $this->exclude_pages($this->curlang->term_id));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
  }
406
 
407
  // filters the comments according to the current language mainly for the recent comments widget
408
  function comments_clauses($clauses, $comment_query) {
409
  // first test if wp_posts.ID already available in the query
410
+ if (strpos($clauses['join'], '.ID')) {
411
  global $wpdb;
412
+ $clauses['join'] .= $wpdb->prepare(" INNER JOIN $wpdb->term_relationships AS tr ON tr.object_id = ID");
413
  $clauses['where'] .= $wpdb->prepare(" AND tr.term_taxonomy_id = %d", $this->curlang->term_taxonomy_id);
414
  }
415
  return $clauses;
416
  }
417
 
418
+ // adds language information to a link when using pretty permalinks
419
+ function add_language_to_link($url) {
420
+ $base = $this->options['rewrite'] ? '/' : '/language/';
421
+ $slug = $this->options['default_lang'] == $this->curlang->slug && $this->options['hide_default'] ? '' : $base.$this->curlang->slug;
422
+ return esc_url(str_replace($this->home, $this->home.$slug, $url));
423
+ }
424
+
425
  // Modifies the feed link to add the language parameter
426
  function feed_link($url, $feed) {
427
+ return $GLOBALS['wp_rewrite']->using_permalinks() ? $this->add_language_to_link($url) : esc_url(home_url('?lang='.$this->curlang->slug.'&feed='.$feed));
 
 
 
 
 
 
 
 
 
 
 
 
428
  }
429
 
430
  // modifies the sql request for wp_get_archives an get_adjacent_post to filter by the current language
431
  function posts_join($sql) {
432
+ return $sql . $GLOBALS['wpdb']->prepare(" INNER JOIN $wpdb->term_relationships ON object_id = ID");
 
 
 
 
433
  }
434
 
435
  // modifies the sql request for wp_get_archives and get_adjacent_post to filter by the current language
436
  function posts_where($sql) {
437
+ return $sql . $GLOBALS['wpdb']->prepare(" AND term_taxonomy_id = %d", $this->curlang->term_taxonomy_id);
 
 
 
 
438
  }
439
 
440
  // modifies the author and date links to add the language parameter
441
  function archive_link($link) {
442
+ return $GLOBALS['wp_rewrite']->using_permalinks() ?
443
+ $this->add_language_to_link($link) :
444
+ esc_url(str_replace($this->home.'/?', $this->home.'/?lang='.$this->curlang->slug.'&amp;', $link));
 
 
 
 
 
 
 
 
 
445
  }
446
 
447
+ // returns the url of the translation (if exists) of the current page
448
  function get_translation_url($language) {
449
  global $wp_query, $wp_rewrite;
450
  $qvars = $wp_query->query;
455
  $url = get_permalink($id);
456
 
457
  // page for posts
458
+ elseif (get_option('show_on_front') == 'page' && isset($wp_query->queried_object_id) && $wp_query->queried_object_id == $this->page_for_posts)
 
 
 
459
  $url = get_permalink($this->get_post($this->page_for_posts, $language));
460
 
461
  elseif (is_page() && $id = $this->get_post($wp_query->queried_object_id, $language))
462
+ $url = $hide && $id == $this->get_post($this->page_on_front, $language) ? $this->home : _get_page_link($id);
 
 
463
 
464
+ elseif ( !is_tax('language') && (is_category() || is_tag() || is_tax ()) ) {
465
  $term = get_queried_object();
466
  $lang = $this->get_term_language($term->term_id);
467
  $taxonomy = $term->taxonomy;
503
 
504
  // filters the nav menus according to the current language
505
  function wp_nav_menu_args($args) {
506
+ if (!$args['menu'] && $args['theme_location']) {
507
  $menu_lang = get_option('polylang_nav_menus');
508
+ $args['menu'] = $menu_lang[$args['theme_location']][$this->curlang->slug];
509
  }
510
  return $args;
511
  }
514
  function widget_display_callback($instance, $widget, $args) {
515
  $widget_lang = get_option('polylang_widgets');
516
  // don't display if a language filter is set and this is not the current one
517
+ return isset($widget_lang[$widget->id]) && $widget_lang[$widget->id] && $widget_lang[$widget->id] != $this->curlang->slug ? false : $instance;
 
 
 
518
  }
519
 
520
  // adds the language switcher at the end of the menu
521
  function wp_nav_menu_items($items, $args) {
522
  $menu_lang = get_option('polylang_nav_menus');
523
+ return $menu_lang[$args->theme_location]['switcher'] ?
524
  $items . $this->the_languages(array(
525
  'menu' => 1,
526
  'show_names' => $menu_lang[$args->theme_location]['show_names'],
527
  'show_flags' => $menu_lang[$args->theme_location]['show_flags'],
528
  'force_home' => $menu_lang[$args->theme_location]['force_home'],
529
+ 'echo' => 0)) :
530
  $items;
531
  }
532
 
579
  return $menu;
580
  }
581
 
582
+ // translates widget titles
583
+ function widget_title($title) {
584
+ return __($title, 'pll_string');
585
+ }
586
+
587
+ // translates site title and tagline
588
+ function bloginfo($output, $show) {
589
+ return in_array($show, array('', 'name', 'description')) ? __($output, 'pll_string') : $output;
590
+ }
591
+
592
  // acts as is_front_page but knows about translated front page
593
  function is_front_page() {
594
+ if ('posts' == get_option('show_on_front') && is_home())
595
+ return true;
596
+ elseif ('page' == get_option('show_on_front') && $this->page_on_front && is_page($this->get_post($this->page_on_front, $this->get_current_language())))
 
597
  return true;
 
598
  elseif(is_tax('language'))
599
  return true;
600
+ else
601
+ return false;
602
+ }
603
+
604
+ // loads front page template on translated front page
605
+ function template_include($template) {
606
+ return ($this->is_front_page() && $front_page = get_front_page_template()) ? $front_page : $template;
607
  }
608
 
609
  // filters the home url to get the right language
610
  function home_url($url) {
611
+ if ( !(did_action('template_redirect') && rtrim($url,'/') == rtrim($this->home,'/')) )
612
  return $url;
613
 
614
  // don't like this but at least for WP_Widget_Categories::widget, it seems to be the only solution
640
  // adds 'lang_url' as possible value to the 'show' parameter of bloginfo to display the home url in the correct language
641
  // FIXME not tested
642
  function bloginfo_url($output, $show) {
643
+ if ($show == 'lang_url') {
644
  $url = $this->get_home_url($this->curlang);
645
  $output = isset($url) ? $url : $this->home;
646
  }
647
  return $output;
648
+ }
649
 
650
  // displays the language switcher
651
  function the_languages($args = '') {
657
  'show_flags' => 0, // don't show flags
658
  'show_names' => 1, // show language names
659
  'force_home' => 0, // tries to find a translation (available only if display != dropdown)
660
+ 'hide_if_no_translation' => 0, // don't hide the link if there is no translation
661
+ 'hide_current' => 0, // don't hide current language
662
  );
663
  extract(wp_parse_args($args, $defaults));
664
 
667
 
668
  foreach ($listlanguages as $language) {
669
  if ($dropdown) {
670
+ $output .= sprintf("<option value='%s'%s>%s</option>\n",
 
671
  esc_attr($language->slug),
672
  $language->term_id == $this->curlang->term_id ? ' selected="selected"' : '',
673
  esc_html($language->name)
674
  );
675
  }
676
  else {
677
+ // hide current language
678
+ if ($this->curlang->term_id == $language->term_id && $hide_current)
679
+ continue;
680
+
681
  $url = $force_home ? null : $this->get_translation_url($language);
682
+
683
+ // hide if no translation exists
684
+ if (!isset($url) && $hide_if_no_translation)
685
+ continue;
686
+
687
  $url = isset($url) ? $url : $this->get_home_url($language); // if the page is not translated, link to the home page
688
 
689
  $class = 'lang-item lang-item-'.esc_attr($language->term_id);
697
  }
698
  }
699
 
700
+ $output = $dropdown ? "<select name='lang_choice' id='lang_choice'>\n" . $output . "</select>\n" : $output;
 
 
 
701
 
702
  if ($echo)
703
  echo $output;
include/languages-form.php CHANGED
@@ -36,7 +36,8 @@ if (isset($_GET['error'])) {?>
36
  // The term fields are used as follows :
37
  // name -> language name (used only for display)
38
  // slug -> language code (ideally 2-letters ISO 639-1 language code but I currently use it only as slug so it doesn't matter)
39
- // description -> WordPress Locale for the language. Here if something wrong is used, the .mo files will not be loaded...
 
40
 
41
  // adds noheader=true in the action url to allow using wp_redirect when processing the form ?>
42
  <form id="add-lang" method="post" action="admin.php?page=mlang&amp;noheader=true" class="validate">
@@ -81,6 +82,12 @@ if (isset($_GET['error'])) {?>
81
  <p><?php _e('2-letters ISO 639-1 language code (for example: en)', 'polylang');?></p>
82
  </div>
83
 
 
 
 
 
 
 
84
  <?php submit_button( $action == 'edit' ? __('Update') : __('Add new language', 'polylang'), 'button'); // since WP 3.1 ?>
85
 
86
  </form>
@@ -133,6 +140,18 @@ case 'menus': ?>
133
  </div><!-- form-wrap --><?php
134
  break;
135
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  // settings tab
137
  case 'settings': ?>
138
 
36
  // The term fields are used as follows :
37
  // name -> language name (used only for display)
38
  // slug -> language code (ideally 2-letters ISO 639-1 language code but I currently use it only as slug so it doesn't matter)
39
+ // description -> WordPress locale for the language. Here if something wrong is used, the .mo files will not be loaded...
40
+ // term_group -> order
41
 
42
  // adds noheader=true in the action url to allow using wp_redirect when processing the form ?>
43
  <form id="add-lang" method="post" action="admin.php?page=mlang&amp;noheader=true" class="validate">
82
  <p><?php _e('2-letters ISO 639-1 language code (for example: en)', 'polylang');?></p>
83
  </div>
84
 
85
+ <div class="form-field">
86
+ <label for="term_group"><?php _e('Order', 'polylang');?></label>
87
+ <input name="term_group" id="term_group" type="text" value="<?php if ($action=='edit') echo esc_attr($edit_lang->term_group);?>" />
88
+ <p><?php _e('Position of the language in the language switcher', 'polylang');?></p>
89
+ </div>
90
+
91
  <?php submit_button( $action == 'edit' ? __('Update') : __('Add new language', 'polylang'), 'button'); // since WP 3.1 ?>
92
 
93
  </form>
140
  </div><!-- form-wrap --><?php
141
  break;
142
 
143
+ // string translations tab
144
+ case 'strings':
145
+
146
+ $paged = isset($_GET['paged']) ? '&paged='.$_GET['paged'] : '';?>
147
+ <form id="string-translation" method="post" action="<?php echo esc_url(admin_url('admin.php?page=mlang&tab=strings'.$paged))?>" class="validate">
148
+ <?php wp_nonce_field('string-translation', '_wpnonce_string-translation');?>
149
+ <input type="hidden" name="action" value="string-translation" /><?php
150
+ $string_table->display();
151
+ submit_button(); // since WP 3.1 ?>
152
+ </form><?php
153
+ break;
154
+
155
  // settings tab
156
  case 'settings': ?>
157
 
include/list-table.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- // Thanks to Matt Van Andel (http://www.mattvanandel.com) for most of this code !
4
 
5
  if(!class_exists('WP_List_Table')){
6
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); // since WP 3.1
@@ -16,14 +16,7 @@ class Polylang_List_Table extends WP_List_Table {
16
  }
17
 
18
  function column_default( $item, $column_name){
19
- switch($column_name){
20
- case 'description':
21
- case 'slug':
22
- case 'flag':
23
- case 'count':
24
- return $item[$column_name];
25
- default:
26
- }
27
  }
28
 
29
  function column_name($item){
@@ -52,6 +45,7 @@ class Polylang_List_Table extends WP_List_Table {
52
  'name' => __('Full name', 'polylang'),
53
  'description' => __('Locale', 'polylang'),
54
  'slug' => __('Code', 'polylang'),
 
55
  'flag' => __('Flag', 'polylang'),
56
  'count' => __('Posts', 'polylang')
57
  );
@@ -63,6 +57,7 @@ class Polylang_List_Table extends WP_List_Table {
63
  'name' => array('name',true), // sorted by name by default
64
  'description' => array('description',false),
65
  'slug' => array('slug',false),
 
66
  'count' => array('count',false)
67
  );
68
  return $sortable_columns;
@@ -83,10 +78,10 @@ class Polylang_List_Table extends WP_List_Table {
83
  $this->_column_headers = array($columns, $hidden, $sortable);
84
 
85
  function usort_reorder($a,$b){
86
- $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'name'; //If no sort, default to title
87
- $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; //If no order, default to asc
88
- $result = strcmp($a[$orderby], $b[$orderby]); //Determine sort order
89
- return ($order==='asc') ? $result : -$result; //Send final sort direction to usort
90
  }
91
  usort($data, 'usort_reorder');
92
 
@@ -102,4 +97,73 @@ class Polylang_List_Table extends WP_List_Table {
102
  ) );
103
  }
104
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  ?>
1
  <?php
2
 
3
+ // Thanks to Matt Van Andel (http://www.mattvanandel.com) for its plugin "Custom List Table Example" !
4
 
5
  if(!class_exists('WP_List_Table')){
6
  require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); // since WP 3.1
16
  }
17
 
18
  function column_default( $item, $column_name){
19
+ return $item[$column_name];
 
 
 
 
 
 
 
20
  }
21
 
22
  function column_name($item){
45
  'name' => __('Full name', 'polylang'),
46
  'description' => __('Locale', 'polylang'),
47
  'slug' => __('Code', 'polylang'),
48
+ 'term_group' => __('Order', 'polylang'),
49
  'flag' => __('Flag', 'polylang'),
50
  'count' => __('Posts', 'polylang')
51
  );
57
  'name' => array('name',true), // sorted by name by default
58
  'description' => array('description',false),
59
  'slug' => array('slug',false),
60
+ 'term_group' => array('term_group',false),
61
  'count' => array('count',false)
62
  );
63
  return $sortable_columns;
78
  $this->_column_headers = array($columns, $hidden, $sortable);
79
 
80
  function usort_reorder($a,$b){
81
+ $orderby = (!empty($_REQUEST['orderby'])) ? $_REQUEST['orderby'] : 'name'; // if no sort, default to name
82
+ $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; // if no order, default to asc
83
+ $result = strcmp($a[$orderby], $b[$orderby]); // determine sort order
84
+ return ($order==='asc') ? $result : -$result; // send final sort direction to usort
85
  }
86
  usort($data, 'usort_reorder');
87
 
97
  ) );
98
  }
99
  }
100
+
101
+ class Polylang_String_Table extends WP_List_Table {
102
+ function __construct() {
103
+ parent::__construct( array(
104
+ 'singular' => __('Strings translation','polylang'),
105
+ 'plural' => __('Strings translations','polylang'),
106
+ 'ajax'=> false)
107
+ );
108
+ }
109
+
110
+ function column_default($item, $column_name){
111
+ return $item[$column_name];
112
+ }
113
+
114
+ function column_translations($item){
115
+ $out = sprintf('<input type="hidden" name="string[%1$s]" value="%2$s" />', esc_attr($item['row']), esc_html($item['string']));
116
+
117
+ foreach($item['translations'] as $key=>$translation)
118
+ $out .= sprintf('<div class="translation"><label for="%1$s-%2$s">%3$s</label><input name="translation[%1$s][%2$s]" id="%1$s-%2$s" value="%4$s" /></div>',
119
+ esc_attr($key), esc_attr($item['row']), esc_html($key), esc_html($translation));
120
+
121
+ return $out;
122
+ }
123
+
124
+ function get_columns(){
125
+ return array(
126
+ 'name' => __('Name', 'polylang'),
127
+ 'string' => __('String', 'polylang'),
128
+ 'translations' => __('Translations', 'polylang'),
129
+ );
130
+ }
131
+
132
+ function get_sortable_columns() {
133
+ return array(
134
+ 'name' => array('name',false),
135
+ 'string' => array('string',false),
136
+ );
137
+ }
138
+
139
+ function prepare_items($data = array()) {
140
+ $per_page = 10; // 10 strings per page
141
+ $columns = $this->get_columns();
142
+ $hidden = array();
143
+ $sortable = $this->get_sortable_columns();
144
+
145
+ $this->_column_headers = array($columns, $hidden, $sortable);
146
+
147
+ function usort_reorder($a,$b){
148
+ $orderby = $_REQUEST['orderby'];
149
+ $order = (!empty($_REQUEST['order'])) ? $_REQUEST['order'] : 'asc'; // if no order, default to asc
150
+ $result = strcmp($a[$orderby], $b[$orderby]); // determine sort order
151
+
152
+ return ($order==='asc') ? $result : -$result; // send final sort direction to usort
153
+ }
154
+ if (!empty($_REQUEST['orderby'])) // no sort by default
155
+ usort($data, 'usort_reorder');
156
+
157
+ $current_page = $this->get_pagenum();
158
+ $total_items = count($data);
159
+ $data = array_slice($data,(($current_page-1)*$per_page),$per_page);
160
+ $this->items = $data;
161
+
162
+ $this->set_pagination_args( array(
163
+ 'total_items' => $total_items,
164
+ 'per_page' => $per_page,
165
+ 'total_pages' => ceil($total_items/$per_page)
166
+ ) );
167
+ }
168
+ }
169
  ?>
include/post-translations.php CHANGED
@@ -15,7 +15,7 @@
15
  <tr>
16
  <td><?php echo esc_html($language->name);?></td><?php
17
  printf(
18
- '<td><input name="tr_lang[%1$s]" id="tr_lang_%1$s" class="tags-input" type="text" value="%2$s" size="6"/></td>',
19
  esc_attr($language->slug),
20
  esc_attr($value)
21
  );
15
  <tr>
16
  <td><?php echo esc_html($language->name);?></td><?php
17
  printf(
18
+ '<td><input name="post_tr_lang[%1$s]" id="tr_lang_%1$s" class="tags-input" type="text" value="%2$s" size="6"/></td>',
19
  esc_attr($language->slug),
20
  esc_attr($value)
21
  );
include/term-translations.php CHANGED
@@ -10,75 +10,62 @@ else {
10
  // add term form?>
11
  <label><?php _e('Translations', 'polylang');?></label><?php
12
  }?>
13
- <table>
14
  <thead><tr><?php
15
- foreach (array(__('Language', 'polylang'), __('Translation', 'polylang'), __('Edit', 'polylang')) as $title)
16
- printf('<th>%s</th>', $title);?>
 
 
17
  </tr></thead>
18
  <tbody>
19
  <?php foreach ($listlanguages as $language) {
20
- $translation = 0;
 
21
 
22
  // look for any existing translation in this language
23
- if ($language != $lang) {
24
- if (isset($term_id) && $translation_id = $this->get_translation('term', $term_id, $language))
25
- $translation = get_term($translation_id, $taxonomy);
26
- if (isset($_GET['from_tag']) && isset($_GET['from_lang'])) {
27
- if ($_GET['from_lang'] == $language->slug)
28
- $translation = get_term($_GET['from_tag'], $taxonomy);
29
- elseif ($translation_id = $this->get_translation('term', $_GET['from_tag'], $language))
30
- $translation = get_term($translation_id, $taxonomy);
31
- }?>
32
 
33
- <tr><td><?php echo esc_html($language->name);?></td><?php
34
 
35
- // no translation exits in this language
36
- if (!$translation) {
37
- $translations = $this->get_terms_not_translated($taxonomy, $language, $lang);
38
- if (!empty($translations)) { ?>
39
- <td>
40
- <select name="tr_lang[<?php echo esc_attr($language->slug);?>]" id="tr_lang_<?php echo esc_attr($language->slug);?>">
41
- <option value="0"></option><?php
42
- foreach ($translations as $translation) { ?>
43
- <option value="<?php echo esc_attr($translation->term_id);?>"><?php echo esc_html($translation->name);?></option><?php
44
- } ?>
45
- </select>
46
- </td><?php
47
- }
48
- else { ?>
49
- <td>
50
- </td><?php
51
- } ?>
52
- <td><?php
53
- // do not display the add new link in add term form ($term_id not set !!!)
54
- if (isset($term_id)) {
55
- $link = esc_url(admin_url(sprintf(
56
- 'edit-tags.php?taxonomy=%1$s&from_tag=%2$d&from_lang=%3$s&new_lang=%4$s',
57
- $taxonomy,
58
- $term_id,
59
- $lang->slug,
60
- $language->slug
61
- )));
62
- echo '<a href="' . $link . '">' . __('Add new','polylang') . '</a>';
63
- }?>
64
  </td><?php
65
- }
 
 
66
 
67
- // a translation exists
68
- else {
69
- printf('<td><input type="hidden" name="tr_lang[%s]" value="%d" />%s</td>',
70
- esc_attr($language->slug), esc_attr($translation->term_id) ,esc_html($translation->name));?>
71
- <td><?php
72
- $link = esc_url(admin_url(sprintf(
73
- 'edit-tags.php?action=edit&amp;taxonomy=%1$s&tag_ID=%2$d',
74
- $taxonomy,
75
- $translation->term_id
76
- )));
77
- echo '<a href="' . $link . '">' . __('Edit','polylang') . '</a>';?>
78
- </td><?php
79
- } ?>
80
- </tr><?php
81
- } // if (!$value)
 
 
 
 
82
  } // foreach ?>
83
  </tbody>
84
  </table><?php
10
  // add term form?>
11
  <label><?php _e('Translations', 'polylang');?></label><?php
12
  }?>
13
+ <table class="widefat term-translations">
14
  <thead><tr><?php
15
+ echo '<th class="tr-language-column">'.__('Language', 'polylang').'</th>';
16
+ echo '<th>'.__('Translation', 'polylang').'</th>';
17
+ if (isset($term_id))
18
+ echo '<th class="tr-edit-column">'.__('Edit', 'polylang').'</th>';?>
19
  </tr></thead>
20
  <tbody>
21
  <?php foreach ($listlanguages as $language) {
22
+ if ($language == $lang)
23
+ continue;
24
 
25
  // look for any existing translation in this language
26
+ $translation = 0;
27
+ if (isset($term_id) && $translation_id = $this->get_translation('term', $term_id, $language))
28
+ $translation = get_term($translation_id, $taxonomy);
29
+ if (isset($_GET['from_tag']) && $translation_id = $this->get_term($_GET['from_tag'], $language))
30
+ $translation = get_term($translation_id, $taxonomy);?>
 
 
 
 
31
 
32
+ <tr><td class="tr-language-column"><?php echo esc_html($language->name);?></td><?php
33
 
34
+ // no translation exists in this language
35
+ if (!$translation) {
36
+ // look for untranslated terms in this language
37
+ $translations = $this->get_terms_not_translated($taxonomy, $language, $lang);
38
+ if (!empty($translations)) { ?>
39
+ <td>
40
+ <?php printf('<select name="term_tr_lang[%1$s]" id="tr_lang_%1$s">', esc_attr($language->slug)); ?>
41
+ <option value="0"></option><?php
42
+ foreach ($translations as $translation)
43
+ printf('<option value="%s">%s</option>', esc_attr($translation->term_id), esc_html($translation->name));?>
44
+ </select>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  </td><?php
46
+ }
47
+ else
48
+ echo '<td>'.__('No untranslated term', 'polylang').'</td>';
49
 
50
+ // do not display the add new link in add term form ($term_id not set !!!)
51
+ if (isset($term_id))
52
+ printf('<td class="tr-edit-column"><a href="%1$s">%2$s</a></td>',
53
+ esc_url(admin_url(sprintf('edit-tags.php?taxonomy=%1$s&from_tag=%2$d&new_lang=%3$s', $taxonomy, $term_id, $lang->slug))),
54
+ __('Add new','polylang')
55
+ );
56
+ }
57
+
58
+ // a translation exists
59
+ else {
60
+ printf('<td><input type="hidden" name="term_tr_lang[%s]" value="%d" />%s</td>',
61
+ esc_attr($language->slug), esc_attr($translation->term_id) ,esc_html($translation->name));
62
+ if (isset($term_id))
63
+ printf('<td class="tr-edit-column"><a href="%1$s">%2$s</a></td>',
64
+ esc_url(admin_url(sprintf('edit-tags.php?action=edit&amp;taxonomy=%1$s&tag_ID=%2$d', $taxonomy, $translation->term_id))),
65
+ __('Edit','polylang')
66
+ );
67
+ } ?>
68
+ </tr><?php
69
  } // foreach ?>
70
  </tbody>
71
  </table><?php
include/widget.php CHANGED
@@ -19,28 +19,35 @@ class Polylang_Widget extends WP_Widget {
19
 
20
  $title = apply_filters('widget_title', $title, $instance, $this->id_base);
21
 
 
22
  echo "$before_widget\n";
23
  if ($title)
24
  echo $before_title . $title . $after_title;
 
 
25
  $polylang->the_languages($instance);
 
 
26
  echo "$after_widget\n";
27
 
28
  // javascript to switch the language when using a dropdown list
29
- // keep the things simple for now as we switch to the posts page
30
- if ($dropdown) {
31
- $url = home_url('?lang=');
32
- $home_url = get_option('home');
33
- $options = get_option('polylang');
34
- $default = $options['hide_default'] ? esc_js($options['default_lang']) : '';
 
35
 
36
  $js = "
37
  <script type='text/javascript'>
 
38
  var d = document.getElementById('lang_choice');
39
  d.onchange = function() {
40
- if (this.value == '$default')
41
- location.href = '$home_url';
42
- else
43
- location.href ='$url'+this.value;
44
  }
45
  </script>";
46
 
19
 
20
  $title = apply_filters('widget_title', $title, $instance, $this->id_base);
21
 
22
+
23
  echo "$before_widget\n";
24
  if ($title)
25
  echo $before_title . $title . $after_title;
26
+ if (!$dropdown)
27
+ echo "<ul>\n";
28
  $polylang->the_languages($instance);
29
+ if (!$dropdown)
30
+ echo "</ul>\n";
31
  echo "$after_widget\n";
32
 
33
  // javascript to switch the language when using a dropdown list
34
+ if ($dropdown) {
35
+ foreach ($polylang->get_languages_list() as $language) {
36
+ $url = $force_home ? $polylang->get_home_url($language) : $polylang->get_translation_url($language);
37
+ $urls[] = '"'.esc_js($language->slug).'":"'.esc_url($url).'"';
38
+ }
39
+
40
+ $urls = implode(',', $urls);
41
 
42
  $js = "
43
  <script type='text/javascript'>
44
+ var urls = {{$urls}};
45
  var d = document.getElementById('lang_choice');
46
  d.onchange = function() {
47
+ for (var i in urls) {
48
+ if (this.value == i)
49
+ location.href = urls[i];
50
+ }
51
  }
52
  </script>";
53
 
js/admin.js CHANGED
@@ -32,16 +32,19 @@ jQuery(document).ready(function($) {
32
  var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
33
  $.each(res.responses, function() {
34
  switch(this.what) {
35
- case 'translations':
36
- jQuery('#post-translations').html(this.data); // translations fields
37
  break;
38
- case 'taxonomy':
39
  var tax = this.data;
40
  jQuery('#' + tax + 'checklist').html(this.supplemental.all);
41
  jQuery('#' + tax + 'checklist-pop').html(this.supplemental.populars);
42
  jQuery('#new' + tax + '_parent').replaceWith(this.supplemental.dropdown);
43
  jQuery('#' + tax + '-lang').val(jQuery('#post_lang_choice').attr('value')); // hidden field
44
  break;
 
 
 
45
  default:
46
  break;
47
  }
@@ -99,10 +102,11 @@ jQuery(document).ready(function($) {
99
  });
100
 
101
  // languages form
 
102
  jQuery('#lang_list').change(function() {
103
- value = jQuery(this).attr('value');
104
- jQuery('input[name="slug"]').val(value.substr(0, 2));
105
- jQuery('input[name="description"]').val(value.substr(3, 5));
106
  jQuery('input[name="name"]').val($("select option:selected").text());
107
  });
108
 
32
  var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
33
  $.each(res.responses, function() {
34
  switch(this.what) {
35
+ case 'translations': // translations fields
36
+ jQuery('#post-translations').html(this.data);
37
  break;
38
+ case 'taxonomy': // categories metabox for posts
39
  var tax = this.data;
40
  jQuery('#' + tax + 'checklist').html(this.supplemental.all);
41
  jQuery('#' + tax + 'checklist-pop').html(this.supplemental.populars);
42
  jQuery('#new' + tax + '_parent').replaceWith(this.supplemental.dropdown);
43
  jQuery('#' + tax + '-lang').val(jQuery('#post_lang_choice').attr('value')); // hidden field
44
  break;
45
+ case 'pages': // parent dropdown list for pages
46
+ jQuery('#parent_id').replaceWith(this.data);
47
+ break;
48
  default:
49
  break;
50
  }
102
  });
103
 
104
  // languages form
105
+ // fills the fields based on dropdown list choice
106
  jQuery('#lang_list').change(function() {
107
+ value = jQuery(this).attr('value').split('-');
108
+ jQuery('input[name="slug"]').val(value[0]);
109
+ jQuery('input[name="description"]').val(value[1]);
110
  jQuery('input[name="name"]').val($("select option:selected").text());
111
  });
112
 
languages/polylang-de_DE.mo CHANGED
Binary file
languages/polylang-de_DE.po CHANGED
@@ -1,369 +1,421 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: polylang\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-12-05 20:53+0100\n"
6
- "PO-Revision-Date: \n"
7
- "Last-Translator: Christian Ries <christian_ries@internet.lu>\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; 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;_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"
16
- "X-Poedit-Basepath: .\n"
17
- "X-Textdomain-Support: yes\n"
18
- "X-Poedit-SearchPath-0: ..\n"
19
-
20
- # @ polylang
21
- #: ../polylang.php:169
22
- msgid "Error: Upgrade directory doesn't exist!"
23
- msgstr "Fehler: Upgrade-Verzeichnis existiert nicht!"
24
-
25
- # @ polylang
26
- #: ../polylang.php:170
27
- msgid "Please create"
28
- msgstr "Bitte erzeugen"
29
-
30
- # @ polylang
31
- #: ../polylang.php:177
32
- msgid "Error: Backup of local flags failed!"
33
- msgstr "Fehler: Sicherungskopie der lokalen Fahnen fehlgeschlagen!"
34
-
35
- # @ polylang
36
- #: ../polylang.php:178
37
- msgid "Please backup"
38
- msgstr "Bitte machen Sie eine Sicherheitskopie ihrer Daten"
39
-
40
- # @ polylang
41
- #: ../polylang.php:193
42
- msgid "Error: Restore of local flags failed!"
43
- msgstr "Fehler: Wiederherstellung der lokalen Fahnen fehlgeschlagen!"
44
-
45
- # @ polylang
46
- #: ../polylang.php:194
47
- msgid "Please restore your local flags"
48
- msgstr "Bitte stellen Sie ihre lokalen Fahnen wieder her."
49
-
50
- # @ polylang
51
- #: ../include/edit-term-form.php:6
52
- #: ../include/term-translations.php:15
53
- #: ../include/admin-filters.php:91
54
- #: ../include/admin-filters.php:327
55
- #: ../include/add-term-form.php:5
56
- #: ../include/list-table.php:12
57
- msgid "Language"
58
- msgstr "Sprache"
59
-
60
- # @ polylang
61
- #: ../include/edit-term-form.php:19
62
- #: ../include/add-term-form.php:13
63
- msgid "Sets the language"
64
- msgstr "definiert die Sprache"
65
-
66
- # @ polylang
67
- #: ../include/widget.php:6
68
- msgid "Language Switcher"
69
- msgstr "Sprachenumschalter"
70
-
71
- # @ polylang
72
- #: ../include/widget.php:6
73
- msgid "Displays a language switcher"
74
- msgstr "Zeigt einen Sprachenumschalter"
75
-
76
- # @ polylang
77
- #: ../include/widget.php:62
78
- msgid "Title:"
79
- msgstr "Titel :"
80
-
81
- # @ polylang
82
- #: ../include/widget.php:65
83
- #: ../include/admin.php:236
84
- msgid "Displays language names"
85
- msgstr "Darstellung der Namen der Sprachen"
86
-
87
- # @ polylang
88
- #: ../include/widget.php:66
89
- #: ../include/admin.php:237
90
- msgid "Displays flags"
91
- msgstr "Darstellung der Fahnen"
92
-
93
- # @ polylang
94
- #: ../include/widget.php:67
95
- msgid "Displays as dropdown"
96
- msgstr "Als Auswahlbox darstellen"
97
-
98
- # @ polylang
99
- #: ../include/widget.php:68
100
- #: ../include/admin.php:238
101
- msgid "Forces link to front page"
102
- msgstr "Erzwingt einen Link zur Startseite"
103
-
104
- # @ default
105
- # @ polylang
106
- #: ../include/admin.php:21
107
- #: ../include/admin.php:209
108
- msgid "Settings"
109
- msgstr "Einstellungen"
110
-
111
- # @ polylang
112
- #: ../include/admin.php:28
113
- #: ../include/admin.php:207
114
- #: ../include/admin-filters.php:135
115
- #: ../include/list-table.php:13
116
- msgid "Languages"
117
- msgstr "Sprachen"
118
-
119
- # @ polylang
120
- #: ../include/admin.php:208
121
- msgid "Menus"
122
- msgstr "Menüs"
123
-
124
- # @ polylang
125
- #: ../include/admin.php:225
126
- msgid "Enter a valid WorPress locale"
127
- msgstr "Bitte geben Sie eine gültige Sprachdatei an"
128
-
129
- # @ polylang
130
- #: ../include/admin.php:226
131
- msgid "The language code must be 2 characters long"
132
- msgstr "Der Sprachcode muss 2 Buchstaben betragen"
133
-
134
- # @ polylang
135
- #: ../include/admin.php:227
136
- msgid "The language code must be unique"
137
- msgstr "Der Sprachcode muss eindeutig sein"
138
-
139
- # @ polylang
140
- #: ../include/admin.php:228
141
- msgid "The language must have a name"
142
- msgstr "Die Sprache muss einen Namen haben"
143
-
144
- # @ polylang
145
- #: ../include/admin.php:235
146
- msgid "Displays a language switcher at the end of the menu"
147
- msgstr "Zeigt einen Sprachenumschalter am Ende des Menüs"
148
-
149
- # @ polylang
150
- #: ../include/post-metabox.php:5
151
- msgid "Page's language:"
152
- msgstr "Sprache der Seite :"
153
-
154
- # @ polylang
155
- #: ../include/post-metabox.php:5
156
- msgid "Post's language:"
157
- msgstr "Sprache des Artikels :"
158
-
159
- # @ polylang
160
- #: ../include/term-translations.php:6
161
- #: ../include/term-translations.php:11
162
- msgid "Translations"
163
- msgstr "Übersetzungen"
164
-
165
- # @ polylang
166
- #: ../include/term-translations.php:15
167
- msgid "Translation"
168
- msgstr "Übersetzung"
169
-
170
- # @ polylang
171
- #: ../include/term-translations.php:15
172
- #: ../include/term-translations.php:76
173
- #: ../include/list-table.php:33
174
- msgid "Edit"
175
- msgstr "Bearbeiten"
176
-
177
- # @ polylang
178
- #: ../include/term-translations.php:62
179
- msgid "Add new"
180
- msgstr "Hinzufügen"
181
-
182
- # @ polylang
183
- #: ../include/admin-filters.php:123
184
- msgid "Show all languages"
185
- msgstr "Alle Sprachen anzeigen"
186
-
187
- # @ polylang
188
- #: ../include/admin-filters.php:400
189
- msgid "Theme locations and languages"
190
- msgstr "Verortung der Vorlage und Sprachen"
191
-
192
- # @ polylang
193
- #: ../include/admin-filters.php:405
194
- #, php-format
195
- msgid "Please go to the %slanguages page%s to set theme locations and languages"
196
- msgstr "Du solltest zur %sSprachenseite%s gehen, um die Verortung der Vorlage und die Sprachen einzustellen."
197
-
198
- # @ polylang
199
- #: ../include/admin-filters.php:416
200
- msgid "The widget is displayed for:"
201
- msgstr "Zeigt das Widget für :"
202
-
203
- # @ polylang
204
- #: ../include/admin-filters.php:417
205
- msgid "All languages"
206
- msgstr "Alle Sprachen"
207
-
208
- # @ polylang
209
- #: ../include/list-table.php:34
210
- msgid "Delete"
211
- msgstr "Löschen"
212
-
213
- # @ polylang
214
- #: ../include/list-table.php:52
215
- #: ../include/languages-form.php:66
216
- msgid "Full name"
217
- msgstr "Name"
218
-
219
- # @ polylang
220
- #: ../include/list-table.php:53
221
- #: ../include/languages-form.php:72
222
- msgid "Locale"
223
- msgstr "Sprachdatei"
224
-
225
- # @ polylang
226
- #: ../include/list-table.php:54
227
- msgid "Code"
228
- msgstr "Code"
229
-
230
- # @ polylang
231
- #: ../include/list-table.php:55
232
- msgid "Flag"
233
- msgstr "Fahne"
234
-
235
- # @ polylang
236
- #: ../include/list-table.php:56
237
- msgid "Posts"
238
- msgstr "Artikel"
239
-
240
- # @ default
241
- #: ../include/calendar.php:99
242
- #, php-format
243
- msgctxt "calendar caption"
244
- msgid "%1$s %2$s"
245
- msgstr "%1$s %2$s"
246
-
247
- # @ default
248
- #: ../include/calendar.php:125
249
- #: ../include/calendar.php:133
250
- #, php-format
251
- msgid "View posts for %1$s %2$s"
252
- msgstr "Siehe Artikel für %1$s %2$s"
253
-
254
- # @ polylang
255
- #: ../include/languages-form.php:33
256
- msgid "Edit language"
257
- msgstr "Sprache bearbeiten"
258
-
259
- # @ polylang
260
- #: ../include/languages-form.php:33
261
- #: ../include/languages-form.php:83
262
- msgid "Add new language"
263
- msgstr "Neue Sprache hinzufügen"
264
-
265
- # @ polylang
266
- #: ../include/languages-form.php:54
267
- msgid "Choose a language"
268
- msgstr "Sprache auswählen"
269
-
270
- # @ polylang
271
- #: ../include/languages-form.php:62
272
- msgid "You can choose a language in the list or directly edit it below."
273
- msgstr "Du kannst eine Sprache in der Liste auswählen oder sie unten direkt bearbeiten."
274
-
275
- # @ polylang
276
- #: ../include/languages-form.php:68
277
- msgid "The name is how it is displayed on your site (for example: English)."
278
- msgstr "Dieser Name wird dann auf der Website angezeigt (beispielsweise : Deutsch)"
279
-
280
- # @ polylang
281
- #: ../include/languages-form.php:74
282
- msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
283
- msgstr "Wordpress Sprachdatei für die Sprache (beispielweise : de_DE). Du musst die .mo-Datei für diese Sprache installieren."
284
-
285
- # @ polylang
286
- #: ../include/languages-form.php:78
287
- msgid "Language code"
288
- msgstr "Sprachcode"
289
-
290
- # @ polylang
291
- #: ../include/languages-form.php:80
292
- msgid "2-letters ISO 639-1 language code (for example: en)"
293
- msgstr "2 Buchstaben ISO 639-1 Sprachcode (beispielsweise : de)"
294
-
295
- # @ default
296
- #: ../include/languages-form.php:83
297
- msgid "Update"
298
- msgstr "Aktualisieren"
299
-
300
- # @ polylang
301
- #: ../include/languages-form.php:131
302
- msgid "Language switcher"
303
- msgstr "Sprachenumschalter"
304
-
305
- # @ polylang
306
- #: ../include/languages-form.php:158
307
- msgid "Default language"
308
- msgstr "Standardsprache"
309
-
310
- # @ polylang
311
- #: ../include/languages-form.php:187
312
- msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
313
- msgstr "Es gibt Artikel, Seite, Kategorien oder Schlagwörter ohne Spracheinstellung. Willst du alle auf die Standardsprache einstellen ?"
314
-
315
- # @ polylang
316
- #: ../include/languages-form.php:195
317
- msgid "Detect browser language"
318
- msgstr "Browsersprache erkennen"
319
-
320
- # @ polylang
321
- #: ../include/languages-form.php:201
322
- msgid "When the front page is visited, set the language according to the browser preference"
323
- msgstr "Beim Besuch der Startseite erscheint sie in der Standardsprache des Browsers"
324
-
325
- # @ polylang
326
- #: ../include/languages-form.php:208
327
- msgid "URL modifications"
328
- msgstr "URL-Veränderungen"
329
-
330
- # @ polylang
331
- #: ../include/languages-form.php:214
332
- msgid "Keep /language/ in pretty permalinks. Example:"
333
- msgstr "/language/ in schönen Permalinks behalten. Zum Beispiel :"
334
-
335
- # @ polylang
336
- #: ../include/languages-form.php:222
337
- msgid "Remove /language/ in pretty permalinks. Example:"
338
- msgstr "/language/ in Permalinks entfernen. Zum Beispiel :"
339
-
340
- # @ polylang
341
- #: ../include/languages-form.php:230
342
- msgid "Hide URL language information for default language"
343
- msgstr "URL Informationen für die Standardsprache verstecken"
344
-
345
- # @ polylang
346
- #: ../include/post-translations.php:1
347
- msgid "ID of pages in other languages:"
348
- msgstr "ID der Seiten in anderen Sprachen :"
349
-
350
- # @ polylang
351
- #: ../include/post-translations.php:1
352
- msgid "ID of posts in other languages:"
353
- msgstr "ID der Artikel in anderen Sprachen :"
354
-
355
- # @ polylang
356
- #: ../include/post-translations.php:5
357
- msgid "Page ID"
358
- msgstr "ID der Seite"
359
-
360
- # @ polylang
361
- #: ../include/post-translations.php:5
362
- msgid "Post ID"
363
- msgstr "Artikel-ID"
364
-
365
- # @ polylang
366
- #: ../include/personal-options.php:5
367
- msgid "Admin language"
368
- msgstr "Adminsprache"
369
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: polylang\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-12-05 20:53+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Christian Ries <christian.ries@singbyfoot.lu>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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"
15
+ "X-Poedit-Basepath: .\n"
16
+ "X-Textdomain-Support: yes\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+
19
+ #@ polylang
20
+ #: polylang.php:170
21
+ msgid "Error: Restore of local flags failed!"
22
+ msgstr "Fehler: Wiederherstellung der lokalen Fahnen fehlgeschlagen!"
23
+
24
+ #@ polylang
25
+ #: include/add-term-form.php:5
26
+ #: include/edit-term-form.php:6
27
+ #: include/list-table.php:12
28
+ #: include/post-translations.php:4
29
+ #: include/term-translations.php:15
30
+ msgid "Language"
31
+ msgstr "Sprache"
32
+
33
+ #@ polylang
34
+ #: include/add-term-form.php:17
35
+ #: include/edit-term-form.php:19
36
+ msgid "Sets the language"
37
+ msgstr "definiert die Sprache"
38
+
39
+ #@ polylang
40
+ #: include/widget.php:6
41
+ msgid "Language Switcher"
42
+ msgstr "Sprachenumschalter"
43
+
44
+ #@ polylang
45
+ #: include/widget.php:6
46
+ msgid "Displays a language switcher"
47
+ msgstr "Zeigt einen Sprachenumschalter"
48
+
49
+ #@ polylang
50
+ #: include/widget.php:74
51
+ msgid "Title:"
52
+ msgstr "Titel :"
53
+
54
+ #@ polylang
55
+ #: include/admin.php:296
56
+ #: include/widget.php:77
57
+ msgid "Displays language names"
58
+ msgstr "Darstellung der Namen der Sprachen"
59
+
60
+ #@ polylang
61
+ #: include/admin.php:297
62
+ #: include/widget.php:78
63
+ msgid "Displays flags"
64
+ msgstr "Darstellung der Fahnen"
65
+
66
+ #@ polylang
67
+ #: include/widget.php:79
68
+ msgid "Displays as dropdown"
69
+ msgstr "Als Auswahlbox darstellen"
70
+
71
+ #@ polylang
72
+ #: include/admin.php:298
73
+ #: include/widget.php:80
74
+ msgid "Forces link to front page"
75
+ msgstr "Erzwingt einen Link zur Startseite"
76
+
77
+ #@ default
78
+ #@ polylang
79
+ #: include/admin.php:21
80
+ #: include/admin.php:266
81
+ msgid "Settings"
82
+ msgstr "Einstellungen"
83
+
84
+ #@ polylang
85
+ #: include/admin-filters.php:164
86
+ #: include/admin.php:28
87
+ #: include/admin.php:263
88
+ #: include/list-table.php:13
89
+ msgid "Languages"
90
+ msgstr "Sprachen"
91
+
92
+ #@ polylang
93
+ #: include/admin.php:264
94
+ msgid "Menus"
95
+ msgstr "Menüs"
96
+
97
+ #@ polylang
98
+ #: include/admin.php:284
99
+ msgid "Enter a valid WorPress locale"
100
+ msgstr "Bitte geben Sie eine gültige Sprachdatei an"
101
+
102
+ #@ polylang
103
+ #: include/admin.php:285
104
+ msgid "The language code must be 2 characters long"
105
+ msgstr "Der Sprachcode muss 2 Buchstaben betragen"
106
+
107
+ #@ polylang
108
+ #: include/admin.php:286
109
+ msgid "The language code must be unique"
110
+ msgstr "Der Sprachcode muss eindeutig sein"
111
+
112
+ #@ polylang
113
+ #: include/admin.php:287
114
+ msgid "The language must have a name"
115
+ msgstr "Die Sprache muss einen Namen haben"
116
+
117
+ #@ polylang
118
+ #: include/admin.php:295
119
+ msgid "Displays a language switcher at the end of the menu"
120
+ msgstr "Zeigt einen Sprachenumschalter am Ende des Menüs"
121
+
122
+ #@ polylang
123
+ #: include/post-metabox.php:5
124
+ msgid "Page's language:"
125
+ msgstr "Sprache der Seite :"
126
+
127
+ #@ polylang
128
+ #: include/post-metabox.php:5
129
+ msgid "Post's language:"
130
+ msgstr "Sprache des Artikels :"
131
+
132
+ #@ polylang
133
+ #: include/list-table.php:128
134
+ #: include/term-translations.php:6
135
+ #: include/term-translations.php:11
136
+ msgid "Translations"
137
+ msgstr "Übersetzungen"
138
+
139
+ #@ polylang
140
+ #: include/term-translations.php:16
141
+ msgid "Translation"
142
+ msgstr "Übersetzung"
143
+
144
+ #@ polylang
145
+ #: include/list-table.php:26
146
+ #: include/post-translations.php:6
147
+ #: include/post-translations.php:27
148
+ #: include/term-translations.php:18
149
+ #: include/term-translations.php:65
150
+ msgid "Edit"
151
+ msgstr "Bearbeiten"
152
+
153
+ #@ polylang
154
+ #: include/post-translations.php:32
155
+ #: include/term-translations.php:54
156
+ msgid "Add new"
157
+ msgstr "Hinzufügen"
158
+
159
+ #@ polylang
160
+ #: include/admin-filters.php:152
161
+ msgid "Show all languages"
162
+ msgstr "Alle Sprachen anzeigen"
163
+
164
+ #@ polylang
165
+ #: include/admin-filters.php:577
166
+ msgid "Theme locations and languages"
167
+ msgstr "Verortung der Vorlage und Sprachen"
168
+
169
+ #@ polylang
170
+ #: include/admin-filters.php:582
171
+ #, php-format
172
+ msgid "Please go to the %slanguages page%s to set theme locations and languages"
173
+ msgstr "Du solltest zur %sSprachenseite%s gehen, um die Verortung der Vorlage und die Sprachen einzustellen."
174
+
175
+ #@ polylang
176
+ #: include/admin-filters.php:593
177
+ msgid "The widget is displayed for:"
178
+ msgstr "Zeigt das Widget für :"
179
+
180
+ #@ polylang
181
+ #: include/admin-filters.php:594
182
+ msgid "All languages"
183
+ msgstr "Alle Sprachen"
184
+
185
+ #@ polylang
186
+ #: include/list-table.php:27
187
+ msgid "Delete"
188
+ msgstr "Löschen"
189
+
190
+ #@ polylang
191
+ #: include/languages-form.php:67
192
+ #: include/list-table.php:45
193
+ msgid "Full name"
194
+ msgstr "Name"
195
+
196
+ #@ polylang
197
+ #: include/languages-form.php:73
198
+ #: include/list-table.php:46
199
+ msgid "Locale"
200
+ msgstr "Sprachdatei"
201
+
202
+ #@ polylang
203
+ #: include/list-table.php:47
204
+ msgid "Code"
205
+ msgstr "Code"
206
+
207
+ #@ polylang
208
+ #: include/list-table.php:49
209
+ msgid "Flag"
210
+ msgstr "Fahne"
211
+
212
+ #@ polylang
213
+ #: include/list-table.php:50
214
+ msgid "Posts"
215
+ msgstr "Artikel"
216
+
217
+ #@ default
218
+ #. translators: Calendar caption: 1: month name, 2: 4-digit year
219
+ #: include/calendar.php:107
220
+ #, php-format
221
+ msgctxt "calendar caption"
222
+ msgid "%1$s %2$s"
223
+ msgstr "%1$s %2$s"
224
+
225
+ #@ default
226
+ #: include/calendar.php:133
227
+ #: include/calendar.php:141
228
+ #, php-format
229
+ msgid "View posts for %1$s %2$s"
230
+ msgstr "Siehe Artikel für %1$s %2$s"
231
+
232
+ #@ polylang
233
+ #: include/languages-form.php:33
234
+ msgid "Edit language"
235
+ msgstr "Sprache bearbeiten"
236
+
237
+ #@ polylang
238
+ #: include/languages-form.php:33
239
+ #: include/languages-form.php:91
240
+ msgid "Add new language"
241
+ msgstr "Neue Sprache hinzufügen"
242
+
243
+ #@ polylang
244
+ #: include/languages-form.php:55
245
+ msgid "Choose a language"
246
+ msgstr "Sprache auswählen"
247
+
248
+ #@ polylang
249
+ #: include/languages-form.php:63
250
+ msgid "You can choose a language in the list or directly edit it below."
251
+ msgstr "Du kannst eine Sprache in der Liste auswählen oder sie unten direkt bearbeiten."
252
+
253
+ #@ polylang
254
+ #: include/languages-form.php:69
255
+ msgid "The name is how it is displayed on your site (for example: English)."
256
+ msgstr "Dieser Name wird dann auf der Website angezeigt (beispielsweise : Deutsch)"
257
+
258
+ #@ polylang
259
+ #: include/languages-form.php:76
260
+ msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
261
+ msgstr "Wordpress Sprachdatei für die Sprache (beispielweise : de_DE). Du musst die .mo-Datei für diese Sprache installieren."
262
+
263
+ #@ polylang
264
+ #: include/languages-form.php:80
265
+ msgid "Language code"
266
+ msgstr "Sprachcode"
267
+
268
+ #@ polylang
269
+ #: include/languages-form.php:82
270
+ msgid "2-letters ISO 639-1 language code (for example: en)"
271
+ msgstr "2 Buchstaben ISO 639-1 Sprachcode (beispielsweise : de)"
272
+
273
+ #@ default
274
+ #: include/languages-form.php:91
275
+ msgid "Update"
276
+ msgstr "Aktualisieren"
277
+
278
+ #@ polylang
279
+ #: include/languages-form.php:127
280
+ msgid "Language switcher"
281
+ msgstr "Sprachenumschalter"
282
+
283
+ #@ polylang
284
+ #: include/languages-form.php:166
285
+ msgid "Default language"
286
+ msgstr "Standardsprache"
287
+
288
+ #@ polylang
289
+ #: include/languages-form.php:195
290
+ msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
291
+ msgstr "Es gibt Artikel, Seite, Kategorien oder Schlagwörter ohne Spracheinstellung. Willst du alle auf die Standardsprache einstellen ?"
292
+
293
+ #@ polylang
294
+ #: include/languages-form.php:203
295
+ msgid "Detect browser language"
296
+ msgstr "Browsersprache erkennen"
297
+
298
+ #@ polylang
299
+ #: include/languages-form.php:209
300
+ msgid "When the front page is visited, set the language according to the browser preference"
301
+ msgstr "Beim Besuch der Startseite erscheint sie in der Standardsprache des Browsers"
302
+
303
+ #@ polylang
304
+ #: include/languages-form.php:216
305
+ msgid "URL modifications"
306
+ msgstr "URL-Veränderungen"
307
+
308
+ #@ polylang
309
+ #: include/languages-form.php:222
310
+ msgid "Keep /language/ in pretty permalinks. Example:"
311
+ msgstr "/language/ in schönen Permalinks behalten. Zum Beispiel :"
312
+
313
+ #@ polylang
314
+ #: include/languages-form.php:230
315
+ msgid "Remove /language/ in pretty permalinks. Example:"
316
+ msgstr "/language/ in Permalinks entfernen. Zum Beispiel :"
317
+
318
+ #@ polylang
319
+ #: include/languages-form.php:238
320
+ msgid "Hide URL language information for default language"
321
+ msgstr "URL Informationen für die Standardsprache verstecken"
322
+
323
+ #@ polylang
324
+ #: include/post-translations.php:1
325
+ msgid "ID of pages in other languages:"
326
+ msgstr "ID der Seiten in anderen Sprachen :"
327
+
328
+ #@ polylang
329
+ #: include/post-translations.php:1
330
+ msgid "ID of posts in other languages:"
331
+ msgstr "ID der Artikel in anderen Sprachen :"
332
+
333
+ #@ polylang
334
+ #: include/post-translations.php:5
335
+ msgid "Page ID"
336
+ msgstr "ID der Seite"
337
+
338
+ #@ polylang
339
+ #: include/post-translations.php:5
340
+ msgid "Post ID"
341
+ msgstr "Artikel-ID"
342
+
343
+ #@ polylang
344
+ #: include/personal-options.php:5
345
+ msgid "Admin language"
346
+ msgstr "Adminsprache"
347
+
348
+ #@ polylang
349
+ #: include/admin-filters.php:128
350
+ #: include/admin-filters.php:482
351
+ msgid "Add new translation"
352
+ msgstr "Neue Übersetzung hinzufügen"
353
+
354
+ #@ default
355
+ #: include/admin-filters.php:238
356
+ msgid "(no parent)"
357
+ msgstr "(kein Elternteil)"
358
+
359
+ #@ polylang
360
+ #: include/admin.php:265
361
+ #: include/list-table.php:104
362
+ msgid "Strings translation"
363
+ msgstr "Übersetung von Sätzen"
364
+
365
+ #@ polylang
366
+ #: include/admin.php:288
367
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
368
+ msgstr "Die Sprache wurde erstellt, aber die WordPress Sprachdatei wurde nicht heruntergeladen. Bitte händisch installieren."
369
+
370
+ #@ default
371
+ #: include/admin.php:311
372
+ msgid "Site Title"
373
+ msgstr "Titel der Website"
374
+
375
+ #@ default
376
+ #: include/admin.php:312
377
+ msgid "Tagline"
378
+ msgstr "Tagline"
379
+
380
+ #@ default
381
+ #: include/admin.php:328
382
+ msgid "Widget title"
383
+ msgstr "Titel des Widgets"
384
+
385
+ #@ polylang
386
+ #: include/languages-form.php:86
387
+ #: include/list-table.php:48
388
+ msgid "Order"
389
+ msgstr "Reihenfolge"
390
+
391
+ #@ polylang
392
+ #: include/languages-form.php:88
393
+ msgid "Position of the language in the language switcher"
394
+ msgstr "Position der Sprache im Sprachenumschalter"
395
+
396
+ #@ polylang
397
+ #: include/list-table.php:105
398
+ msgid "Strings translations"
399
+ msgstr "Übersetungen von Sätzen"
400
+
401
+ #@ polylang
402
+ #: include/list-table.php:126
403
+ msgid "Name"
404
+ msgstr "Name"
405
+
406
+ #@ polylang
407
+ #: include/list-table.php:127
408
+ msgid "String"
409
+ msgstr "Zeichenfolge"
410
+
411
+ #@ polylang
412
+ #: include/term-translations.php:48
413
+ msgid "No untranslated term"
414
+ msgstr "Kein unübersetzter Ausdruck"
415
+
416
+ #@ polylang
417
+ #: polylang.php:171
418
+ #, php-format
419
+ msgid "Please move your local flags from %s to %s"
420
+ msgstr "Bitte entfernen Sie Ihre lokalen Flaggen von %s bis %s"
421
+
languages/polylang-el.mo ADDED
Binary file
languages/polylang-el.po ADDED
@@ -0,0 +1,354 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Theodotos Andreou <theo@ubuntucy.org>, 2012.
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: polylang\n"
5
+ "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2012-01-03 20:07+0100\n"
7
+ "PO-Revision-Date: 2012-01-05 10:03+0300\n"
8
+ "Last-Translator: Theodotos Andreou <theo@ubuntucy.org>\n"
9
+ "Language-Team: Cyprus Ubuntu Loco Team (www.ubuntucy.org)\n"
10
+ "Language: el\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Generator: Virtaal 0.7.0\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-KeywordsList: _e;__;_x\n"
18
+ "X-Poedit-Basepath: .\n"
19
+ "X-Poedit-SearchPath-0: ..\n"
20
+ "X-Poedit-SearchPath-1: ../include\n"
21
+
22
+ #: ../polylang.php:170
23
+ msgid "Error: Restore of local flags failed!"
24
+ msgstr "Σφάλμα: αποτυχία επαναφοράς των τοπικών σημαιών!"
25
+
26
+ #: ../polylang.php:171
27
+ #, php-format
28
+ msgid "Please move your local flags from %s to %s"
29
+ msgstr "Παρακαλώ μετακινήστε τις τοπικές σημαίες σας από %s σε %s"
30
+
31
+ #: ../include/edit-term-form.php:6
32
+ #: ../include/term-translations.php:15
33
+ #: ../include/add-term-form.php:5
34
+ #: ../include/list-table.php:12
35
+ msgid "Language"
36
+ msgstr "Γλώσσα"
37
+
38
+ #: ../include/edit-term-form.php:19
39
+ #: ../include/add-term-form.php:17
40
+ msgid "Sets the language"
41
+ msgstr "Ορισμός γλώσσας"
42
+
43
+ #: ../include/widget.php:6
44
+ msgid "Language Switcher"
45
+ msgstr "Επιλογέας γλώσσας"
46
+
47
+ #: ../include/widget.php:6
48
+ msgid "Displays a language switcher"
49
+ msgstr "Εμφάνιση επιλογέα γλώσσας"
50
+
51
+ #: ../include/widget.php:74
52
+ msgid "Title:"
53
+ msgstr "Τίτλος:"
54
+
55
+ #: ../include/widget.php:77
56
+ #: ../include/admin.php:296
57
+ msgid "Displays language names"
58
+ msgstr "Εμφάνιση ονομάτων γλώσσας"
59
+
60
+ #: ../include/widget.php:78
61
+ #: ../include/admin.php:297
62
+ msgid "Displays flags"
63
+ msgstr "Εμφάνιση σημαιών"
64
+
65
+ #: ../include/widget.php:79
66
+ msgid "Displays as dropdown"
67
+ msgstr "Εμφάνιση σαν κυλιόμενο μενού"
68
+
69
+ #: ../include/widget.php:80
70
+ #: ../include/admin.php:298
71
+ msgid "Forces link to front page"
72
+ msgstr "Υποχρεωτική παραπομπή συνδέσμου στην αρχική σελίδα"
73
+
74
+ #: ../include/admin.php:21
75
+ #: ../include/admin.php:266
76
+ msgid "Settings"
77
+ msgstr "Ρυθμίσεις"
78
+
79
+ #: ../include/admin.php:28
80
+ #: ../include/admin.php:263
81
+ #: ../include/admin-filters.php:164
82
+ #: ../include/list-table.php:13
83
+ msgid "Languages"
84
+ msgstr "Γλώσσες"
85
+
86
+ #: ../include/admin.php:264
87
+ msgid "Menus"
88
+ msgstr "Μενού"
89
+
90
+ #: ../include/admin.php:265
91
+ #: ../include/list-table.php:104
92
+ msgid "Strings translation"
93
+ msgstr "Μετάφραση συμβολοσειρών"
94
+
95
+ #: ../include/admin.php:284
96
+ msgid "Enter a valid WorPress locale"
97
+ msgstr "Εισάγετε μια έγκυρη τοπιοποίηση Wordpress"
98
+
99
+ #: ../include/admin.php:285
100
+ msgid "The language code must be 2 characters long"
101
+ msgstr "Ο κώδικας γλώσσας θα πρέπει να είναι 2 χαρακτήρες"
102
+
103
+ #: ../include/admin.php:286
104
+ msgid "The language code must be unique"
105
+ msgstr "Ο κώδικας γλώσσας θα πρέπει να είναι μοναδικός"
106
+
107
+ #: ../include/admin.php:287
108
+ msgid "The language must have a name"
109
+ msgstr "Η γλώσσα πρέπει να έχει όνομα"
110
+
111
+ #: ../include/admin.php:288
112
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
113
+ msgstr ""
114
+ "Η γλώσσα δημιουργήθηκε αλλά το αρχείο γλώσσας του Wordpress δεν έχει "
115
+ "κατέβει. Παρακαλώ εγκαταστήστε το εσείς."
116
+
117
+ #: ../include/admin.php:295
118
+ msgid "Displays a language switcher at the end of the menu"
119
+ msgstr "Εμφάνιση επιλογέα γλώσσας στο τέλος του μενού"
120
+
121
+ #: ../include/admin.php:311
122
+ msgid "Site Title"
123
+ msgstr "Τίτλος ιστοσελίδας"
124
+
125
+ #: ../include/admin.php:312
126
+ msgid "Tagline"
127
+ msgstr "Υπότιτλος"
128
+
129
+ #: ../include/admin.php:328
130
+ msgid "Widget title"
131
+ msgstr "Τίτλος μονάδας"
132
+
133
+ #: ../include/post-metabox.php:5
134
+ msgid "Page's language:"
135
+ msgstr "Γλώσσα σελίδας:"
136
+
137
+ #: ../include/post-metabox.php:5
138
+ msgid "Post's language:"
139
+ msgstr "Γλώσσα άρθρου:"
140
+
141
+ #: ../include/term-translations.php:6
142
+ #: ../include/term-translations.php:11
143
+ #: ../include/list-table.php:128
144
+ msgid "Translations"
145
+ msgstr "Μεταφράσεις"
146
+
147
+ #: ../include/term-translations.php:16
148
+ msgid "Translation"
149
+ msgstr "Μετάφραση"
150
+
151
+ #: ../include/term-translations.php:18
152
+ #: ../include/term-translations.php:65
153
+ #: ../include/list-table.php:26
154
+ msgid "Edit"
155
+ msgstr "Επεξεργασία"
156
+
157
+ #: ../include/term-translations.php:48
158
+ msgid "No untranslated term"
159
+ msgstr "Απουσία αμετάφραστου όρου"
160
+
161
+ #: ../include/term-translations.php:54
162
+ msgid "Add new"
163
+ msgstr "Προσθήκη νέου"
164
+
165
+ #: ../include/admin-filters.php:128
166
+ #: ../include/admin-filters.php:482
167
+ msgid "Add new translation"
168
+ msgstr "Προσθήκη νέας μετάφρασης"
169
+
170
+ #: ../include/admin-filters.php:152
171
+ msgid "Show all languages"
172
+ msgstr "Εμφάνιση όλων των γλωσσών"
173
+
174
+ #: ../include/admin-filters.php:238
175
+ msgid "(no parent)"
176
+ msgstr "(απουσία μητρικού)"
177
+
178
+ #: ../include/admin-filters.php:577
179
+ msgid "Theme locations and languages"
180
+ msgstr "Γλώσσες και τοποθεσίες θεμάτων"
181
+
182
+ #: ../include/admin-filters.php:582
183
+ #, php-format
184
+ msgid "Please go to the %slanguages page%s to set theme locations and languages"
185
+ msgstr ""
186
+ "Παρακαλώ πηγαίνετε στην %sσελίδα γλώσσας%s για καθορισμό τοποθεσιών και "
187
+ "γλωσσών θέματος"
188
+
189
+ #: ../include/admin-filters.php:593
190
+ msgid "The widget is displayed for:"
191
+ msgstr "Η μονάδα εμφανίζεται για:"
192
+
193
+ #: ../include/admin-filters.php:594
194
+ msgid "All languages"
195
+ msgstr "Όλες οι γλώσσες"
196
+
197
+ #: ../include/list-table.php:27
198
+ msgid "Delete"
199
+ msgstr "Διαγραφή"
200
+
201
+ #: ../include/list-table.php:45
202
+ #: ../include/languages-form.php:67
203
+ msgid "Full name"
204
+ msgstr "Πλήρες όνομα"
205
+
206
+ #: ../include/list-table.php:46
207
+ #: ../include/languages-form.php:73
208
+ msgid "Locale"
209
+ msgstr "Τοπιοποίηση"
210
+
211
+ #: ../include/list-table.php:47
212
+ msgid "Code"
213
+ msgstr "Κώδικας"
214
+
215
+ #: ../include/list-table.php:48
216
+ #: ../include/languages-form.php:86
217
+ msgid "Order"
218
+ msgstr "Εντολή"
219
+
220
+ #: ../include/list-table.php:49
221
+ msgid "Flag"
222
+ msgstr "Σημαία"
223
+
224
+ #: ../include/list-table.php:50
225
+ msgid "Posts"
226
+ msgstr "Άρθρα"
227
+
228
+ #: ../include/list-table.php:105
229
+ msgid "Strings translations"
230
+ msgstr "Μετάφραση συμβολοσειρών"
231
+
232
+ #: ../include/list-table.php:126
233
+ msgid "Name"
234
+ msgstr "Όνομα"
235
+
236
+ #: ../include/list-table.php:127
237
+ msgid "String"
238
+ msgstr "Συμβολοσειρά"
239
+
240
+ #: ../include/calendar.php:107
241
+ #, php-format
242
+ msgid "%1$s %2$s"
243
+ msgstr "%1$s %2$s"
244
+
245
+ #: ../include/calendar.php:133
246
+ #: ../include/calendar.php:141
247
+ #, php-format
248
+ msgid "View posts for %1$s %2$s"
249
+ msgstr "Προβολή άρθρων για %1$s %2$s"
250
+
251
+ #: ../include/languages-form.php:33
252
+ msgid "Edit language"
253
+ msgstr "Επεξεργασία γλώσσας"
254
+
255
+ #: ../include/languages-form.php:33
256
+ #: ../include/languages-form.php:91
257
+ msgid "Add new language"
258
+ msgstr "Προσθήκη νέας γλώσσας"
259
+
260
+ #: ../include/languages-form.php:55
261
+ msgid "Choose a language"
262
+ msgstr "Επιλογή γλώσσας"
263
+
264
+ #: ../include/languages-form.php:63
265
+ msgid "You can choose a language in the list or directly edit it below."
266
+ msgstr ""
267
+ "Μπορείτε να επιλέξετε μια γλώσσα από την λίστα ή να την επεξεργαστείτε πιο "
268
+ "κάτω."
269
+
270
+ #: ../include/languages-form.php:69
271
+ msgid "The name is how it is displayed on your site (for example: English)."
272
+ msgstr "Το όνομα καθορίζει πως θα εμφανίζεται στην σελίδα σας (πχ: Ελληνικά)."
273
+
274
+ #: ../include/languages-form.php:76
275
+ msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
276
+ msgstr ""
277
+ "Τοπιοποίηση Wordpress για την γλώσσα (πχ: en_US). Θα χρειαστεί να "
278
+ "εγκαταστήσετε το αρχείο .mo για αυτή την γλώσσα."
279
+
280
+ #: ../include/languages-form.php:80
281
+ msgid "Language code"
282
+ msgstr "Κώδικας γλώσσας"
283
+
284
+ #: ../include/languages-form.php:82
285
+ msgid "2-letters ISO 639-1 language code (for example: en)"
286
+ msgstr "ISO 639-1 κώδικας γλώσσας 2 χαρακτήρων (πχ: en)"
287
+
288
+ #: ../include/languages-form.php:88
289
+ msgid "Position of the language in the language switcher"
290
+ msgstr "Θέση της γλώσσας στον επιλογέα γλώσσας"
291
+
292
+ #: ../include/languages-form.php:91
293
+ msgid "Update"
294
+ msgstr "Ενημέρωση"
295
+
296
+ #: ../include/languages-form.php:127
297
+ msgid "Language switcher"
298
+ msgstr "Επιλογέας γλώσσας"
299
+
300
+ #: ../include/languages-form.php:166
301
+ msgid "Default language"
302
+ msgstr "Προκαθορισμένη γλώσσα"
303
+
304
+ #: ../include/languages-form.php:195
305
+ msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
306
+ msgstr ""
307
+ "Υπάρχουν άρθρα, σελίδες, κατηγορίες ή ετικέτες χωρίς καθορισμό γλώσσας. "
308
+ "Θέλετε να οριστούν όλα στην προκαθορισμένη γλώσσα;"
309
+
310
+ #: ../include/languages-form.php:203
311
+ msgid "Detect browser language"
312
+ msgstr "Αναγνώριση γλώσσας φυλλομετρητή"
313
+
314
+ #: ../include/languages-form.php:209
315
+ msgid "When the front page is visited, set the language according to the browser preference"
316
+ msgstr ""
317
+ "Όταν καλείται η αρχική σελίδα, να καθορίζεται η γλώσσα βάση των προτιμήσεων "
318
+ "του φυλλομετρητή"
319
+
320
+ #: ../include/languages-form.php:216
321
+ msgid "URL modifications"
322
+ msgstr "Τροποποιήσεις URL"
323
+
324
+ #: ../include/languages-form.php:222
325
+ msgid "Keep /language/ in pretty permalinks. Example:"
326
+ msgstr "Διατήρηση /language/ σε ευδιάκριτους μόνιμους συνδέσμους. Παράδειγμα:"
327
+
328
+ #: ../include/languages-form.php:230
329
+ msgid "Remove /language/ in pretty permalinks. Example:"
330
+ msgstr "Αφαίρεση /language/ από ευδιάκριτους μόνιμους συνδέσμους. Παράδειγμα:"
331
+
332
+ #: ../include/languages-form.php:238
333
+ msgid "Hide URL language information for default language"
334
+ msgstr "Απόκρυψη των πληροφοριών γλώσσας από URL, για την προκαθορισμένη γλώσσα"
335
+
336
+ #: ../include/post-translations.php:1
337
+ msgid "ID of pages in other languages:"
338
+ msgstr "ID των σελίδων σε άλλες γλώσσες:"
339
+
340
+ #: ../include/post-translations.php:1
341
+ msgid "ID of posts in other languages:"
342
+ msgstr "ID των άρθρων σε άλλες γλώσσες:"
343
+
344
+ #: ../include/post-translations.php:5
345
+ msgid "Page ID"
346
+ msgstr "ID σελίδας"
347
+
348
+ #: ../include/post-translations.php:5
349
+ msgid "Post ID"
350
+ msgstr "ID άρθρου"
351
+
352
+ #: ../include/personal-options.php:5
353
+ msgid "Admin language"
354
+ msgstr "Γλώσσα διαχείρησης"
languages/polylang-fr_FR.mo CHANGED
Binary file
languages/polylang-fr_FR.po CHANGED
@@ -2,368 +2,423 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: polylang\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-12-05 20:53+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: F. Demarle\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; 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;_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"
16
  "X-Poedit-Basepath: .\n"
17
- "X-Textdomain-Support: yes\n"
18
  "X-Poedit-SearchPath-0: ..\n"
19
-
20
- # @ polylang
21
- #: ../polylang.php:169
22
- msgid "Error: Upgrade directory doesn't exist!"
23
- msgstr "Erreur : Le répertoire de mise à jour n'existe pas"
24
-
25
- # @ polylang
26
- #: ../polylang.php:170
27
- msgid "Please create"
28
- msgstr "Créez le répertoire"
29
-
30
- # @ polylang
31
- #: ../polylang.php:177
32
- msgid "Error: Backup of local flags failed!"
33
- msgstr "Erreur : La sauvegarde des drapeaux personnalisés a échoué"
34
-
35
- # @ polylang
36
- #: ../polylang.php:178
37
- msgid "Please backup"
38
- msgstr "Sauvegardez"
39
-
40
- # @ polylang
41
- #: ../polylang.php:193
42
- msgid "Error: Restore of local flags failed!"
43
- msgstr "Erreur : La restauration des drapeaux personnalisés a échoué"
44
-
45
- # @ polylang
46
- #: ../polylang.php:194
47
- msgid "Please restore your local flags"
48
- msgstr "Restaurez vos drapeaux personnalisés"
49
-
50
- # @ polylang
51
- #: ../include/edit-term-form.php:6
52
- #: ../include/term-translations.php:15
53
- #: ../include/admin-filters.php:91
54
- #: ../include/admin-filters.php:327
55
- #: ../include/add-term-form.php:5
56
- #: ../include/list-table.php:12
57
  msgid "Language"
58
  msgstr "Langue"
59
 
60
- # @ polylang
61
- #: ../include/edit-term-form.php:19
62
- #: ../include/add-term-form.php:13
63
  msgid "Sets the language"
64
  msgstr "Définit la langue"
65
 
66
- # @ polylang
67
- #: ../include/widget.php:6
68
  msgid "Language Switcher"
69
  msgstr "Liste des langues"
70
 
71
- # @ polylang
72
- #: ../include/widget.php:6
73
  msgid "Displays a language switcher"
74
  msgstr "Affiche la liste des langues"
75
 
76
- # @ polylang
77
- #: ../include/widget.php:62
78
  msgid "Title:"
79
- msgstr "Titre : truc"
80
 
81
- # @ polylang
82
- #: ../include/widget.php:65
83
- #: ../include/admin.php:236
84
  msgid "Displays language names"
85
  msgstr "Afficher le nom des langues"
86
 
87
- # @ polylang
88
- #: ../include/widget.php:66
89
- #: ../include/admin.php:237
90
  msgid "Displays flags"
91
  msgstr "Afficher les drapeaux"
92
 
93
- # @ polylang
94
- #: ../include/widget.php:67
95
  msgid "Displays as dropdown"
96
  msgstr "Afficher comme liste déroulante"
97
 
98
- # @ polylang
99
- #: ../include/widget.php:68
100
- #: ../include/admin.php:238
101
  msgid "Forces link to front page"
102
  msgstr "Force le lien vers la page d'accueil"
103
 
104
- # @ default
105
- # @ polylang
106
- #: ../include/admin.php:21
107
- #: ../include/admin.php:209
108
  msgid "Settings"
109
  msgstr "Réglages"
110
 
111
- # @ polylang
112
- #: ../include/admin.php:28
113
- #: ../include/admin.php:207
114
- #: ../include/admin-filters.php:135
115
- #: ../include/list-table.php:13
116
  msgid "Languages"
117
  msgstr "Langues"
118
 
119
- # @ polylang
120
- #: ../include/admin.php:208
121
  msgid "Menus"
122
  msgstr "Menus"
123
 
124
- # @ polylang
125
- #: ../include/admin.php:225
 
 
 
 
 
 
126
  msgid "Enter a valid WorPress locale"
127
  msgstr "Entrez un code local WordPress valide"
128
 
129
- # @ polylang
130
- #: ../include/admin.php:226
131
  msgid "The language code must be 2 characters long"
132
  msgstr "Le code de la langue doit avoir 2 lettres"
133
 
134
- # @ polylang
135
- #: ../include/admin.php:227
136
  msgid "The language code must be unique"
137
  msgstr "Le code de la langue doit être unique"
138
 
139
- # @ polylang
140
- #: ../include/admin.php:228
141
  msgid "The language must have a name"
142
  msgstr "La langue doit avoir un nom"
143
 
144
- # @ polylang
145
- #: ../include/admin.php:235
 
 
 
 
 
146
  msgid "Displays a language switcher at the end of the menu"
147
  msgstr "Affiche la liste des langues"
148
 
149
- # @ polylang
150
- #: ../include/post-metabox.php:5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  msgid "Page's language:"
152
  msgstr "Langue de la page"
153
 
154
- # @ polylang
155
- #: ../include/post-metabox.php:5
156
  msgid "Post's language:"
157
  msgstr "Langue de l'article"
158
 
159
- # @ polylang
160
- #: ../include/term-translations.php:6
161
- #: ../include/term-translations.php:11
 
162
  msgid "Translations"
163
  msgstr "Traductions"
164
 
165
- # @ polylang
166
- #: ../include/term-translations.php:15
167
  msgid "Translation"
168
  msgstr "Traduction"
169
 
170
- # @ polylang
171
- #: ../include/term-translations.php:15
172
- #: ../include/term-translations.php:76
173
- #: ../include/list-table.php:33
 
 
174
  msgid "Edit"
175
  msgstr "Modifier"
176
 
177
- # @ polylang
178
- #: ../include/term-translations.php:62
 
 
 
 
 
 
179
  msgid "Add new"
180
  msgstr "Ajouter"
181
 
182
- # @ polylang
183
- #: ../include/admin-filters.php:123
 
 
 
 
 
 
184
  msgid "Show all languages"
185
  msgstr "Afficher toutes les langues"
186
 
187
- # @ polylang
188
- #: ../include/admin-filters.php:400
 
 
 
 
 
189
  msgid "Theme locations and languages"
190
  msgstr "Emplacements du thème et langues"
191
 
192
- # @ polylang
193
- #: ../include/admin-filters.php:405
194
  #, php-format
 
195
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
196
  msgstr "Aller à la %spage langues%s pour définir les emplacements du thème et les langues"
197
 
198
- # @ polylang
199
- #: ../include/admin-filters.php:416
200
  msgid "The widget is displayed for:"
201
  msgstr "Afficher le widget pour :"
202
 
203
- # @ polylang
204
- #: ../include/admin-filters.php:417
205
  msgid "All languages"
206
  msgstr "Toutes les langues"
207
 
208
- # @ polylang
209
- #: ../include/list-table.php:34
210
  msgid "Delete"
211
  msgstr "Supprimer"
212
 
213
- # @ polylang
214
- #: ../include/list-table.php:52
215
- #: ../include/languages-form.php:66
216
  msgid "Full name"
217
  msgstr "Nom"
218
 
219
- # @ polylang
220
- #: ../include/list-table.php:53
221
- #: ../include/languages-form.php:72
222
  msgid "Locale"
223
  msgstr "Code local"
224
 
225
- # @ polylang
226
- #: ../include/list-table.php:54
227
  msgid "Code"
228
  msgstr "Code"
229
 
230
- # @ polylang
231
- #: ../include/list-table.php:55
 
 
 
 
 
 
232
  msgid "Flag"
233
  msgstr "Drapeau"
234
 
235
- # @ polylang
236
- #: ../include/list-table.php:56
237
  msgid "Posts"
238
  msgstr "Articles"
239
 
240
- # @ default
241
- #: ../include/calendar.php:99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  #, php-format
 
243
  msgctxt "calendar caption"
244
  msgid "%1$s %2$s"
245
  msgstr ""
246
 
247
- # @ default
248
- #: ../include/calendar.php:125
249
- #: ../include/calendar.php:133
250
  #, php-format
 
251
  msgid "View posts for %1$s %2$s"
252
  msgstr ""
253
 
254
- # @ polylang
255
- #: ../include/languages-form.php:33
256
  msgid "Edit language"
257
  msgstr "Modifier la langue"
258
 
259
- # @ polylang
260
- #: ../include/languages-form.php:33
261
- #: ../include/languages-form.php:83
262
  msgid "Add new language"
263
  msgstr "Ajouter une nouvelle langue"
264
 
265
- # @ polylang
266
- #: ../include/languages-form.php:54
267
  msgid "Choose a language"
268
  msgstr "Choisir une langue"
269
 
270
- # @ polylang
271
- #: ../include/languages-form.php:62
272
  msgid "You can choose a language in the list or directly edit it below."
273
  msgstr "Choisissez une langue dans la liste ou éditez la directement ci-dessous."
274
 
275
- # @ polylang
276
- #: ../include/languages-form.php:68
277
  msgid "The name is how it is displayed on your site (for example: English)."
278
  msgstr "Le nom est utilisé un peu partout sur le site (par exemple : Français)"
279
 
280
- # @ polylang
281
- #: ../include/languages-form.php:74
282
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
283
  msgstr "Code local utilisé par Wordpress pour la langue (par exemple : fr_FR). Vous aurez besoin d'installer les fichiers .mo correspondant"
284
 
285
- # @ polylang
286
- #: ../include/languages-form.php:78
287
  msgid "Language code"
288
  msgstr "Code de la langue"
289
 
290
- # @ polylang
291
- #: ../include/languages-form.php:80
292
  msgid "2-letters ISO 639-1 language code (for example: en)"
293
  msgstr "Code ISO 639-1 à 2 lettres (par exemple : fr)"
294
 
295
- # @ default
296
- #: ../include/languages-form.php:83
 
 
 
 
 
297
  msgid "Update"
298
  msgstr "Mettre à jour"
299
 
300
- # @ polylang
301
- #: ../include/languages-form.php:131
302
  msgid "Language switcher"
303
  msgstr "Liste des langues"
304
 
305
- # @ polylang
306
- #: ../include/languages-form.php:158
307
  msgid "Default language"
308
  msgstr "Langue par défaut"
309
 
310
- # @ polylang
311
- #: ../include/languages-form.php:187
312
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
313
  msgstr "Il y a des articles, pages, catégories ou tags sans langue définie. Voulez-vous leur attribuer la langue par défaut ?"
314
 
315
- # @ polylang
316
- #: ../include/languages-form.php:195
317
  msgid "Detect browser language"
318
  msgstr "Détecter la langue du navigateur"
319
 
320
- # @ polylang
321
- #: ../include/languages-form.php:201
322
  msgid "When the front page is visited, set the language according to the browser preference"
323
  msgstr "Lorsque la page d'accueil est visitée pour la première fois, le visiteur est redirigé à la bonne URL en fonction des préférences de langue de son navigateur"
324
 
325
- # @ polylang
326
- #: ../include/languages-form.php:208
327
  msgid "URL modifications"
328
  msgstr "Modifications des URL"
329
 
330
- # @ polylang
331
- #: ../include/languages-form.php:214
332
  msgid "Keep /language/ in pretty permalinks. Example:"
333
  msgstr "Conserve /language/ dans les permaliens. Exemple :"
334
 
335
- # @ polylang
336
- #: ../include/languages-form.php:222
337
  msgid "Remove /language/ in pretty permalinks. Example:"
338
  msgstr "Supprime /language/ dans les permaliens. Exemple :"
339
 
340
- # @ polylang
341
- #: ../include/languages-form.php:230
342
  msgid "Hide URL language information for default language"
343
  msgstr "Cacher l'information de langue dans l'URL pour la langue par défaut"
344
 
345
- # @ polylang
346
- #: ../include/post-translations.php:1
347
  msgid "ID of pages in other languages:"
348
  msgstr "ID des pages dans les autres langues"
349
 
350
- # @ polylang
351
- #: ../include/post-translations.php:1
352
  msgid "ID of posts in other languages:"
353
  msgstr "ID des articles dans les autres langues"
354
 
355
- # @ polylang
356
- #: ../include/post-translations.php:5
357
  msgid "Page ID"
358
  msgstr "ID de la page"
359
 
360
- # @ polylang
361
- #: ../include/post-translations.php:5
362
  msgid "Post ID"
363
  msgstr "ID de l'article"
364
 
365
- # @ polylang
366
- #: ../include/personal-options.php:5
367
  msgid "Admin language"
368
  msgstr "Langue pour l'interface d'administration"
369
 
 
 
 
 
 
 
 
 
 
 
 
2
  msgstr ""
3
  "Project-Id-Version: polylang\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-01-02 14:03+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: F. Demarle\n"
8
  "Language-Team: \n"
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-Language: \n"
14
+ "X-Poedit-Country: \n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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-Poedit-Bookmarks: \n"
19
  "X-Poedit-SearchPath-0: ..\n"
20
+ "X-Textdomain-Support: yes"
21
+
22
+ #: include/add-term-form.php:5
23
+ #: include/edit-term-form.php:6
24
+ #: include/list-table.php:12
25
+ #: include/post-translations.php:4
26
+ #: include/term-translations.php:15
27
+ #@ polylang
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  msgid "Language"
29
  msgstr "Langue"
30
 
31
+ #: include/add-term-form.php:17
32
+ #: include/edit-term-form.php:19
33
+ #@ polylang
34
  msgid "Sets the language"
35
  msgstr "Définit la langue"
36
 
37
+ #: include/widget.php:6
38
+ #@ polylang
39
  msgid "Language Switcher"
40
  msgstr "Liste des langues"
41
 
42
+ #: include/widget.php:6
43
+ #@ polylang
44
  msgid "Displays a language switcher"
45
  msgstr "Affiche la liste des langues"
46
 
47
+ #: include/widget.php:74
48
+ #@ polylang
49
  msgid "Title:"
50
+ msgstr "Titre :"
51
 
52
+ #: include/admin.php:296
53
+ #: include/widget.php:77
54
+ #@ polylang
55
  msgid "Displays language names"
56
  msgstr "Afficher le nom des langues"
57
 
58
+ #: include/admin.php:297
59
+ #: include/widget.php:78
60
+ #@ polylang
61
  msgid "Displays flags"
62
  msgstr "Afficher les drapeaux"
63
 
64
+ #: include/widget.php:79
65
+ #@ polylang
66
  msgid "Displays as dropdown"
67
  msgstr "Afficher comme liste déroulante"
68
 
69
+ #: include/admin.php:298
70
+ #: include/widget.php:80
71
+ #@ polylang
72
  msgid "Forces link to front page"
73
  msgstr "Force le lien vers la page d'accueil"
74
 
75
+ #: include/admin.php:21
76
+ #: include/admin.php:266
77
+ #@ default
78
+ #@ polylang
79
  msgid "Settings"
80
  msgstr "Réglages"
81
 
82
+ #: include/admin-filters.php:164
83
+ #: include/admin.php:28
84
+ #: include/admin.php:263
85
+ #: include/list-table.php:13
86
+ #@ polylang
87
  msgid "Languages"
88
  msgstr "Langues"
89
 
90
+ #: include/admin.php:264
91
+ #@ polylang
92
  msgid "Menus"
93
  msgstr "Menus"
94
 
95
+ #: include/admin.php:265
96
+ #: include/list-table.php:104
97
+ #@ polylang
98
+ msgid "Strings translation"
99
+ msgstr "Traduction de phrases"
100
+
101
+ #: include/admin.php:284
102
+ #@ polylang
103
  msgid "Enter a valid WorPress locale"
104
  msgstr "Entrez un code local WordPress valide"
105
 
106
+ #: include/admin.php:285
107
+ #@ polylang
108
  msgid "The language code must be 2 characters long"
109
  msgstr "Le code de la langue doit avoir 2 lettres"
110
 
111
+ #: include/admin.php:286
112
+ #@ polylang
113
  msgid "The language code must be unique"
114
  msgstr "Le code de la langue doit être unique"
115
 
116
+ #: include/admin.php:287
117
+ #@ polylang
118
  msgid "The language must have a name"
119
  msgstr "La langue doit avoir un nom"
120
 
121
+ #: include/admin.php:288
122
+ #@ polylang
123
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
124
+ msgstr "La langue a été créée, mais le fichier de langue WordPress n'a pu être téléchargé. Merci de l'installer manuellement."
125
+
126
+ #: include/admin.php:295
127
+ #@ polylang
128
  msgid "Displays a language switcher at the end of the menu"
129
  msgstr "Affiche la liste des langues"
130
 
131
+ #: include/admin.php:311
132
+ #@ default
133
+ msgid "Site Title"
134
+ msgstr ""
135
+
136
+ #: include/admin.php:312
137
+ #@ default
138
+ msgid "Tagline"
139
+ msgstr ""
140
+
141
+ #: include/admin.php:328
142
+ #@ default
143
+ msgid "Widget title"
144
+ msgstr ""
145
+
146
+ #: include/post-metabox.php:5
147
+ #@ polylang
148
  msgid "Page's language:"
149
  msgstr "Langue de la page"
150
 
151
+ #: include/post-metabox.php:5
152
+ #@ polylang
153
  msgid "Post's language:"
154
  msgstr "Langue de l'article"
155
 
156
+ #: include/list-table.php:128
157
+ #: include/term-translations.php:6
158
+ #: include/term-translations.php:11
159
+ #@ polylang
160
  msgid "Translations"
161
  msgstr "Traductions"
162
 
163
+ #: include/term-translations.php:16
164
+ #@ polylang
165
  msgid "Translation"
166
  msgstr "Traduction"
167
 
168
+ #: include/list-table.php:26
169
+ #: include/post-translations.php:6
170
+ #: include/post-translations.php:27
171
+ #: include/term-translations.php:18
172
+ #: include/term-translations.php:65
173
+ #@ polylang
174
  msgid "Edit"
175
  msgstr "Modifier"
176
 
177
+ #: include/term-translations.php:48
178
+ #@ polylang
179
+ msgid "No untranslated term"
180
+ msgstr "Pas de terme non traduit"
181
+
182
+ #: include/post-translations.php:32
183
+ #: include/term-translations.php:54
184
+ #@ polylang
185
  msgid "Add new"
186
  msgstr "Ajouter"
187
 
188
+ #: include/admin-filters.php:128
189
+ #: include/admin-filters.php:482
190
+ #@ polylang
191
+ msgid "Add new translation"
192
+ msgstr "Ajoute une nouvelle traduction"
193
+
194
+ #: include/admin-filters.php:152
195
+ #@ polylang
196
  msgid "Show all languages"
197
  msgstr "Afficher toutes les langues"
198
 
199
+ #: include/admin-filters.php:238
200
+ #@ default
201
+ msgid "(no parent)"
202
+ msgstr ""
203
+
204
+ #: include/admin-filters.php:577
205
+ #@ polylang
206
  msgid "Theme locations and languages"
207
  msgstr "Emplacements du thème et langues"
208
 
209
+ #: include/admin-filters.php:582
 
210
  #, php-format
211
+ #@ polylang
212
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
213
  msgstr "Aller à la %spage langues%s pour définir les emplacements du thème et les langues"
214
 
215
+ #: include/admin-filters.php:593
216
+ #@ polylang
217
  msgid "The widget is displayed for:"
218
  msgstr "Afficher le widget pour :"
219
 
220
+ #: include/admin-filters.php:594
221
+ #@ polylang
222
  msgid "All languages"
223
  msgstr "Toutes les langues"
224
 
225
+ #: include/list-table.php:27
226
+ #@ polylang
227
  msgid "Delete"
228
  msgstr "Supprimer"
229
 
230
+ #: include/languages-form.php:67
231
+ #: include/list-table.php:45
232
+ #@ polylang
233
  msgid "Full name"
234
  msgstr "Nom"
235
 
236
+ #: include/languages-form.php:73
237
+ #: include/list-table.php:46
238
+ #@ polylang
239
  msgid "Locale"
240
  msgstr "Code local"
241
 
242
+ #: include/list-table.php:47
243
+ #@ polylang
244
  msgid "Code"
245
  msgstr "Code"
246
 
247
+ #: include/languages-form.php:86
248
+ #: include/list-table.php:48
249
+ #@ polylang
250
+ msgid "Order"
251
+ msgstr "Ordre"
252
+
253
+ #: include/list-table.php:49
254
+ #@ polylang
255
  msgid "Flag"
256
  msgstr "Drapeau"
257
 
258
+ #: include/list-table.php:50
259
+ #@ polylang
260
  msgid "Posts"
261
  msgstr "Articles"
262
 
263
+ #: include/list-table.php:105
264
+ #@ polylang
265
+ msgid "Strings translations"
266
+ msgstr "Traductions de phrases"
267
+
268
+ #: include/list-table.php:126
269
+ #@ polylang
270
+ msgid "Name"
271
+ msgstr "Nom"
272
+
273
+ #: include/list-table.php:127
274
+ #@ polylang
275
+ msgid "String"
276
+ msgstr "Phrase"
277
+
278
+ #. translators: Calendar caption: 1: month name, 2: 4-digit year
279
+ #: include/calendar.php:107
280
  #, php-format
281
+ #@ default
282
  msgctxt "calendar caption"
283
  msgid "%1$s %2$s"
284
  msgstr ""
285
 
286
+ #: include/calendar.php:133
287
+ #: include/calendar.php:141
 
288
  #, php-format
289
+ #@ default
290
  msgid "View posts for %1$s %2$s"
291
  msgstr ""
292
 
293
+ #: include/languages-form.php:33
294
+ #@ polylang
295
  msgid "Edit language"
296
  msgstr "Modifier la langue"
297
 
298
+ #: include/languages-form.php:33
299
+ #: include/languages-form.php:91
300
+ #@ polylang
301
  msgid "Add new language"
302
  msgstr "Ajouter une nouvelle langue"
303
 
304
+ #: include/languages-form.php:55
305
+ #@ polylang
306
  msgid "Choose a language"
307
  msgstr "Choisir une langue"
308
 
309
+ #: include/languages-form.php:63
310
+ #@ polylang
311
  msgid "You can choose a language in the list or directly edit it below."
312
  msgstr "Choisissez une langue dans la liste ou éditez la directement ci-dessous."
313
 
314
+ #: include/languages-form.php:69
315
+ #@ polylang
316
  msgid "The name is how it is displayed on your site (for example: English)."
317
  msgstr "Le nom est utilisé un peu partout sur le site (par exemple : Français)"
318
 
319
+ #: include/languages-form.php:76
320
+ #@ polylang
321
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
322
  msgstr "Code local utilisé par Wordpress pour la langue (par exemple : fr_FR). Vous aurez besoin d'installer les fichiers .mo correspondant"
323
 
324
+ #: include/languages-form.php:80
325
+ #@ polylang
326
  msgid "Language code"
327
  msgstr "Code de la langue"
328
 
329
+ #: include/languages-form.php:82
330
+ #@ polylang
331
  msgid "2-letters ISO 639-1 language code (for example: en)"
332
  msgstr "Code ISO 639-1 à 2 lettres (par exemple : fr)"
333
 
334
+ #: include/languages-form.php:88
335
+ #@ polylang
336
+ msgid "Position of the language in the language switcher"
337
+ msgstr "Position de la langue dans la liste de langues"
338
+
339
+ #: include/languages-form.php:91
340
+ #@ default
341
  msgid "Update"
342
  msgstr "Mettre à jour"
343
 
344
+ #: include/languages-form.php:127
345
+ #@ polylang
346
  msgid "Language switcher"
347
  msgstr "Liste des langues"
348
 
349
+ #: include/languages-form.php:166
350
+ #@ polylang
351
  msgid "Default language"
352
  msgstr "Langue par défaut"
353
 
354
+ #: include/languages-form.php:195
355
+ #@ polylang
356
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
357
  msgstr "Il y a des articles, pages, catégories ou tags sans langue définie. Voulez-vous leur attribuer la langue par défaut ?"
358
 
359
+ #: include/languages-form.php:203
360
+ #@ polylang
361
  msgid "Detect browser language"
362
  msgstr "Détecter la langue du navigateur"
363
 
364
+ #: include/languages-form.php:209
365
+ #@ polylang
366
  msgid "When the front page is visited, set the language according to the browser preference"
367
  msgstr "Lorsque la page d'accueil est visitée pour la première fois, le visiteur est redirigé à la bonne URL en fonction des préférences de langue de son navigateur"
368
 
369
+ #: include/languages-form.php:216
370
+ #@ polylang
371
  msgid "URL modifications"
372
  msgstr "Modifications des URL"
373
 
374
+ #: include/languages-form.php:222
375
+ #@ polylang
376
  msgid "Keep /language/ in pretty permalinks. Example:"
377
  msgstr "Conserve /language/ dans les permaliens. Exemple :"
378
 
379
+ #: include/languages-form.php:230
380
+ #@ polylang
381
  msgid "Remove /language/ in pretty permalinks. Example:"
382
  msgstr "Supprime /language/ dans les permaliens. Exemple :"
383
 
384
+ #: include/languages-form.php:238
385
+ #@ polylang
386
  msgid "Hide URL language information for default language"
387
  msgstr "Cacher l'information de langue dans l'URL pour la langue par défaut"
388
 
389
+ #: include/post-translations.php:1
390
+ #@ polylang
391
  msgid "ID of pages in other languages:"
392
  msgstr "ID des pages dans les autres langues"
393
 
394
+ #: include/post-translations.php:1
395
+ #@ polylang
396
  msgid "ID of posts in other languages:"
397
  msgstr "ID des articles dans les autres langues"
398
 
399
+ #: include/post-translations.php:5
400
+ #@ polylang
401
  msgid "Page ID"
402
  msgstr "ID de la page"
403
 
404
+ #: include/post-translations.php:5
405
+ #@ polylang
406
  msgid "Post ID"
407
  msgstr "ID de l'article"
408
 
409
+ #: include/personal-options.php:5
410
+ #@ polylang
411
  msgid "Admin language"
412
  msgstr "Langue pour l'interface d'administration"
413
 
414
+ #: polylang.php:170
415
+ #@ polylang
416
+ msgid "Error: Restore of local flags failed!"
417
+ msgstr "Erreur : La restauration des drapeaux personnalisés a échoué"
418
+
419
+ #: polylang.php:171
420
+ #, php-format
421
+ #@ polylang
422
+ msgid "Please move your local flags from %s to %s"
423
+ msgstr "Merci de déplacer vos drapeaux personnalisés de %s vers %s"
424
+
languages/polylang-ru_RU.po CHANGED
@@ -6,366 +6,419 @@ msgstr ""
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: YoYurec <yoyurec@gmail.com>\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=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
14
  "X-Poedit-Language: Russian\n"
15
  "X-Poedit-Country: RUSSIAN FEDERATION\n"
16
  "X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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"
18
  "X-Poedit-Basepath: .\n"
19
- "X-Textdomain-Support: yes\n"
20
  "X-Poedit-SearchPath-0: ..\n"
 
21
 
22
- # @ polylang
23
- #: ../polylang.php:169
24
- msgid "Error: Upgrade directory doesn't exist!"
25
- msgstr "Ошибка: Отсутствует папка для обновления!"
26
-
27
- # @ polylang
28
- #: ../polylang.php:170
29
- msgid "Please create"
30
- msgstr "Пожалуйста, создайте"
31
-
32
- # @ polylang
33
- #: ../polylang.php:177
34
- msgid "Error: Backup of local flags failed!"
35
- msgstr "Ошибка: Не удалось создать резервную копию пользовательских иконок-флагов!"
36
-
37
- # @ polylang
38
- #: ../polylang.php:178
39
- msgid "Please backup"
40
- msgstr "Пожалуйста, сделайте резервную копию"
41
-
42
- # @ polylang
43
- #: ../polylang.php:193
44
  msgid "Error: Restore of local flags failed!"
45
  msgstr "Ошибка: Не удалось восстановить пользовательские иконки-флаги из резервной копиии!"
46
 
47
- # @ polylang
48
- #: ../polylang.php:194
49
- msgid "Please restore your local flags"
50
- msgstr "Пожалуйста, создайте резервную копию пользовательских иконок-флагов!"
51
-
52
- # @ polylang
53
- #: ../include/edit-term-form.php:6
54
- #: ../include/term-translations.php:15
55
- #: ../include/admin-filters.php:91
56
- #: ../include/admin-filters.php:327
57
- #: ../include/add-term-form.php:5
58
- #: ../include/list-table.php:12
59
  msgid "Language"
60
  msgstr "Язык"
61
 
62
- # @ polylang
63
- #: ../include/edit-term-form.php:19
64
- #: ../include/add-term-form.php:13
65
  msgid "Sets the language"
66
  msgstr "Устанавливает язык"
67
 
68
- # @ polylang
69
- #: ../include/widget.php:6
70
  msgid "Language Switcher"
71
  msgstr "Переключатель языков"
72
 
73
- # @ polylang
74
- #: ../include/widget.php:6
75
  msgid "Displays a language switcher"
76
  msgstr "Показывает переключатель языков"
77
 
78
- # @ polylang
79
- #: ../include/widget.php:62
80
  msgid "Title:"
81
  msgstr "Название:"
82
 
83
- # @ polylang
84
- #: ../include/widget.php:65
85
- #: ../include/admin.php:236
86
  msgid "Displays language names"
87
  msgstr "Показывать названия языков"
88
 
89
- # @ polylang
90
- #: ../include/widget.php:66
91
- #: ../include/admin.php:237
92
  msgid "Displays flags"
93
  msgstr "Показывать флаги"
94
 
95
- # @ polylang
96
- #: ../include/widget.php:67
97
  msgid "Displays as dropdown"
98
  msgstr "Показывать как выпадающий список"
99
 
100
- # @ polylang
101
- #: ../include/widget.php:68
102
- #: ../include/admin.php:238
103
  msgid "Forces link to front page"
104
  msgstr "Принудительно переходить на главную страницу при смене языка"
105
 
106
- # @ default
107
- # @ polylang
108
- #: ../include/admin.php:21
109
- #: ../include/admin.php:209
110
  msgid "Settings"
111
  msgstr "Настройки"
112
 
113
- # @ polylang
114
- #: ../include/admin.php:28
115
- #: ../include/admin.php:207
116
- #: ../include/admin-filters.php:135
117
- #: ../include/list-table.php:13
118
  msgid "Languages"
119
  msgstr "Языки"
120
 
121
- # @ polylang
122
- #: ../include/admin.php:208
123
  msgid "Menus"
124
  msgstr "Меню"
125
 
126
- # @ polylang
127
- #: ../include/admin.php:225
128
  msgid "Enter a valid WorPress locale"
129
  msgstr "Введите корректную WordPress локаль"
130
 
131
- # @ polylang
132
- #: ../include/admin.php:226
133
  msgid "The language code must be 2 characters long"
134
  msgstr "Код языка должен состоять из 2-х символов"
135
 
136
- # @ polylang
137
- #: ../include/admin.php:227
138
  msgid "The language code must be unique"
139
  msgstr "Код языка должен быть уникальным"
140
 
141
- # @ polylang
142
- #: ../include/admin.php:228
143
  msgid "The language must have a name"
144
  msgstr "У языка должно быть название"
145
 
146
- # @ polylang
147
- #: ../include/admin.php:235
148
  msgid "Displays a language switcher at the end of the menu"
149
  msgstr "Показывает переключатель языков"
150
 
151
- # @ polylang
152
- #: ../include/post-metabox.php:5
153
  msgid "Page's language:"
154
  msgstr "Язык страницы"
155
 
156
- # @ polylang
157
- #: ../include/post-metabox.php:5
158
  msgid "Post's language:"
159
  msgstr "Язык записи"
160
 
161
- # @ polylang
162
- #: ../include/term-translations.php:6
163
- #: ../include/term-translations.php:11
 
164
  msgid "Translations"
165
  msgstr "Переводы"
166
 
167
- # @ polylang
168
- #: ../include/term-translations.php:15
169
  msgid "Translation"
170
  msgstr "Перевод"
171
 
172
- # @ polylang
173
- #: ../include/term-translations.php:15
174
- #: ../include/term-translations.php:76
175
- #: ../include/list-table.php:33
 
 
176
  msgid "Edit"
177
  msgstr "Редактировать"
178
 
179
- # @ polylang
180
- #: ../include/term-translations.php:62
 
181
  msgid "Add new"
182
  msgstr "Добавить новый"
183
 
184
- # @ polylang
185
- #: ../include/admin-filters.php:123
186
  msgid "Show all languages"
187
  msgstr "Показать все языки"
188
 
189
- # @ polylang
190
- #: ../include/admin-filters.php:400
191
  msgid "Theme locations and languages"
192
  msgstr "Расположение темы и языков"
193
 
194
- # @ polylang
195
- #: ../include/admin-filters.php:405
196
  #, php-format
 
197
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
198
  msgstr "Перейдите на %slanguages page%s для указания расположения темы и языков"
199
 
200
- # @ polylang
201
- #: ../include/admin-filters.php:416
202
  msgid "The widget is displayed for:"
203
  msgstr "Показывать виджет для"
204
 
205
- # @ polylang
206
- #: ../include/admin-filters.php:417
207
  msgid "All languages"
208
  msgstr "Все языки"
209
 
210
- # @ polylang
211
- #: ../include/list-table.php:34
212
  msgid "Delete"
213
  msgstr "Удалить"
214
 
215
- # @ polylang
216
- #: ../include/list-table.php:52
217
- #: ../include/languages-form.php:66
218
  msgid "Full name"
219
  msgstr "Полное название"
220
 
221
- # @ polylang
222
- #: ../include/list-table.php:53
223
- #: ../include/languages-form.php:72
224
  msgid "Locale"
225
  msgstr "Локаль"
226
 
227
- # @ polylang
228
- #: ../include/list-table.php:54
229
  msgid "Code"
230
  msgstr "Код"
231
 
232
- # @ polylang
233
- #: ../include/list-table.php:55
234
  msgid "Flag"
235
  msgstr "Флаг"
236
 
237
- # @ polylang
238
- #: ../include/list-table.php:56
239
  msgid "Posts"
240
  msgstr "Записи"
241
 
242
- # @ default
243
- #: ../include/calendar.php:99
244
  #, php-format
 
245
  msgctxt "calendar caption"
246
  msgid "%1$s %2$s"
247
  msgstr "%1$s %2$s"
248
 
249
- # @ default
250
- #: ../include/calendar.php:125
251
- #: ../include/calendar.php:133
252
  #, php-format
 
253
  msgid "View posts for %1$s %2$s"
254
  msgstr "Показать записи для %1$s %2$s"
255
 
256
- # @ polylang
257
- #: ../include/languages-form.php:33
258
  msgid "Edit language"
259
  msgstr "Редактировать язык"
260
 
261
- # @ polylang
262
- #: ../include/languages-form.php:33
263
- #: ../include/languages-form.php:83
264
  msgid "Add new language"
265
  msgstr "Добавить новый язык"
266
 
267
- # @ polylang
268
- #: ../include/languages-form.php:54
269
  msgid "Choose a language"
270
  msgstr "Показать все языки"
271
 
272
- # @ polylang
273
- #: ../include/languages-form.php:62
274
  msgid "You can choose a language in the list or directly edit it below."
275
  msgstr "Выберите язык из списка или укажите сами."
276
 
277
- # @ polylang
278
- #: ../include/languages-form.php:68
279
  msgid "The name is how it is displayed on your site (for example: English)."
280
  msgstr "Название для отображения на сайте (например: Русский)."
281
 
282
- # @ polylang
283
- #: ../include/languages-form.php:74
284
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
285
  msgstr "Локаль Wordpress'a для языка (например: ru_RU). Вы должны установить файлы .mo для админ.панели и используемой темы."
286
 
287
- # @ polylang
288
- #: ../include/languages-form.php:78
289
  msgid "Language code"
290
  msgstr "Код языка"
291
 
292
- # @ polylang
293
- #: ../include/languages-form.php:80
294
  msgid "2-letters ISO 639-1 language code (for example: en)"
295
  msgstr "2х-буквенный ISO 639-1 код языка (например: ru)"
296
 
297
- # @ default
298
- #: ../include/languages-form.php:83
299
  msgid "Update"
300
  msgstr "Обновить"
301
 
302
- # @ polylang
303
- #: ../include/languages-form.php:131
304
  msgid "Language switcher"
305
  msgstr "Переключатель языков"
306
 
307
- # @ polylang
308
- #: ../include/languages-form.php:158
309
  msgid "Default language"
310
  msgstr "Язык по-умолчанию"
311
 
312
- # @ polylang
313
- #: ../include/languages-form.php:187
314
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
315
  msgstr "Найдены записи, страницы, категории или метки без указанния какого-либо языка. Установить им язык по-умолчанию?"
316
 
317
- # @ polylang
318
- #: ../include/languages-form.php:195
319
  msgid "Detect browser language"
320
  msgstr "Определять язык в браузере"
321
 
322
- # @ polylang
323
- #: ../include/languages-form.php:201
324
  msgid "When the front page is visited, set the language according to the browser preference"
325
  msgstr "Установить язык сайта согласно настройкам браузера"
326
 
327
- # @ polylang
328
- #: ../include/languages-form.php:208
329
  msgid "URL modifications"
330
  msgstr "Модификации URL"
331
 
332
- # @ polylang
333
- #: ../include/languages-form.php:214
334
  msgid "Keep /language/ in pretty permalinks. Example:"
335
  msgstr "Оставить /language/ в ЧПУ. Пример:"
336
 
337
- # @ polylang
338
- #: ../include/languages-form.php:222
339
  msgid "Remove /language/ in pretty permalinks. Example:"
340
  msgstr "Удалить /language/ в ЧПУ. Пример:"
341
 
342
- # @ polylang
343
- #: ../include/languages-form.php:230
344
  msgid "Hide URL language information for default language"
345
  msgstr "Спрятать название языка по-умолчанию из URL"
346
 
347
- # @ polylang
348
- #: ../include/post-translations.php:1
349
  msgid "ID of pages in other languages:"
350
  msgstr "ID страницы на других языках:"
351
 
352
- # @ polylang
353
- #: ../include/post-translations.php:1
354
  msgid "ID of posts in other languages:"
355
  msgstr "ID записи на других языках:"
356
 
357
- # @ polylang
358
- #: ../include/post-translations.php:5
359
  msgid "Page ID"
360
  msgstr "ID страницы"
361
 
362
- # @ polylang
363
- #: ../include/post-translations.php:5
364
  msgid "Post ID"
365
  msgstr "ID записи"
366
 
367
- # @ polylang
368
- #: ../include/personal-options.php:5
369
  msgid "Admin language"
370
  msgstr "Язык админ.панели"
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: YoYurec <yoyurec@gmail.com>\n"
8
  "Language-Team: \n"
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
  "X-Poedit-Language: Russian\n"
14
  "X-Poedit-Country: RUSSIAN FEDERATION\n"
15
  "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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-Poedit-Bookmarks: \n"
19
  "X-Poedit-SearchPath-0: ..\n"
20
+ "X-Textdomain-Support: yes"
21
 
22
+ #: polylang.php:170
23
+ #@ polylang
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  msgid "Error: Restore of local flags failed!"
25
  msgstr "Ошибка: Не удалось восстановить пользовательские иконки-флаги из резервной копиии!"
26
 
27
+ #: include/add-term-form.php:5
28
+ #: include/edit-term-form.php:6
29
+ #: include/list-table.php:12
30
+ #: include/post-translations.php:4
31
+ #: include/term-translations.php:15
32
+ #@ polylang
 
 
 
 
 
 
33
  msgid "Language"
34
  msgstr "Язык"
35
 
36
+ #: include/add-term-form.php:17
37
+ #: include/edit-term-form.php:19
38
+ #@ polylang
39
  msgid "Sets the language"
40
  msgstr "Устанавливает язык"
41
 
42
+ #: include/widget.php:6
43
+ #@ polylang
44
  msgid "Language Switcher"
45
  msgstr "Переключатель языков"
46
 
47
+ #: include/widget.php:6
48
+ #@ polylang
49
  msgid "Displays a language switcher"
50
  msgstr "Показывает переключатель языков"
51
 
52
+ #: include/widget.php:74
53
+ #@ polylang
54
  msgid "Title:"
55
  msgstr "Название:"
56
 
57
+ #: include/admin.php:296
58
+ #: include/widget.php:77
59
+ #@ polylang
60
  msgid "Displays language names"
61
  msgstr "Показывать названия языков"
62
 
63
+ #: include/admin.php:297
64
+ #: include/widget.php:78
65
+ #@ polylang
66
  msgid "Displays flags"
67
  msgstr "Показывать флаги"
68
 
69
+ #: include/widget.php:79
70
+ #@ polylang
71
  msgid "Displays as dropdown"
72
  msgstr "Показывать как выпадающий список"
73
 
74
+ #: include/admin.php:298
75
+ #: include/widget.php:80
76
+ #@ polylang
77
  msgid "Forces link to front page"
78
  msgstr "Принудительно переходить на главную страницу при смене языка"
79
 
80
+ #: include/admin.php:21
81
+ #: include/admin.php:266
82
+ #@ default
83
+ #@ polylang
84
  msgid "Settings"
85
  msgstr "Настройки"
86
 
87
+ #: include/admin-filters.php:164
88
+ #: include/admin.php:28
89
+ #: include/admin.php:263
90
+ #: include/list-table.php:13
91
+ #@ polylang
92
  msgid "Languages"
93
  msgstr "Языки"
94
 
95
+ #: include/admin.php:264
96
+ #@ polylang
97
  msgid "Menus"
98
  msgstr "Меню"
99
 
100
+ #: include/admin.php:284
101
+ #@ polylang
102
  msgid "Enter a valid WorPress locale"
103
  msgstr "Введите корректную WordPress локаль"
104
 
105
+ #: include/admin.php:285
106
+ #@ polylang
107
  msgid "The language code must be 2 characters long"
108
  msgstr "Код языка должен состоять из 2-х символов"
109
 
110
+ #: include/admin.php:286
111
+ #@ polylang
112
  msgid "The language code must be unique"
113
  msgstr "Код языка должен быть уникальным"
114
 
115
+ #: include/admin.php:287
116
+ #@ polylang
117
  msgid "The language must have a name"
118
  msgstr "У языка должно быть название"
119
 
120
+ #: include/admin.php:295
121
+ #@ polylang
122
  msgid "Displays a language switcher at the end of the menu"
123
  msgstr "Показывает переключатель языков"
124
 
125
+ #: include/post-metabox.php:5
126
+ #@ polylang
127
  msgid "Page's language:"
128
  msgstr "Язык страницы"
129
 
130
+ #: include/post-metabox.php:5
131
+ #@ polylang
132
  msgid "Post's language:"
133
  msgstr "Язык записи"
134
 
135
+ #: include/list-table.php:128
136
+ #: include/term-translations.php:6
137
+ #: include/term-translations.php:11
138
+ #@ polylang
139
  msgid "Translations"
140
  msgstr "Переводы"
141
 
142
+ #: include/term-translations.php:16
143
+ #@ polylang
144
  msgid "Translation"
145
  msgstr "Перевод"
146
 
147
+ #: include/list-table.php:26
148
+ #: include/post-translations.php:6
149
+ #: include/post-translations.php:27
150
+ #: include/term-translations.php:18
151
+ #: include/term-translations.php:65
152
+ #@ polylang
153
  msgid "Edit"
154
  msgstr "Редактировать"
155
 
156
+ #: include/post-translations.php:32
157
+ #: include/term-translations.php:54
158
+ #@ polylang
159
  msgid "Add new"
160
  msgstr "Добавить новый"
161
 
162
+ #: include/admin-filters.php:152
163
+ #@ polylang
164
  msgid "Show all languages"
165
  msgstr "Показать все языки"
166
 
167
+ #: include/admin-filters.php:577
168
+ #@ polylang
169
  msgid "Theme locations and languages"
170
  msgstr "Расположение темы и языков"
171
 
172
+ #: include/admin-filters.php:582
 
173
  #, php-format
174
+ #@ polylang
175
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
176
  msgstr "Перейдите на %slanguages page%s для указания расположения темы и языков"
177
 
178
+ #: include/admin-filters.php:593
179
+ #@ polylang
180
  msgid "The widget is displayed for:"
181
  msgstr "Показывать виджет для"
182
 
183
+ #: include/admin-filters.php:594
184
+ #@ polylang
185
  msgid "All languages"
186
  msgstr "Все языки"
187
 
188
+ #: include/list-table.php:27
189
+ #@ polylang
190
  msgid "Delete"
191
  msgstr "Удалить"
192
 
193
+ #: include/languages-form.php:67
194
+ #: include/list-table.php:45
195
+ #@ polylang
196
  msgid "Full name"
197
  msgstr "Полное название"
198
 
199
+ #: include/languages-form.php:73
200
+ #: include/list-table.php:46
201
+ #@ polylang
202
  msgid "Locale"
203
  msgstr "Локаль"
204
 
205
+ #: include/list-table.php:47
206
+ #@ polylang
207
  msgid "Code"
208
  msgstr "Код"
209
 
210
+ #: include/list-table.php:49
211
+ #@ polylang
212
  msgid "Flag"
213
  msgstr "Флаг"
214
 
215
+ #: include/list-table.php:50
216
+ #@ polylang
217
  msgid "Posts"
218
  msgstr "Записи"
219
 
220
+ #. translators: Calendar caption: 1: month name, 2: 4-digit year
221
+ #: include/calendar.php:107
222
  #, php-format
223
+ #@ default
224
  msgctxt "calendar caption"
225
  msgid "%1$s %2$s"
226
  msgstr "%1$s %2$s"
227
 
228
+ #: include/calendar.php:133
229
+ #: include/calendar.php:141
 
230
  #, php-format
231
+ #@ default
232
  msgid "View posts for %1$s %2$s"
233
  msgstr "Показать записи для %1$s %2$s"
234
 
235
+ #: include/languages-form.php:33
236
+ #@ polylang
237
  msgid "Edit language"
238
  msgstr "Редактировать язык"
239
 
240
+ #: include/languages-form.php:33
241
+ #: include/languages-form.php:91
242
+ #@ polylang
243
  msgid "Add new language"
244
  msgstr "Добавить новый язык"
245
 
246
+ #: include/languages-form.php:55
247
+ #@ polylang
248
  msgid "Choose a language"
249
  msgstr "Показать все языки"
250
 
251
+ #: include/languages-form.php:63
252
+ #@ polylang
253
  msgid "You can choose a language in the list or directly edit it below."
254
  msgstr "Выберите язык из списка или укажите сами."
255
 
256
+ #: include/languages-form.php:69
257
+ #@ polylang
258
  msgid "The name is how it is displayed on your site (for example: English)."
259
  msgstr "Название для отображения на сайте (например: Русский)."
260
 
261
+ #: include/languages-form.php:76
262
+ #@ polylang
263
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
264
  msgstr "Локаль Wordpress'a для языка (например: ru_RU). Вы должны установить файлы .mo для админ.панели и используемой темы."
265
 
266
+ #: include/languages-form.php:80
267
+ #@ polylang
268
  msgid "Language code"
269
  msgstr "Код языка"
270
 
271
+ #: include/languages-form.php:82
272
+ #@ polylang
273
  msgid "2-letters ISO 639-1 language code (for example: en)"
274
  msgstr "2х-буквенный ISO 639-1 код языка (например: ru)"
275
 
276
+ #: include/languages-form.php:91
277
+ #@ default
278
  msgid "Update"
279
  msgstr "Обновить"
280
 
281
+ #: include/languages-form.php:127
282
+ #@ polylang
283
  msgid "Language switcher"
284
  msgstr "Переключатель языков"
285
 
286
+ #: include/languages-form.php:166
287
+ #@ polylang
288
  msgid "Default language"
289
  msgstr "Язык по-умолчанию"
290
 
291
+ #: include/languages-form.php:195
292
+ #@ polylang
293
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
294
  msgstr "Найдены записи, страницы, категории или метки без указанния какого-либо языка. Установить им язык по-умолчанию?"
295
 
296
+ #: include/languages-form.php:203
297
+ #@ polylang
298
  msgid "Detect browser language"
299
  msgstr "Определять язык в браузере"
300
 
301
+ #: include/languages-form.php:209
302
+ #@ polylang
303
  msgid "When the front page is visited, set the language according to the browser preference"
304
  msgstr "Установить язык сайта согласно настройкам браузера"
305
 
306
+ #: include/languages-form.php:216
307
+ #@ polylang
308
  msgid "URL modifications"
309
  msgstr "Модификации URL"
310
 
311
+ #: include/languages-form.php:222
312
+ #@ polylang
313
  msgid "Keep /language/ in pretty permalinks. Example:"
314
  msgstr "Оставить /language/ в ЧПУ. Пример:"
315
 
316
+ #: include/languages-form.php:230
317
+ #@ polylang
318
  msgid "Remove /language/ in pretty permalinks. Example:"
319
  msgstr "Удалить /language/ в ЧПУ. Пример:"
320
 
321
+ #: include/languages-form.php:238
322
+ #@ polylang
323
  msgid "Hide URL language information for default language"
324
  msgstr "Спрятать название языка по-умолчанию из URL"
325
 
326
+ #: include/post-translations.php:1
327
+ #@ polylang
328
  msgid "ID of pages in other languages:"
329
  msgstr "ID страницы на других языках:"
330
 
331
+ #: include/post-translations.php:1
332
+ #@ polylang
333
  msgid "ID of posts in other languages:"
334
  msgstr "ID записи на других языках:"
335
 
336
+ #: include/post-translations.php:5
337
+ #@ polylang
338
  msgid "Page ID"
339
  msgstr "ID страницы"
340
 
341
+ #: include/post-translations.php:5
342
+ #@ polylang
343
  msgid "Post ID"
344
  msgstr "ID записи"
345
 
346
+ #: include/personal-options.php:5
347
+ #@ polylang
348
  msgid "Admin language"
349
  msgstr "Язык админ.панели"
350
 
351
+ #: include/admin-filters.php:128
352
+ #: include/admin-filters.php:482
353
+ #@ polylang
354
+ msgid "Add new translation"
355
+ msgstr ""
356
+
357
+ #: include/admin-filters.php:238
358
+ #@ default
359
+ msgid "(no parent)"
360
+ msgstr ""
361
+
362
+ #: include/admin.php:265
363
+ #: include/list-table.php:104
364
+ #@ polylang
365
+ msgid "Strings translation"
366
+ msgstr ""
367
+
368
+ #: include/admin.php:288
369
+ #@ polylang
370
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
371
+ msgstr ""
372
+
373
+ #: include/admin.php:311
374
+ #@ default
375
+ msgid "Site Title"
376
+ msgstr ""
377
+
378
+ #: include/admin.php:312
379
+ #@ default
380
+ msgid "Tagline"
381
+ msgstr ""
382
+
383
+ #: include/admin.php:328
384
+ #@ default
385
+ msgid "Widget title"
386
+ msgstr ""
387
+
388
+ #: include/languages-form.php:86
389
+ #: include/list-table.php:48
390
+ #@ polylang
391
+ msgid "Order"
392
+ msgstr ""
393
+
394
+ #: include/languages-form.php:88
395
+ #@ polylang
396
+ msgid "Position of the language in the language switcher"
397
+ msgstr ""
398
+
399
+ #: include/list-table.php:105
400
+ #@ polylang
401
+ msgid "Strings translations"
402
+ msgstr ""
403
+
404
+ #: include/list-table.php:126
405
+ #@ polylang
406
+ msgid "Name"
407
+ msgstr ""
408
+
409
+ #: include/list-table.php:127
410
+ #@ polylang
411
+ msgid "String"
412
+ msgstr ""
413
+
414
+ #: include/term-translations.php:48
415
+ #@ polylang
416
+ msgid "No untranslated term"
417
+ msgstr ""
418
+
419
+ #: polylang.php:171
420
+ #, php-format
421
+ #@ polylang
422
+ msgid "Please move your local flags from %s to %s"
423
+ msgstr ""
424
+
languages/polylang.pot CHANGED
@@ -2,7 +2,7 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: polylang\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2011-12-05 20:52+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: F. Demarle\n"
8
  "Language-Team: \n"
@@ -17,41 +17,24 @@ msgstr ""
17
  "X-Poedit-SearchPath-0: ..\n"
18
  "X-Poedit-SearchPath-1: ../include\n"
19
 
20
- #: ../polylang.php:169
21
- msgid "Error: Upgrade directory doesn't exist!"
22
- msgstr ""
23
-
24
  #: ../polylang.php:170
25
- msgid "Please create"
26
- msgstr ""
27
-
28
- #: ../polylang.php:177
29
- msgid "Error: Backup of local flags failed!"
30
- msgstr ""
31
-
32
- #: ../polylang.php:178
33
- msgid "Please backup"
34
- msgstr ""
35
-
36
- #: ../polylang.php:193
37
  msgid "Error: Restore of local flags failed!"
38
  msgstr ""
39
 
40
- #: ../polylang.php:194
41
- msgid "Please restore your local flags"
 
42
  msgstr ""
43
 
44
  #: ../include/edit-term-form.php:6
45
  #: ../include/term-translations.php:15
46
- #: ../include/admin-filters.php:91
47
- #: ../include/admin-filters.php:327
48
  #: ../include/add-term-form.php:5
49
  #: ../include/list-table.php:12
50
  msgid "Language"
51
  msgstr ""
52
 
53
  #: ../include/edit-term-form.php:19
54
- #: ../include/add-term-form.php:13
55
  msgid "Sets the language"
56
  msgstr ""
57
 
@@ -63,65 +46,86 @@ msgstr ""
63
  msgid "Displays a language switcher"
64
  msgstr ""
65
 
66
- #: ../include/widget.php:62
67
  msgid "Title:"
68
  msgstr ""
69
 
70
- #: ../include/widget.php:65
71
- #: ../include/admin.php:236
72
  msgid "Displays language names"
73
  msgstr ""
74
 
75
- #: ../include/widget.php:66
76
- #: ../include/admin.php:237
77
  msgid "Displays flags"
78
  msgstr ""
79
 
80
- #: ../include/widget.php:67
81
  msgid "Displays as dropdown"
82
  msgstr ""
83
 
84
- #: ../include/widget.php:68
85
- #: ../include/admin.php:238
86
  msgid "Forces link to front page"
87
  msgstr ""
88
 
89
  #: ../include/admin.php:21
90
- #: ../include/admin.php:209
91
  msgid "Settings"
92
  msgstr ""
93
 
94
  #: ../include/admin.php:28
95
- #: ../include/admin.php:207
96
- #: ../include/admin-filters.php:135
97
  #: ../include/list-table.php:13
98
  msgid "Languages"
99
  msgstr ""
100
 
101
- #: ../include/admin.php:208
102
  msgid "Menus"
103
  msgstr ""
104
 
105
- #: ../include/admin.php:225
 
 
 
 
 
106
  msgid "Enter a valid WorPress locale"
107
  msgstr ""
108
 
109
- #: ../include/admin.php:226
110
  msgid "The language code must be 2 characters long"
111
  msgstr ""
112
 
113
- #: ../include/admin.php:227
114
  msgid "The language code must be unique"
115
  msgstr ""
116
 
117
- #: ../include/admin.php:228
118
  msgid "The language must have a name"
119
  msgstr ""
120
 
121
- #: ../include/admin.php:235
 
 
 
 
122
  msgid "Displays a language switcher at the end of the menu"
123
  msgstr ""
124
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  #: ../include/post-metabox.php:5
126
  msgid "Page's language:"
127
  msgstr ""
@@ -132,77 +136,108 @@ msgstr ""
132
 
133
  #: ../include/term-translations.php:6
134
  #: ../include/term-translations.php:11
 
135
  msgid "Translations"
136
  msgstr ""
137
 
138
- #: ../include/term-translations.php:15
139
  msgid "Translation"
140
  msgstr ""
141
 
142
- #: ../include/term-translations.php:15
143
- #: ../include/term-translations.php:76
144
- #: ../include/list-table.php:33
145
  msgid "Edit"
146
  msgstr ""
147
 
148
- #: ../include/term-translations.php:62
 
 
 
 
149
  msgid "Add new"
150
  msgstr ""
151
 
152
- #: ../include/admin-filters.php:123
 
 
 
 
 
153
  msgid "Show all languages"
154
  msgstr ""
155
 
156
- #: ../include/admin-filters.php:400
 
 
 
 
157
  msgid "Theme locations and languages"
158
  msgstr ""
159
 
160
- #: ../include/admin-filters.php:405
161
  #, php-format
162
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
163
  msgstr ""
164
 
165
- #: ../include/admin-filters.php:416
166
  msgid "The widget is displayed for:"
167
  msgstr ""
168
 
169
- #: ../include/admin-filters.php:417
170
  msgid "All languages"
171
  msgstr ""
172
 
173
- #: ../include/list-table.php:34
174
  msgid "Delete"
175
  msgstr ""
176
 
177
- #: ../include/list-table.php:52
178
- #: ../include/languages-form.php:66
179
  msgid "Full name"
180
  msgstr ""
181
 
182
- #: ../include/list-table.php:53
183
- #: ../include/languages-form.php:72
184
  msgid "Locale"
185
  msgstr ""
186
 
187
- #: ../include/list-table.php:54
188
  msgid "Code"
189
  msgstr ""
190
 
191
- #: ../include/list-table.php:55
 
 
 
 
 
192
  msgid "Flag"
193
  msgstr ""
194
 
195
- #: ../include/list-table.php:56
196
  msgid "Posts"
197
  msgstr ""
198
 
199
- #: ../include/calendar.php:99
 
 
 
 
 
 
 
 
 
 
 
 
200
  #, php-format
201
  msgid "%1$s %2$s"
202
  msgstr ""
203
 
204
- #: ../include/calendar.php:125
205
  #: ../include/calendar.php:133
 
206
  #, php-format
207
  msgid "View posts for %1$s %2$s"
208
  msgstr ""
@@ -212,71 +247,75 @@ msgid "Edit language"
212
  msgstr ""
213
 
214
  #: ../include/languages-form.php:33
215
- #: ../include/languages-form.php:83
216
  msgid "Add new language"
217
  msgstr ""
218
 
219
- #: ../include/languages-form.php:54
220
  msgid "Choose a language"
221
  msgstr ""
222
 
223
- #: ../include/languages-form.php:62
224
  msgid "You can choose a language in the list or directly edit it below."
225
  msgstr ""
226
 
227
- #: ../include/languages-form.php:68
228
  msgid "The name is how it is displayed on your site (for example: English)."
229
  msgstr ""
230
 
231
- #: ../include/languages-form.php:74
232
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
233
  msgstr ""
234
 
235
- #: ../include/languages-form.php:78
236
  msgid "Language code"
237
  msgstr ""
238
 
239
- #: ../include/languages-form.php:80
240
  msgid "2-letters ISO 639-1 language code (for example: en)"
241
  msgstr ""
242
 
243
- #: ../include/languages-form.php:83
 
 
 
 
244
  msgid "Update"
245
  msgstr ""
246
 
247
- #: ../include/languages-form.php:131
248
  msgid "Language switcher"
249
  msgstr ""
250
 
251
- #: ../include/languages-form.php:158
252
  msgid "Default language"
253
  msgstr ""
254
 
255
- #: ../include/languages-form.php:187
256
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
257
  msgstr ""
258
 
259
- #: ../include/languages-form.php:195
260
  msgid "Detect browser language"
261
  msgstr ""
262
 
263
- #: ../include/languages-form.php:201
264
  msgid "When the front page is visited, set the language according to the browser preference"
265
  msgstr ""
266
 
267
- #: ../include/languages-form.php:208
268
  msgid "URL modifications"
269
  msgstr ""
270
 
271
- #: ../include/languages-form.php:214
272
  msgid "Keep /language/ in pretty permalinks. Example:"
273
  msgstr ""
274
 
275
- #: ../include/languages-form.php:222
276
  msgid "Remove /language/ in pretty permalinks. Example:"
277
  msgstr ""
278
 
279
- #: ../include/languages-form.php:230
280
  msgid "Hide URL language information for default language"
281
  msgstr ""
282
 
2
  msgstr ""
3
  "Project-Id-Version: polylang\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-01-03 20:07+0100\n"
6
  "PO-Revision-Date: \n"
7
  "Last-Translator: F. Demarle\n"
8
  "Language-Team: \n"
17
  "X-Poedit-SearchPath-0: ..\n"
18
  "X-Poedit-SearchPath-1: ../include\n"
19
 
 
 
 
 
20
  #: ../polylang.php:170
 
 
 
 
 
 
 
 
 
 
 
 
21
  msgid "Error: Restore of local flags failed!"
22
  msgstr ""
23
 
24
+ #: ../polylang.php:171
25
+ #, php-format
26
+ msgid "Please move your local flags from %s to %s"
27
  msgstr ""
28
 
29
  #: ../include/edit-term-form.php:6
30
  #: ../include/term-translations.php:15
 
 
31
  #: ../include/add-term-form.php:5
32
  #: ../include/list-table.php:12
33
  msgid "Language"
34
  msgstr ""
35
 
36
  #: ../include/edit-term-form.php:19
37
+ #: ../include/add-term-form.php:17
38
  msgid "Sets the language"
39
  msgstr ""
40
 
46
  msgid "Displays a language switcher"
47
  msgstr ""
48
 
49
+ #: ../include/widget.php:74
50
  msgid "Title:"
51
  msgstr ""
52
 
53
+ #: ../include/widget.php:77
54
+ #: ../include/admin.php:296
55
  msgid "Displays language names"
56
  msgstr ""
57
 
58
+ #: ../include/widget.php:78
59
+ #: ../include/admin.php:297
60
  msgid "Displays flags"
61
  msgstr ""
62
 
63
+ #: ../include/widget.php:79
64
  msgid "Displays as dropdown"
65
  msgstr ""
66
 
67
+ #: ../include/widget.php:80
68
+ #: ../include/admin.php:298
69
  msgid "Forces link to front page"
70
  msgstr ""
71
 
72
  #: ../include/admin.php:21
73
+ #: ../include/admin.php:266
74
  msgid "Settings"
75
  msgstr ""
76
 
77
  #: ../include/admin.php:28
78
+ #: ../include/admin.php:263
79
+ #: ../include/admin-filters.php:164
80
  #: ../include/list-table.php:13
81
  msgid "Languages"
82
  msgstr ""
83
 
84
+ #: ../include/admin.php:264
85
  msgid "Menus"
86
  msgstr ""
87
 
88
+ #: ../include/admin.php:265
89
+ #: ../include/list-table.php:104
90
+ msgid "Strings translation"
91
+ msgstr ""
92
+
93
+ #: ../include/admin.php:284
94
  msgid "Enter a valid WorPress locale"
95
  msgstr ""
96
 
97
+ #: ../include/admin.php:285
98
  msgid "The language code must be 2 characters long"
99
  msgstr ""
100
 
101
+ #: ../include/admin.php:286
102
  msgid "The language code must be unique"
103
  msgstr ""
104
 
105
+ #: ../include/admin.php:287
106
  msgid "The language must have a name"
107
  msgstr ""
108
 
109
+ #: ../include/admin.php:288
110
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
111
+ msgstr ""
112
+
113
+ #: ../include/admin.php:295
114
  msgid "Displays a language switcher at the end of the menu"
115
  msgstr ""
116
 
117
+ #: ../include/admin.php:311
118
+ msgid "Site Title"
119
+ msgstr ""
120
+
121
+ #: ../include/admin.php:312
122
+ msgid "Tagline"
123
+ msgstr ""
124
+
125
+ #: ../include/admin.php:328
126
+ msgid "Widget title"
127
+ msgstr ""
128
+
129
  #: ../include/post-metabox.php:5
130
  msgid "Page's language:"
131
  msgstr ""
136
 
137
  #: ../include/term-translations.php:6
138
  #: ../include/term-translations.php:11
139
+ #: ../include/list-table.php:128
140
  msgid "Translations"
141
  msgstr ""
142
 
143
+ #: ../include/term-translations.php:16
144
  msgid "Translation"
145
  msgstr ""
146
 
147
+ #: ../include/term-translations.php:18
148
+ #: ../include/term-translations.php:65
149
+ #: ../include/list-table.php:26
150
  msgid "Edit"
151
  msgstr ""
152
 
153
+ #: ../include/term-translations.php:48
154
+ msgid "No untranslated term"
155
+ msgstr ""
156
+
157
+ #: ../include/term-translations.php:54
158
  msgid "Add new"
159
  msgstr ""
160
 
161
+ #: ../include/admin-filters.php:128
162
+ #: ../include/admin-filters.php:482
163
+ msgid "Add new translation"
164
+ msgstr ""
165
+
166
+ #: ../include/admin-filters.php:152
167
  msgid "Show all languages"
168
  msgstr ""
169
 
170
+ #: ../include/admin-filters.php:238
171
+ msgid "(no parent)"
172
+ msgstr ""
173
+
174
+ #: ../include/admin-filters.php:577
175
  msgid "Theme locations and languages"
176
  msgstr ""
177
 
178
+ #: ../include/admin-filters.php:582
179
  #, php-format
180
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
181
  msgstr ""
182
 
183
+ #: ../include/admin-filters.php:593
184
  msgid "The widget is displayed for:"
185
  msgstr ""
186
 
187
+ #: ../include/admin-filters.php:594
188
  msgid "All languages"
189
  msgstr ""
190
 
191
+ #: ../include/list-table.php:27
192
  msgid "Delete"
193
  msgstr ""
194
 
195
+ #: ../include/list-table.php:45
196
+ #: ../include/languages-form.php:67
197
  msgid "Full name"
198
  msgstr ""
199
 
200
+ #: ../include/list-table.php:46
201
+ #: ../include/languages-form.php:73
202
  msgid "Locale"
203
  msgstr ""
204
 
205
+ #: ../include/list-table.php:47
206
  msgid "Code"
207
  msgstr ""
208
 
209
+ #: ../include/list-table.php:48
210
+ #: ../include/languages-form.php:86
211
+ msgid "Order"
212
+ msgstr ""
213
+
214
+ #: ../include/list-table.php:49
215
  msgid "Flag"
216
  msgstr ""
217
 
218
+ #: ../include/list-table.php:50
219
  msgid "Posts"
220
  msgstr ""
221
 
222
+ #: ../include/list-table.php:105
223
+ msgid "Strings translations"
224
+ msgstr ""
225
+
226
+ #: ../include/list-table.php:126
227
+ msgid "Name"
228
+ msgstr ""
229
+
230
+ #: ../include/list-table.php:127
231
+ msgid "String"
232
+ msgstr ""
233
+
234
+ #: ../include/calendar.php:107
235
  #, php-format
236
  msgid "%1$s %2$s"
237
  msgstr ""
238
 
 
239
  #: ../include/calendar.php:133
240
+ #: ../include/calendar.php:141
241
  #, php-format
242
  msgid "View posts for %1$s %2$s"
243
  msgstr ""
247
  msgstr ""
248
 
249
  #: ../include/languages-form.php:33
250
+ #: ../include/languages-form.php:91
251
  msgid "Add new language"
252
  msgstr ""
253
 
254
+ #: ../include/languages-form.php:55
255
  msgid "Choose a language"
256
  msgstr ""
257
 
258
+ #: ../include/languages-form.php:63
259
  msgid "You can choose a language in the list or directly edit it below."
260
  msgstr ""
261
 
262
+ #: ../include/languages-form.php:69
263
  msgid "The name is how it is displayed on your site (for example: English)."
264
  msgstr ""
265
 
266
+ #: ../include/languages-form.php:76
267
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
268
  msgstr ""
269
 
270
+ #: ../include/languages-form.php:80
271
  msgid "Language code"
272
  msgstr ""
273
 
274
+ #: ../include/languages-form.php:82
275
  msgid "2-letters ISO 639-1 language code (for example: en)"
276
  msgstr ""
277
 
278
+ #: ../include/languages-form.php:88
279
+ msgid "Position of the language in the language switcher"
280
+ msgstr ""
281
+
282
+ #: ../include/languages-form.php:91
283
  msgid "Update"
284
  msgstr ""
285
 
286
+ #: ../include/languages-form.php:127
287
  msgid "Language switcher"
288
  msgstr ""
289
 
290
+ #: ../include/languages-form.php:166
291
  msgid "Default language"
292
  msgstr ""
293
 
294
+ #: ../include/languages-form.php:195
295
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
296
  msgstr ""
297
 
298
+ #: ../include/languages-form.php:203
299
  msgid "Detect browser language"
300
  msgstr ""
301
 
302
+ #: ../include/languages-form.php:209
303
  msgid "When the front page is visited, set the language according to the browser preference"
304
  msgstr ""
305
 
306
+ #: ../include/languages-form.php:216
307
  msgid "URL modifications"
308
  msgstr ""
309
 
310
+ #: ../include/languages-form.php:222
311
  msgid "Keep /language/ in pretty permalinks. Example:"
312
  msgstr ""
313
 
314
+ #: ../include/languages-form.php:230
315
  msgid "Remove /language/ in pretty permalinks. Example:"
316
  msgstr ""
317
 
318
+ #: ../include/languages-form.php:238
319
  msgid "Hide URL language information for default language"
320
  msgstr ""
321
 
polylang.php CHANGED
@@ -2,12 +2,12 @@
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
- Version: 0.5.1
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
9
 
10
- /* Copyright 2011 F. Demarle
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License, version 2, as
@@ -23,11 +23,19 @@ Description: Adds multilingual capability to Wordpress
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
 
26
- define('POLYLANG_VERSION', '0.5.1');
27
 
28
- define('POLYLANG_DIR', dirname(__FILE__));
29
  define('PLL_INC', POLYLANG_DIR.'/include');
30
 
 
 
 
 
 
 
 
 
31
  if (!defined('PLL_DISPLAY_ALL'))
32
  define('PLL_DISPLAY_ALL', false); // diplaying posts & terms with undefined language is disabled by default
33
 
@@ -39,14 +47,13 @@ require_once(PLL_INC.'/calendar.php');
39
  class Polylang extends Polylang_Base {
40
 
41
  function __construct() {
42
- global $polylang;
43
 
44
  // manages plugin activation and deactivation
45
  register_activation_hook( __FILE__, array(&$this, 'activate') );
46
  register_deactivation_hook( __FILE__, array(&$this, 'deactivate') );
47
 
48
  // manages plugin upgrade
49
- add_filter('upgrader_pre_install', array(&$this, 'pre_upgrade'));
50
  add_filter('upgrader_post_install', array(&$this, 'post_upgrade'));
51
  add_action('admin_init', array(&$this, 'admin_init'));
52
 
@@ -57,15 +64,18 @@ class Polylang extends Polylang_Base {
57
  // rewrite rules
58
  add_filter('rewrite_rules_array', array(&$this, 'rewrite_rules_array' ));
59
 
 
60
  if (is_admin()) {
61
  require_once(PLL_INC.'/admin.php');
62
- new Polylang_Admin();
63
  }
64
  else {
65
  require_once(PLL_INC.'/core.php');
66
- require_once(PLL_INC.'/api.php');
67
  $polylang = new Polylang_Core();
68
  }
 
 
 
69
  }
70
 
71
  // plugin activation for multisite
@@ -152,47 +162,22 @@ class Polylang extends Polylang_Base {
152
  $wp_rewrite->flush_rules();
153
  }
154
 
155
- // saves the local_flags directory before upgrade
156
- function pre_upgrade() {
157
- // nothing to backup
158
- if (!@is_dir($flags_dir = POLYLANG_DIR . '/local_flags'))
159
- return true;
160
-
161
- $upgrade_dirs = array(
162
- WP_CONTENT_DIR . '/upgrade',
163
- WP_CONTENT_DIR . '/upgrade/polylang'
164
- );
165
-
166
- foreach ($upgrade_dirs as $dir) {
167
- if (!@is_dir($dir) && !@mkdir($dir, 0755))
168
- return new WP_Error('polylang_upgrade_error', sprintf('%s<br />%s <strong>%s</strong>',
169
- __("Error: Upgrade directory doesn't exist!", 'polylang'),
170
- __('Please create', 'polylang'),
171
- esc_html($dir)
172
- ));
173
- }
174
-
175
- if (!@rename($flags_dir, WP_CONTENT_DIR . '/upgrade/polylang/local_flags'))
176
- return new WP_Error('polylang_backup_error', sprintf('%s<br />%s <strong>%s</strong>',
177
- __('Error: Backup of local flags failed!', 'polylang'),
178
- __('Please backup', 'polylang'),
179
- esc_html($flags_dir)
180
- ));
181
-
182
- return true;
183
- }
184
-
185
- // restores the local_flags directory after upgrade
186
  function post_upgrade() {
187
  // nothing to restore
188
  if (!@is_dir($upgrade_dir = WP_CONTENT_DIR . '/upgrade/polylang/local_flags'))
189
  return true;
190
 
191
- if (!@rename($upgrade_dir, POLYLANG_DIR . '/local_flags'))
192
- return new WP_Error('polylang_restore_error', sprintf('%s<br />%s (<strong>%s</strong>)',
 
 
 
 
 
 
193
  __('Error: Restore of local flags failed!', 'polylang'),
194
- __('Please restore your local flags', 'polylang'),
195
- esc_html($upgrade_dir)
196
  ));
197
 
198
  @rmdir(WP_CONTENT_DIR . '/upgrade/polylang');
@@ -228,8 +213,7 @@ class Polylang extends Polylang_Base {
228
  if (version_compare($options['version'], '0.4', '<'))
229
  $options['hide_default'] = 0; // option introduced in 0.4
230
 
231
- // translation model changed in 0.5
232
- // FIXME will not delete old data before 0.6 (just in case...)
233
  if (version_compare($options['version'], '0.5', '<')) {
234
  $ids = get_posts(array('numberposts'=>-1, 'fields' => 'ids', 'post_type'=>'any', 'post_status'=>'any'));
235
  $this->upgrade_translations('post', $ids);
@@ -237,6 +221,24 @@ class Polylang extends Polylang_Base {
237
  $this->upgrade_translations('term', $ids);
238
  }
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  $options['version'] = POLYLANG_VERSION;
241
  update_option('polylang', $options);
242
  }
@@ -331,5 +333,4 @@ class Polylang extends Polylang_Base {
331
 
332
  if (class_exists("Polylang"))
333
  new Polylang();
334
-
335
  ?>
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
+ Version: 0.6
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
9
 
10
+ /* Copyright 2011-2012 F. Demarle
11
 
12
  This program is free software; you can redistribute it and/or modify
13
  it under the terms of the GNU General Public License, version 2, as
23
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
  */
25
 
26
+ define('POLYLANG_VERSION', '0.6');
27
 
28
+ define('POLYLANG_DIR', dirname(__FILE__)); // our directory
29
  define('PLL_INC', POLYLANG_DIR.'/include');
30
 
31
+ define('POLYLANG_URL', WP_PLUGIN_URL.'/'.basename(POLYLANG_DIR)); // our url
32
+
33
+ if (!defined('PLL_LOCAL_DIR'))
34
+ define('PLL_LOCAL_DIR', WP_CONTENT_DIR.'/polylang'); // default directory to store user data such as custom flags
35
+
36
+ if (!defined('PLL_LOCAL_URL'))
37
+ define('PLL_LOCAL_URL', WP_CONTENT_URL.'/polylang'); // default url to access user data such as custom flags
38
+
39
  if (!defined('PLL_DISPLAY_ALL'))
40
  define('PLL_DISPLAY_ALL', false); // diplaying posts & terms with undefined language is disabled by default
41
 
47
  class Polylang extends Polylang_Base {
48
 
49
  function __construct() {
50
+ global $polylang; // globalize the variable to access it in the API
51
 
52
  // manages plugin activation and deactivation
53
  register_activation_hook( __FILE__, array(&$this, 'activate') );
54
  register_deactivation_hook( __FILE__, array(&$this, 'deactivate') );
55
 
56
  // manages plugin upgrade
 
57
  add_filter('upgrader_post_install', array(&$this, 'post_upgrade'));
58
  add_action('admin_init', array(&$this, 'admin_init'));
59
 
64
  // rewrite rules
65
  add_filter('rewrite_rules_array', array(&$this, 'rewrite_rules_array' ));
66
 
67
+ // separate admin and frontend
68
  if (is_admin()) {
69
  require_once(PLL_INC.'/admin.php');
70
+ $polylang = new Polylang_Admin();
71
  }
72
  else {
73
  require_once(PLL_INC.'/core.php');
 
74
  $polylang = new Polylang_Core();
75
  }
76
+
77
+ // loads the API
78
+ require_once(PLL_INC.'/api.php');
79
  }
80
 
81
  // plugin activation for multisite
162
  $wp_rewrite->flush_rules();
163
  }
164
 
165
+ // restores the local_flags directory after upgrade from version 0.5.1 or older
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  function post_upgrade() {
167
  // nothing to restore
168
  if (!@is_dir($upgrade_dir = WP_CONTENT_DIR . '/upgrade/polylang/local_flags'))
169
  return true;
170
 
171
+ // don't move if the directory is empty
172
+ $contents = @scandir($upgrade_dir);
173
+ if (is_array($contents) && ($files = array_diff($contents, array(".", "..", ".DS_Store", "_notes", "Thumbs.db"))) && empty($files))
174
+ return true;
175
+
176
+ // move the directory to wp-content
177
+ if (!@rename($upgrade_dir, PLL_LOCAL_DIR))
178
+ return new WP_Error('polylang_restore_error', sprintf('%s<br />%s',
179
  __('Error: Restore of local flags failed!', 'polylang'),
180
+ sprintf(__('Please move your local flags from %s to %s', 'polylang'), esc_html($upgrade_dir), '<strong>'.esc_html(PLL_LOCAL_DIR).'</strong>')
 
181
  ));
182
 
183
  @rmdir(WP_CONTENT_DIR . '/upgrade/polylang');
213
  if (version_compare($options['version'], '0.4', '<'))
214
  $options['hide_default'] = 0; // option introduced in 0.4
215
 
216
+ // translation model changed in V0.5
 
217
  if (version_compare($options['version'], '0.5', '<')) {
218
  $ids = get_posts(array('numberposts'=>-1, 'fields' => 'ids', 'post_type'=>'any', 'post_status'=>'any'));
219
  $this->upgrade_translations('post', $ids);
221
  $this->upgrade_translations('term', $ids);
222
  }
223
 
224
+ // translation model changed in V0.5
225
+ // deleting the old one has been delayed in V0.6 (just in case...)
226
+ if (version_compare($options['version'], '0.6', '<')) {
227
+ $listlanguages = $this->get_languages_list();
228
+
229
+ $ids = get_posts(array('numberposts'=> -1, 'fields' => 'ids', 'post_type'=>'any', 'post_status'=>'any'));
230
+ foreach ($ids as $id) {
231
+ foreach ($listlanguages as $lang)
232
+ delete_post_meta($id, '_lang-'.$lang->slug);
233
+ }
234
+
235
+ $ids = get_terms(get_taxonomies(array('show_ui'=>true)), array('get'=>'all', 'fields'=>'ids'));
236
+ foreach ($ids as $id) {
237
+ foreach ($listlanguages as $lang)
238
+ delete_metadata('term', $id, '_lang-'.$lang->slug);
239
+ }
240
+ }
241
+
242
  $options['version'] = POLYLANG_VERSION;
243
  update_option('polylang', $options);
244
  }
333
 
334
  if (class_exists("Polylang"))
335
  new Polylang();
 
336
  ?>
readme.txt CHANGED
@@ -3,22 +3,23 @@ Contributors: Chouby
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCWWYUUQV8F4E
4
  Tags: bilingual, language, i18n, international, l10n, localization, multilingual, multisite, translate, translation, widget
5
  Requires at least: 3.1
6
- Tested up to: 3.3
7
- Stable tag: 0.5.1
8
 
9
- Polylang adds multilingual support to WordPress. You set a language for each post and it will be displayed only when browsing this language.
10
 
11
  == Description ==
12
 
13
- You write posts, pages and create categories and post tags as usual, and then define the language for each of them. The translation is optional. A language switcher widget is provided with the plugin. The plugin does not integrate automatic or professional translation. You have to do the work yourself.
14
-
15
  = Upgrade Notice =
16
 
17
- Your custom flags in 'polylang/local_flags' directory will be removed when automatically upgrading from v0.4, v0.4.1, v0.4.2. So either do a manual upgrade or backup your custom flags. This problem is solved when upgrading from v0.4.3+ to a higher version. It's always safer to do a database backup before any upgrade.
 
 
18
 
19
- = Features =
20
 
21
  * You can create as many languages as you want
 
22
  * You can translate posts, pages, categories, post tags, menus
23
  * RSS feed available for each language
24
  * Support for Search form (see the FAQ in the documentation)
@@ -30,6 +31,7 @@ Your custom flags in 'polylang/local_flags' directory will be removed when autom
30
  * Each user can set the WordPress admin language in its profile (new in 0.4)
31
  * Support for custom post types and custom taxonomies (new in 0.4)
32
  * Support for multisite (new in 0.5)
 
33
 
34
  The plugin admin interface is currently available in:
35
 
@@ -37,12 +39,13 @@ The plugin admin interface is currently available in:
37
  * French
38
  * German contributed by [Christian Ries](http://www.singbyfoot.lu)
39
  * Russian contributed by [yoyurec](http://yoyurec.in.ua)
 
40
 
41
  Other translators are welcome !
42
 
43
  = Notes =
44
 
45
- * The tests have been made with WordPress from version 3.1 up to 3.3. The plugin does not work with WordPress 3.0.5 and older.
46
  * Your server must run PHP5
47
  * You must deactivate other multilingual plugins before activating Polylang, otherwise, you may get unexpected results !
48
  * Unlike some other plugins, if you deactivate Polylang, your blog will go on working as smoothly as possible. All your posts, pages, category and post tags would be accessible (without language filter of course...).
@@ -53,7 +56,7 @@ Don't hesitate to [give your feedback](http://wordpress.org/tags/polylang?forum_
53
 
54
  == Upgrade Notice ==
55
 
56
- Your custom flags in 'polylang/local_flags' directory will be removed when automatically upgrading from v0.4, v0.4.1, v0.4.2. So either do a manual upgrade or backup your custom flags. This problem is solved when upgrading from v0.4.3+ to a higher version. It's always safer to do a database backup before any upgrade.
57
 
58
  == Installation ==
59
 
@@ -63,8 +66,7 @@ Your custom flags in 'polylang/local_flags' directory will be removed when autom
63
  1. Activate the plugin through the 'Plugins' menu in WordPress.
64
  1. Add the 'language switcher' Widget to let your visitors switch the language.
65
  1. Go to the languages settings page and create the languages you need
66
- 1. Upload corresponding .mo files in WordPress languages directory (no need for English). You can download them from [here](http://svn.automattic.com/wordpress-i18n/).
67
- 1. Take care that your theme must come with the corresponding .mo file too. If your theme is not internationalized yet, please refer to the [codex](http://codex.wordpress.org/I18n_for_WordPress_Developers#I18n_for_theme_and_plugin_developers) or ask the theme author to internationalize it.
68
 
69
  == Frequently Asked Questions ==
70
 
@@ -89,14 +91,29 @@ Yes. Since v0.5
89
 
90
  = Can I use my own flags for the language switcher ? =
91
 
92
- Yes. You have to use PNG or JPG files and name them with the WordPress locale. For example, en_US.png. Then upload these files in the `/polylang/local_flags` directory. Don't use the `/polylang/flags` directory as your files would be removed when updating the plugin.
93
 
94
  == Screenshots ==
95
 
96
- 1. The Polylang languages admin panel in WordPress 3.3
97
 
98
  == Changelog ==
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  = 0.5.1 (2011-12-18) =
101
 
102
  * Improved German translation contributed by [Christian Ries](http://www.singbyfoot.lu)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CCWWYUUQV8F4E
4
  Tags: bilingual, language, i18n, international, l10n, localization, multilingual, multisite, translate, translation, widget
5
  Requires at least: 3.1
6
+ Tested up to: 3.3.1
7
+ Stable tag: 0.6
8
 
9
+ Polylang adds multilingual content management support to WordPress.
10
 
11
  == Description ==
12
 
 
 
13
  = Upgrade Notice =
14
 
15
+ Your custom flags in 'wp-content/plugins/polylang/local_flags' directory should move to 'wp-content/polylang'. People using the function 'pll_the_language' should be aware that it does not display the 'ul' tag anymore. I wrote about the reasons for these changes in the [forum](http://wordpress.org/support/topic/development-of-polylang-version-06).
16
+
17
+ = Features =
18
 
19
+ You write posts, pages and create categories and post tags as usual, and then define the language for each of them. The translation is optional. The plugin does not integrate automatic or professional translation.
20
 
21
  * You can create as many languages as you want
22
+ * WordPress languages files are automatically downloaded and updated (new in 0.6)
23
  * You can translate posts, pages, categories, post tags, menus
24
  * RSS feed available for each language
25
  * Support for Search form (see the FAQ in the documentation)
31
  * Each user can set the WordPress admin language in its profile (new in 0.4)
32
  * Support for custom post types and custom taxonomies (new in 0.4)
33
  * Support for multisite (new in 0.5)
34
+ * Categories, post tags as well as some other metas are automatically copied when adding a new post or page translation (new in 0.6)
35
 
36
  The plugin admin interface is currently available in:
37
 
39
  * French
40
  * German contributed by [Christian Ries](http://www.singbyfoot.lu)
41
  * Russian contributed by [yoyurec](http://yoyurec.in.ua)
42
+ * Greek contributed by [theodotos](http://www.ubuntucy.org)
43
 
44
  Other translators are welcome !
45
 
46
  = Notes =
47
 
48
+ * The tests have been made with WordPress 3.3.1.
49
  * Your server must run PHP5
50
  * You must deactivate other multilingual plugins before activating Polylang, otherwise, you may get unexpected results !
51
  * Unlike some other plugins, if you deactivate Polylang, your blog will go on working as smoothly as possible. All your posts, pages, category and post tags would be accessible (without language filter of course...).
56
 
57
  == Upgrade Notice ==
58
 
59
+ Your custom flags in 'wp-content/plugins/polylang/local_flags' directory shhould move to 'wp-content/polylang'. People using the function 'pll_the_language' should be aware that it does not display the ul tag anymore.
60
 
61
  == Installation ==
62
 
66
  1. Activate the plugin through the 'Plugins' menu in WordPress.
67
  1. Add the 'language switcher' Widget to let your visitors switch the language.
68
  1. Go to the languages settings page and create the languages you need
69
+ 1. Take care that your theme must come with the corresponding .mo files. If your theme is not internationalized yet, please refer to the [codex](http://codex.wordpress.org/I18n_for_WordPress_Developers#I18n_for_theme_and_plugin_developers) or ask the theme author to internationalize it.
 
70
 
71
  == Frequently Asked Questions ==
72
 
91
 
92
  = Can I use my own flags for the language switcher ? =
93
 
94
+ Yes. You have to use PNG or JPG files and name them with the WordPress locale. For example, en_US.png. Then upload these files in the `wp-content/polylang` directory. Don't use the `/polylang/flags` directory as your files would be removed when updating the plugin.
95
 
96
  == Screenshots ==
97
 
98
+ 1. The Polylang languages admin panel (v0.5) in WordPress 3.3
99
 
100
  == Changelog ==
101
 
102
+ = 0.6 (2012-01-07) =
103
+
104
+ * Add Greek translation contributed by [theodotos](http://www.ubuntucy.org)
105
+ * WordPress languages files are now automatically downloaded when creating a new langage (and updated when updating WordPress)
106
+ * Add the possibility to change the order of the languages in the language switcher
107
+ * Add the possibility to translate the site title, tagline and widgets titles
108
+ * Categories, post tags, featured image, page parent, page template and menu order are now copied when adding a new translation
109
+ * Translations are now accessibles in the "Posts", "Pages", "Categories" and "Post tags" admin panels
110
+ * Improve the dropdown language switcher widget (sends now to translated page or home page based on options)
111
+ * Move custom flags from polylang/local_flags to wp_content/polylang
112
+ * Add two options to "pll_the_languages" ('hide_if_no_translation' and 'hide_current'). *The function does not output ul tag anymore*
113
+ * Improve API
114
+ * Bug correction: Twenty eleven custom Header problem with v0.5.1
115
+ * Bug correction: front-page.php not loaded for translated front page
116
+
117
  = 0.5.1 (2011-12-18) =
118
 
119
  * Improved German translation contributed by [Christian Ries](http://www.singbyfoot.lu)
uninstall.php CHANGED
@@ -25,32 +25,28 @@ class Polylang_Uninstall {
25
 
26
  $languages = get_terms('language', array('hide_empty'=>false));
27
 
28
- $ids = get_posts(array('numberposts'=> -1, 'fields' => 'ids', 'post_type'=>'any', 'post_status'=>'any'));
29
- foreach ($ids as $id) {
30
- foreach ($languages as $lang)
31
- delete_post_meta($id, '_lang-'.$lang->slug); //FIXME before 0.5
32
-
33
- delete_post_meta($id, '_translations'); // V0.5+
34
- }
35
 
 
36
  $ids = get_terms(get_taxonomies(array('show_ui'=>true)), array('get'=>'all', 'fields'=>'ids'));
37
  foreach ($ids as $id) {
38
- foreach ($languages as $lang)
39
- delete_metadata('term', $id, '_lang-'.$lang->slug); //FIXME before 0.5
40
-
41
- delete_metadata('term', $id, '_translations'); // V0.5+
42
  delete_metadata('term', $id, '_language');
43
  }
44
-
45
- // finally delete languages
46
- foreach ($languages as $lang)
47
- wp_delete_term($lang->term_id, 'language');
 
48
 
49
  // delete the termmeta table only if it is empty as other plugins may use it
50
  $table = $wpdb->termmeta;
51
  $count = $wpdb->get_var("SELECT COUNT(*) FROM $table;");
52
  if (!$count) {
53
- $wpdb->query("DROP TABLE $table;");
54
  unset($wpdb->termmeta);
55
  }
56
 
25
 
26
  $languages = get_terms('language', array('hide_empty'=>false));
27
 
28
+ // delete posts translations
29
+ $ids = get_posts(array('numberposts'=> -1, 'fields' => 'ids', 'meta_key'=>'_translations', 'post_type'=>'any', 'post_status'=>'any'));
30
+ foreach ($ids as $id)
31
+ delete_post_meta($id, '_translations');
 
 
 
32
 
33
+ // delete terms translations
34
  $ids = get_terms(get_taxonomies(array('show_ui'=>true)), array('get'=>'all', 'fields'=>'ids'));
35
  foreach ($ids as $id) {
36
+ delete_metadata('term', $id, '_translations');
 
 
 
37
  delete_metadata('term', $id, '_language');
38
  }
39
+
40
+ foreach ($languages as $lang) {
41
+ delete_option('polylang_mo'.$lang->term_id); // delete the string translations
42
+ wp_delete_term($lang->term_id, 'language'); // finally delete languages
43
+ }
44
 
45
  // delete the termmeta table only if it is empty as other plugins may use it
46
  $table = $wpdb->termmeta;
47
  $count = $wpdb->get_var("SELECT COUNT(*) FROM $table;");
48
  if (!$count) {
49
+ $wpdb->query($wpdb->prepare("DROP TABLE $table;"));
50
  unset($wpdb->termmeta);
51
  }
52