Polylang - Version 0.7.2

Version Description

(2012-02-15) =

  • Add Polish translation contributed by Peter Paciorkiewicz
  • Add 5 new languages to predefined list
  • completely reworked rewrite rules
  • Bug correction: custom nav menus do not work in Artisteer generated themes
  • Bug correction: having a single language causes multiple warnings while saving post/page.
  • Bug correction: custom nav menu broken on archives pages
  • Bug correction: the language switcher does not link to translated post type archive when using pretty permalinks
  • Bug correction: the tags are not saved in the right language when translated tags have the same name
  • Bug correction: bad link in post preview when adding language code to all urls
  • Bug correction: feed not filtered by language when adding language code to all urls
  • Bug correction: duplicate canonical link when used together with WordPress SEO by Yoast
  • Bug correction: the all posts admin page is messed if another plugin adds a column
  • Bug correction: 404 error on static front page when adding language code to all urls (including default language)
Download this release

Release Info

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

Code changes from version 0.7.1 to 0.7.2

css/admin.css CHANGED
@@ -1,76 +1,2 @@
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 {
25
- width: 100%;
26
- text-align: left;
27
- font-size: 11px;
28
- margin: 0 6px;
29
- }
30
-
31
- #post-translations td {
32
- font-size: 11px;
33
- }
34
-
35
- .form-field input.tog {
36
- width: auto;
37
- margin-right: 2px;
38
- }
39
-
40
- .stringstranslations .column-name {
41
- width: 10%;
42
- }
43
-
44
- .stringstranslations .column-string {
45
- width: 36%;
46
- }
47
-
48
- .translation label {
49
- display: inline-block;
50
- width: 23%;
51
- }
52
-
53
- .translation input {
54
- width: 72%;
55
- }
56
-
57
- .column-term_group, .column-flag, .column-count {
58
- width : 10%;
59
- }
60
-
61
- th[class*='column-language_'] {
62
- width: 24px;
63
- }
64
-
65
- .pll_icon_add, .pll_icon_edit {
66
- display: block;
67
- width: 16px;
68
- height: 16px;
69
- background-image: url("icons.png");
70
- }
71
-
72
- .pll_icon_edit {background-position: 0px -24px;}
73
- .pll_icon_add {background-position: 16px -24px;}
74
-
75
- .pll_icon_edit:hover {background-position: 0px -40px;}
76
- .pll_icon_add:hover {background-position: 16px -40px;}
1
+ .column-term_group,.column-flag,.column-count{width:10%;}.form-field input.tog{width:auto;margin-right:2px;}.stringstranslations .column-name{width:10%;}.stringstranslations .column-string{width:36%;}.translation label{display:inline-block;width:23%;}.translation input{width:72%;}th[class*='column-language_']{width:24px;}.pll_icon_add,.pll_icon_edit{display:block;width:16px;height:16px;background-image:url("icons.png");}.pll_icon_edit{background-position:0 -24px;}.pll_icon_add{background-position:16px -24px;}.pll_icon_edit:hover{background-position:0 -40px;}.pll_icon_add:hover{background-position:16px -40px;}#post-translations table{width:100%;text-align:left;font-size:11px;margin:0 6px;}#post-translations td{font-size:11px;}#term-translations table{width:97%;}#term-translations th{padding:8px 10px;}#term-translations td{font-size:12px;line-height:26px;margin-bottom:9px;padding:4px 10px;}.tr-language-column{width:35%;}div#term-translations select[id*='tr_lang_']{width:95%;}tr#term-translations select[id*='tr_lang_']{width:65%;}.tr-edit-column{width:15%;}
 
 
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/admin.dev.css ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* languages admin panel */
2
+ .column-term_group, .column-flag, .column-count {
3
+ width : 10%;
4
+ }
5
+
6
+ .form-field input.tog {
7
+ width: auto;
8
+ margin-right: 2px;
9
+ }
10
+
11
+ /* strings translation table */
12
+ .stringstranslations .column-name {
13
+ width: 10%;
14
+ }
15
+
16
+ .stringstranslations .column-string {
17
+ width: 36%;
18
+ }
19
+
20
+ .translation label {
21
+ display: inline-block;
22
+ width: 23%;
23
+ }
24
+
25
+ .translation input {
26
+ width: 72%;
27
+ }
28
+
29
+ /* language columns in edit.php and edit-tags.php */
30
+ th[class*='column-language_'] {
31
+ width: 24px;
32
+ }
33
+
34
+ .pll_icon_add, .pll_icon_edit {
35
+ display: block;
36
+ width: 16px;
37
+ height: 16px;
38
+ background-image: url("icons.png");
39
+ }
40
+
41
+ .pll_icon_edit {background-position: 0px -24px;}
42
+ .pll_icon_add {background-position: 16px -24px;}
43
+
44
+ .pll_icon_edit:hover {background-position: 0px -40px;}
45
+ .pll_icon_add:hover {background-position: 16px -40px;}
46
+
47
+ /* languages metabox in post.php */
48
+ #post-translations table {
49
+ width: 100%;
50
+ text-align: left;
51
+ font-size: 11px;
52
+ margin: 0 6px;
53
+ }
54
+
55
+ #post-translations td {
56
+ font-size: 11px;
57
+ }
58
+
59
+ /* language and translations in edit-tags.php */
60
+ #term-translations table {
61
+ width: 97%;
62
+ }
63
+
64
+ #term-translations th {
65
+ padding: 8px 10px;
66
+ }
67
+
68
+ #term-translations td {
69
+ font-size: 12px;
70
+ line-height: 26px;
71
+ margin-bottom: 9px;
72
+ padding: 4px 10px;
73
+ }
74
+
75
+ .tr-language-column {
76
+ width: 35%;
77
+ }
78
+
79
+ div#term-translations select[id*='tr_lang_'] {
80
+ width: 95%;
81
+ }
82
+
83
+ tr#term-translations select[id*='tr_lang_'] {
84
+ width: 65%;
85
+ }
86
+
87
+
88
+ .tr-edit-column {
89
+ width: 15%;
90
+ }
doc/documentation-en.odt CHANGED
Binary file
doc/documentation-en.pdf CHANGED
Binary file
flags/cy.png ADDED
Binary file
flags/fo.png ADDED
Binary file
flags/is_IS.png ADDED
Binary file
flags/jv_ID.png ADDED
Binary file
flags/ka_GE.png ADDED
Binary file
flags/ro_RO.png ADDED
Binary file
include/admin-filters.php CHANGED
@@ -2,11 +2,9 @@
2
 
3
  // all modifications of the WordPress admin ui
4
  class Polylang_Admin_Filters extends Polylang_Base {
5
- private $options;
6
 
7
  function __construct() {
8
- // init options often needed
9
- $this->options = get_option('polylang');
10
 
11
  // additionnal filters and actions
12
  add_action('admin_init', array(&$this, 'admin_init'));
@@ -93,20 +91,26 @@ class Polylang_Admin_Filters extends Polylang_Base {
93
  WHERE tt.taxonomy = 'language' AND tt.description = %s LIMIT 1", get_locale())); // no function exists to get term by description
94
  if ($lang_id)
95
  $wp_locale->text_direction = get_metadata('term', $lang_id, '_rtl', true) ? 'rtl' : 'ltr';
 
 
 
96
  }
97
 
98
- // setup js scripts & css styles
99
  function admin_enqueue_scripts() {
100
- wp_enqueue_script('polylang_admin', POLYLANG_URL .'/js/admin.js', array('jquery', 'wp-ajax-response'), POLYLANG_VERSION);
101
- wp_enqueue_style('polylang_admin', POLYLANG_URL .'/css/admin.css', array(), POLYLANG_VERSION);
 
 
 
102
  }
103
 
104
- // adds the language and translations columns (before the date column) in the posts and pages list table
105
  function add_post_column($columns, $post_type ='') {
106
  if ($post_type == '' || get_post_type_object($post_type)->show_ui) {
107
- foreach (array( 'date', 'comments' ) as $k) {
108
- if (array_key_exists($k, $columns))
109
- $end[$k] = array_pop($columns);
110
  }
111
 
112
  foreach ($this->get_languages_list() as $language)
@@ -326,7 +330,7 @@ class Polylang_Admin_Filters extends Polylang_Base {
326
  // called when a post (or page) is saved, published or updated
327
  function save_post($post_id) {
328
  // avoids breaking translations when using inline or bulk edit
329
- if(isset($_POST['_inline_edit']) || isset($_GET['bulk_edit']))
330
  return;
331
 
332
  if ($id = wp_is_post_revision($post_id))
@@ -369,6 +373,21 @@ class Polylang_Admin_Filters extends Polylang_Base {
369
  if (!isset($_POST['post_lang_choice']))
370
  return;
371
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
372
  // save translations after checking the translated post is in the right language
373
  foreach ($_POST['post_tr_lang'] as $lang=>$tr_id)
374
  $translations[$lang] = $this->get_post_language((int) $tr_id)->slug == $lang ? (int) $tr_id : 0;
2
 
3
  // all modifications of the WordPress admin ui
4
  class Polylang_Admin_Filters extends Polylang_Base {
 
5
 
6
  function __construct() {
7
+ parent::__construct();
 
8
 
9
  // additionnal filters and actions
10
  add_action('admin_init', array(&$this, 'admin_init'));
91
  WHERE tt.taxonomy = 'language' AND tt.description = %s LIMIT 1", get_locale())); // no function exists to get term by description
92
  if ($lang_id)
93
  $wp_locale->text_direction = get_metadata('term', $lang_id, '_rtl', true) ? 'rtl' : 'ltr';
94
+
95
+ //modifies posts and terms links when need
96
+ $this->add_post_term_link_filters();
97
  }
98
 
99
+ // setup js scripts & css styles (only on the relevant pages)
100
  function admin_enqueue_scripts() {
101
+ $screen = get_current_screen();
102
+ if ($screen->base == 'settings_page_mlang' || $screen->base == 'post' || $screen->base == 'edit-tags')
103
+ wp_enqueue_script('polylang_admin', POLYLANG_URL .'/js/admin.js', array('jquery', 'wp-ajax-response'), POLYLANG_VERSION, true);
104
+ if ($screen->base == 'settings_page_mlang' || $screen->base == 'post' || $screen->base == 'edit-tags' || $screen->base == 'edit')
105
+ wp_enqueue_style('polylang_admin', POLYLANG_URL .'/css/admin.css', array(), POLYLANG_VERSION);
106
  }
107
 
108
+ // adds the language and translations columns (before the comments column) in the posts and pages list table
109
  function add_post_column($columns, $post_type ='') {
110
  if ($post_type == '' || get_post_type_object($post_type)->show_ui) {
111
+ if ($n = array_search('comments', array_keys($columns))) {
112
+ $end = array_slice($columns, $n);
113
+ $columns = array_slice($columns, 0, $n);
114
  }
115
 
116
  foreach ($this->get_languages_list() as $language)
330
  // called when a post (or page) is saved, published or updated
331
  function save_post($post_id) {
332
  // avoids breaking translations when using inline or bulk edit
333
+ if (isset($_POST['_inline_edit']) || isset($_GET['bulk_edit']))
334
  return;
335
 
336
  if ($id = wp_is_post_revision($post_id))
373
  if (!isset($_POST['post_lang_choice']))
374
  return;
375
 
376
+ // make sure we get save terms in the right language (especially tags with same name in different languages)
377
+ foreach (get_taxonomies(array('show_ui'=>true)) as $tax) {
378
+ $terms = get_the_terms($post_id, $tax);
379
+ if (is_array($terms)) {
380
+ foreach ($terms as $term) {
381
+ if ($term_id = $this->get_term($term->term_id, $_POST['post_lang_choice']))
382
+ $newterms[] = (int) $term_id; // cast is important otherwise we get 'numeric' tags
383
+ }
384
+ wp_set_object_terms($post_id, $newterms, $tax);
385
+ }
386
+ }
387
+
388
+ if (!isset($_POST['post_tr_lang'])) // just in case only one language has been created
389
+ return;
390
+
391
  // save translations after checking the translated post is in the right language
392
  foreach ($_POST['post_tr_lang'] as $lang=>$tr_id)
393
  $translations[$lang] = $this->get_post_language((int) $tr_id)->slug == $lang ? (int) $tr_id : 0;
include/admin.php CHANGED
@@ -36,7 +36,7 @@ class Polylang_Admin extends Polylang_Base {
36
  function update_translations($type, $ids, $old_slug) {
37
  foreach ($ids as $id) {
38
  $tr = get_metadata($type, $id, '_translations', true);
39
- if($tr) {
40
  $tr = unserialize($tr);
41
  $tr[$_POST['slug']] = $tr[$old_slug];
42
  unset($tr[$old_slug]);
@@ -49,7 +49,7 @@ class Polylang_Admin extends Polylang_Base {
49
  function delete_translations($type, $ids, $old_slug) {
50
  foreach ($ids as $id) {
51
  $tr = get_metadata($type, $id, '_translations', true);
52
- if($tr) {
53
  $tr = unserialize($tr);
54
  unset($tr[$old_slug]);
55
  update_metadata($type, $id, '_translations', serialize($tr));
@@ -270,12 +270,12 @@ class Polylang_Admin extends Polylang_Base {
270
 
271
  // fills existing posts & terms with default language
272
  if (isset($_POST['fill_languages'])) {
273
- if(isset($_POST['posts'])) {
274
  foreach(explode(',', $_POST['posts']) as $post_id) {
275
  $this->set_post_language($post_id, $options['default_lang']);
276
  }
277
  }
278
- if(isset($_POST['terms'])) {
279
  foreach(explode(',', $_POST['terms']) as $term_id) {
280
  $this->set_term_language($term_id, $options['default_lang']);
281
  }
@@ -295,7 +295,10 @@ class Polylang_Admin extends Polylang_Base {
295
  if (current_theme_supports('menus'))
296
  $tabs['menus'] = __('Menus','polylang'); // don't display the menu tab if the active theme does not support nav menus
297
 
298
- $tabs += array('strings' => __('Strings translation','polylang'), 'settings' => __('Settings', 'polylang'));
 
 
 
299
  }
300
 
301
  $active_tab = isset($_GET['tab']) && $_GET['tab'] ? $_GET['tab'] : 'lang';
@@ -413,8 +416,8 @@ class Polylang_Admin extends Polylang_Base {
413
  return true;
414
 
415
  // does language directory exists ?
416
- if(!is_dir(WP_LANG_DIR)) {
417
- if(!@mkdir(WP_LANG_DIR))
418
  return false;
419
  }
420
 
@@ -455,12 +458,13 @@ class Polylang_Admin extends Polylang_Base {
455
  continue;
456
 
457
  // try to download ms and continents-cities files if exist (will not return false if failed)
458
- foreach (array("ms-$locale.mo", "continent-cities-$locale.mo") as $file)
459
- wp_remote_get($base."$version/messages/$file", $args + array('filename' => WP_LANG_DIR."/$file"));
 
460
 
461
  // try to download theme files if exist (will not return false if failed)
462
  // FIXME not updated when the theme is updated outside a core update
463
- foreach (array("twentyten", "twentyeleven") as $theme)
464
  wp_remote_get($base."$version/messages/$theme/$locale.mo", $args + array('filename' => get_theme_root()."/$theme/languages/$locale.mo"));
465
 
466
  return true;
@@ -473,8 +477,10 @@ class Polylang_Admin extends Polylang_Base {
473
  // ugrades languages files after a core upgrade
474
  function upgrade_languages($version) {
475
  apply_filters('update_feedback', __('Upgrading language files…', 'polylang'));
476
- foreach ($this->get_languages_list() as $language)
477
- $this->download_mo($language->description, $version);
 
 
478
  }
479
 
480
  // returns options available for the language switcher (menu or widget)
@@ -515,7 +521,7 @@ class Polylang_Admin extends Polylang_Base {
515
  $widget_settings = $wp_registered_widgets[$widget]['callback'][0]->get_settings();
516
  $number = $wp_registered_widgets[$widget]['params'][0]['number'];
517
  $title = $widget_settings[$number]['title'];
518
- if(isset($title) && $title)
519
  $this->register_string(__('Widget title', 'polylang'), $title);
520
  }
521
  }
36
  function update_translations($type, $ids, $old_slug) {
37
  foreach ($ids as $id) {
38
  $tr = get_metadata($type, $id, '_translations', true);
39
+ if ($tr) {
40
  $tr = unserialize($tr);
41
  $tr[$_POST['slug']] = $tr[$old_slug];
42
  unset($tr[$old_slug]);
49
  function delete_translations($type, $ids, $old_slug) {
50
  foreach ($ids as $id) {
51
  $tr = get_metadata($type, $id, '_translations', true);
52
+ if ($tr) {
53
  $tr = unserialize($tr);
54
  unset($tr[$old_slug]);
55
  update_metadata($type, $id, '_translations', serialize($tr));
270
 
271
  // fills existing posts & terms with default language
272
  if (isset($_POST['fill_languages'])) {
273
+ if (isset($_POST['posts'])) {
274
  foreach(explode(',', $_POST['posts']) as $post_id) {
275
  $this->set_post_language($post_id, $options['default_lang']);
276
  }
277
  }
278
+ if (isset($_POST['terms'])) {
279
  foreach(explode(',', $_POST['terms']) as $term_id) {
280
  $this->set_term_language($term_id, $options['default_lang']);
281
  }
295
  if (current_theme_supports('menus'))
296
  $tabs['menus'] = __('Menus','polylang'); // don't display the menu tab if the active theme does not support nav menus
297
 
298
+ if (function_exists('base64_decode'))
299
+ $tabs['strings'] = __('Strings translation','polylang'); // some hosts disable the function for security reasons
300
+
301
+ $tabs['settings'] = __('Settings', 'polylang');
302
  }
303
 
304
  $active_tab = isset($_GET['tab']) && $_GET['tab'] ? $_GET['tab'] : 'lang';
416
  return true;
417
 
418
  // does language directory exists ?
419
+ if (!is_dir(WP_LANG_DIR)) {
420
+ if (!@mkdir(WP_LANG_DIR))
421
  return false;
422
  }
423
 
458
  continue;
459
 
460
  // try to download ms and continents-cities files if exist (will not return false if failed)
461
+ // with new files introduced in 3.4
462
+ foreach (array("ms", "continent-cities", "admin", "admin-network") as $file)
463
+ wp_remote_get($base."$version/messages/$file-$locale.mo", $args + array('filename' => WP_LANG_DIR."/$file-$locale.mo"));
464
 
465
  // try to download theme files if exist (will not return false if failed)
466
  // FIXME not updated when the theme is updated outside a core update
467
+ foreach (array("twentyten", "twentyeleven", "twentytwelve") as $theme)
468
  wp_remote_get($base."$version/messages/$theme/$locale.mo", $args + array('filename' => get_theme_root()."/$theme/languages/$locale.mo"));
469
 
470
  return true;
477
  // ugrades languages files after a core upgrade
478
  function upgrade_languages($version) {
479
  apply_filters('update_feedback', __('Upgrading language files…', 'polylang'));
480
+ foreach ($this->get_languages_list() as $language) {
481
+ if ($language->description != $_POST['locale']) // do not (re)update the language files of a localized WordPress
482
+ $this->download_mo($language->description, $version);
483
+ }
484
  }
485
 
486
  // returns options available for the language switcher (menu or widget)
521
  $widget_settings = $wp_registered_widgets[$widget]['callback'][0]->get_settings();
522
  $number = $wp_registered_widgets[$widget]['params'][0]['number'];
523
  $title = $widget_settings[$number]['title'];
524
+ if (isset($title) && $title)
525
  $this->register_string(__('Widget title', 'polylang'), $title);
526
  }
527
  }
include/base.php CHANGED
@@ -2,19 +2,14 @@
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
- }
17
- return $qvars;
18
  }
19
 
20
  // returns the list of available languages
@@ -138,6 +133,48 @@ abstract class Polylang_Base {
138
  return $this->get_term_language($term_id)->term_id == $lang->term_id ? $term_id : $this->get_translation('term', $term_id, $lang);
139
  }
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  // returns the html link to the flag if exists
142
  // $lang: object
143
  function get_flag($lang) {
2
 
3
  // setups basic functions used for admin and frontend
4
  abstract class Polylang_Base {
5
+ protected $options;
6
+ protected $home;
7
+ protected $strings; // strings to translate
8
+
9
+ function __construct() {
10
+ // init options often needed
11
+ $this->options = get_option('polylang');
12
+ $this->home = get_option('home');
 
 
 
 
 
13
  }
14
 
15
  // returns the list of available languages
133
  return $this->get_term_language($term_id)->term_id == $lang->term_id ? $term_id : $this->get_translation('term', $term_id, $lang);
134
  }
135
 
136
+ // adds language information to a link when using pretty permalinks
137
+ function add_language_to_link($url, $lang) {
138
+ if (!isset($lang)) // FIXME avoid notice when adding a page to a custom menu
139
+ return;
140
+
141
+ if ($GLOBALS['wp_rewrite']->using_permalinks()) {
142
+ $base = $this->options['rewrite'] ? '/' : '/language/';
143
+ $slug = $this->options['default_lang'] == $lang->slug && $this->options['hide_default'] ? '' : $base.$lang->slug;
144
+ return esc_url(str_replace($this->home, $this->home.$slug, $url));
145
+ }
146
+
147
+ // special case for pages which do not accept adding the lang parameter
148
+ // FIXME check if it's still the case for WP3.4
149
+ elseif ('_get_page_link' != current_filter())
150
+ return add_query_arg( 'lang', $lang->slug, $url );
151
+
152
+ return $url;
153
+ }
154
+
155
+ // optionally rewrite posts, pages links to filter them by language
156
+ // rewrite post format (and optionally categories and post tags) archives links to filter them by language
157
+ function add_post_term_link_filters() {
158
+ if ($this->options['force_lang']) {
159
+ foreach (array('post_link', '_get_page_link', 'post_type_link') as $filter)
160
+ add_filter($filter, array(&$this, 'post_link'), 10, 2);
161
+ }
162
+
163
+ add_filter('term_link', array(&$this, 'term_link'), 10, 3);
164
+ }
165
+
166
+ // modifies post & page links
167
+ function post_link($link, $post) {
168
+ $id = '_get_page_link' == current_filter() ? $post : $post->ID;
169
+ return $this->add_language_to_link($link, $this->get_post_language($id));
170
+ }
171
+
172
+ // modifies term link
173
+ function term_link($link, $term, $tax) {
174
+ return $tax == 'post_format' || ($this->options['force_lang'] && $tax != 'language') ?
175
+ $this->add_language_to_link($link, $this->get_term_language($term->term_id)) : $link;
176
+ }
177
+
178
  // returns the html link to the flag if exists
179
  // $lang: object
180
  function get_flag($lang) {
include/core.php CHANGED
@@ -6,18 +6,16 @@ class Polylang_Core extends Polylang_base {
6
  private $default_locale;
7
  private $list_textdomains = array(); // all text domains
8
  private $search_form_filter = false; // did we pass our get_search_form filter ?
 
9
 
10
  // options often needed
11
- private $home;
12
- private $options;
13
  private $page_for_posts;
14
  private $page_on_front;
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');
22
  $this->page_on_front = get_option('page_on_front');
23
 
@@ -28,6 +26,7 @@ class Polylang_Core extends Polylang_base {
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
@@ -39,9 +38,11 @@ class Polylang_Core extends Polylang_base {
39
  add_filter('terms_clauses', array(&$this, 'terms_clauses'), 10, 3);
40
 
41
  // meta in the html head section
42
- remove_action('wp_head', 'rel_canonical');
43
  add_action('wp_head', array(&$this, 'wp_head'));
44
 
 
 
 
45
  // prevents redirection of the homepage
46
  add_filter('redirect_canonical', array(&$this, 'redirect_canonical'), 10, 2);
47
 
@@ -67,16 +68,10 @@ class Polylang_Core extends Polylang_base {
67
  foreach (array('feed_link', 'author_link', 'post_type_archive_link', 'year_link', 'month_link', 'day_link') as $filter)
68
  add_filter($filter, array(&$this, 'archive_link'));
69
 
70
- // optionally rewrite posts, pages links to filter them by language
71
- if ($this->options['force_lang']) {
72
- foreach (array('post_link', '_get_page_link', 'post_type_link') as $filter)
73
- add_filter($filter, array(&$this, 'post_link'), 10, 2);
74
- }
75
-
76
- // rewrite post format (and optionally categories and post tags) archives links to filter them by language
77
- add_filter('term_link', array(&$this, 'term_link'), 10, 3);
78
 
79
  // filters the nav menus according to the current language
 
80
  add_filter('wp_nav_menu_args', array(&$this, 'wp_nav_menu_args'));
81
  add_filter('wp_nav_menu_items', array(&$this, 'wp_nav_menu_items'), 10, 2);
82
  add_filter('wp_nav_menu_objects', array(&$this, 'wp_nav_menu_objects'), 10, 2);
@@ -149,7 +144,7 @@ class Polylang_Core extends Polylang_base {
149
  // returns the current language
150
  function get_current_language() {
151
 
152
- if($this->curlang)
153
  return $this->curlang;
154
 
155
  // no language set for 404 and attachment
@@ -195,8 +190,11 @@ class Polylang_Core extends Polylang_base {
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
@@ -207,12 +205,14 @@ class Polylang_Core extends Polylang_base {
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, as well as for text direction
218
  global $wp_locale;
@@ -247,7 +247,7 @@ class Polylang_Core extends Polylang_base {
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);
251
  else
252
  $url = $this->add_language_to_link(home_url(), $this->curlang);
253
 
@@ -268,12 +268,12 @@ class Polylang_Core extends Polylang_base {
268
  // If permalinks are used, WordPress does set and use $query->queried_object_id and sets $query->query_vars['page_id'] to 0
269
  // and does set and use $query->query_vars['page_id'] if permalinks are not used :(
270
  if (isset($query->queried_object_id))
271
- $page_id = $query->queried_object_id;
272
  elseif (isset($qvars['page_id']))
273
- $page_id = $qvars['page_id'];
274
 
275
- if (isset($page_id) && $page_id && $this->get_post($page_id, $this->get_post_language($this->page_for_posts)) == $this->page_for_posts) {
276
- $query->set('lang',$this->get_post_language($page_id)->slug);
277
  $query->queried_object_id = $this->page_for_posts;
278
  $query->query_vars['page_id'] = $this->page_for_posts; // FIXME the trick works but breaks .current-menu-item and .current_page_item
279
  $query->is_page = false;
@@ -282,15 +282,19 @@ class Polylang_Core extends Polylang_base {
282
  $query->is_singular = false;
283
  }
284
  }
285
-
286
  // FIXME to generalize as I probably forget things
287
- // sets the language in case we hide the default language
288
- if ($this->options['hide_default'] && !isset($qvars['lang']) && (
289
- (count($query->query) == 1 && isset($qvars['paged']) && $qvars['paged']) ||
290
  (isset($qvars['m']) && $qvars['m']) ||
291
- (count($query->query) == 1 && isset($qvars['feed']) && $qvars['feed']) ||
292
  (isset($qvars['author']) && $qvars['author']) ||
293
- (isset($qvars['post_type']) && $qvars['post_type'] && is_archive()) ))
 
 
 
 
 
 
 
294
  $query->set('lang', $this->options['default_lang']);
295
 
296
  // allow filtering recent posts by the current language
@@ -328,11 +332,21 @@ class Polylang_Core extends Polylang_base {
328
  }
329
  }
330
 
 
 
 
 
 
 
 
 
 
 
331
  // filters categories and post tags by language when needed
332
  function terms_clauses($clauses, $taxonomies, $args) {
333
  // does nothing except on taxonomies which have show_ui set to 1 (includes category and post_tags)
334
  foreach ($taxonomies as $tax) {
335
- if(!get_taxonomy($tax)->show_ui)
336
  return $clauses;
337
  }
338
 
@@ -342,18 +356,6 @@ class Polylang_Core extends Polylang_base {
342
 
343
  // meta in the html head section
344
  function wp_head() {
345
- // modifies the canonical link to the homepage
346
- if (is_singular()) {
347
- global $wp_the_query;
348
- if ($id = $wp_the_query->get_queried_object_id()) {
349
- if (is_page())
350
- $link = _get_page_link($id); // ignores page_on_front unlike get_permalink
351
- else
352
- $link = get_permalink ($id);
353
- echo "<link rel='canonical' href='$link' />\n";
354
- }
355
- }
356
-
357
  // outputs references to translated pages (if exists) in the html head section
358
  foreach ($this->get_languages_list() as $language) {
359
  if ($language->slug != $this->curlang->slug && $url = $this->get_translation_url($language))
@@ -361,6 +363,13 @@ class Polylang_Core extends Polylang_base {
361
  }
362
  }
363
 
 
 
 
 
 
 
 
364
  // prevents redirection of the homepage
365
  function redirect_canonical($redirect_url, $requested_url) {
366
  return $requested_url == _get_page_link($this->page_on_front) ? false : $redirect_url;
@@ -430,30 +439,6 @@ class Polylang_Core extends Polylang_base {
430
  return $sql . $wpdb->prepare(" AND pll_tr.term_taxonomy_id = %d", $this->curlang->term_taxonomy_id);
431
  }
432
 
433
- // adds language information to a link when using pretty permalinks
434
- function add_language_to_link($url, $lang) {
435
- global $wp_rewrite;
436
- if ($wp_rewrite->using_permalinks()) {
437
- $base = $this->options['rewrite'] ? '/' : '/language/';
438
- $slug = $this->options['default_lang'] == $lang->slug && $this->options['hide_default'] ? '' : $base.$lang->slug;
439
- return esc_url(str_replace($this->home, $this->home.$slug, $url));
440
- }
441
- else
442
- return add_query_arg( 'lang', $lang->slug, $url );
443
- }
444
-
445
- // modifies post & page links
446
- function post_link($link, $post) {
447
- $id = '_get_page_link' ==current_filter() ? $post : $post->ID;
448
- return $this->add_language_to_link($link, $this->get_post_language($id));
449
- }
450
-
451
- // modifies term link
452
- function term_link($link, $term, $tax) {
453
- return $tax == 'post_format' || ($this->options['force_lang'] && $tax != 'language') ?
454
- $this->add_language_to_link($link, $this->get_term_language($term->term_id)) : $link;
455
- }
456
-
457
  // modifies the author and date links to add the language parameter (as well as feed link)
458
  function archive_link($link) {
459
  return $this->add_language_to_link($link, $this->curlang);
@@ -470,8 +455,8 @@ class Polylang_Core extends Polylang_base {
470
  $url = get_permalink($id);
471
 
472
  // page for posts
473
- elseif (get_option('show_on_front') == 'page' && isset($wp_query->queried_object_id) && $wp_query->queried_object_id == $this->page_for_posts &&
474
- $id = $this->get_post($this->page_for_posts, $language))
475
  $url = get_permalink($id);
476
 
477
  elseif (is_page() && $id = $this->get_post($wp_query->queried_object_id, $language))
@@ -509,6 +494,9 @@ class Polylang_Core extends Polylang_base {
509
 
510
  if (is_tax('post_format'))
511
  $url = esc_url($base.'type/'.$qvars['post_format'].'/');
 
 
 
512
  }
513
  else
514
  $url = $hide ? remove_query_arg('lang') : add_query_arg('lang', $language->slug);
@@ -520,7 +508,20 @@ class Polylang_Core extends Polylang_base {
520
  return isset($url) ? $url : null;
521
  }
522
 
523
- // filters the nav menus according to the current language
 
 
 
 
 
 
 
 
 
 
 
 
 
524
  function wp_nav_menu_args($args) {
525
  if (!$args['menu'] && $args['theme_location']) {
526
  $menu_lang = get_option('polylang_nav_menus');
@@ -530,17 +531,10 @@ class Polylang_Core extends Polylang_base {
530
  return $args;
531
  }
532
 
533
- // filters the widgets according to the current language
534
- function widget_display_callback($instance, $widget, $args) {
535
- $widget_lang = get_option('polylang_widgets');
536
- // don't display if a language filter is set and this is not the current one
537
- return isset($widget_lang[$widget->id]) && $widget_lang[$widget->id] && $widget_lang[$widget->id] != $this->curlang->slug ? false : $instance;
538
- }
539
-
540
  // adds the language switcher at the end of the menu
541
  function wp_nav_menu_items($items, $args) {
542
  $menu_lang = get_option('polylang_nav_menus');
543
- return isset($menu_lang[$args->theme_location]['switcher']) && $menu_lang[$args->theme_location]['switcher'] ?
544
  $items . $this->the_languages(array_merge($menu_lang[$args->theme_location], array('menu' => 1, 'echo' => 0))) : $items;
545
  }
546
 
@@ -558,12 +552,6 @@ class Polylang_Core extends Polylang_base {
558
  $item->classes = array_merge($item->classes, $classes);
559
  }
560
  }
561
-
562
- foreach($menu_items as $item) {
563
- if ($item->object == 'page')
564
- $item->url = _get_page_link($item->object_id); // avoids bad link on translated front page
565
- }
566
-
567
  return $menu_items;
568
  }
569
 
@@ -586,13 +574,20 @@ class Polylang_Core extends Polylang_base {
586
  if ($this->page_on_front) {
587
  $id = $this->get_post($this->page_on_front, $this->curlang);
588
  $url = _get_page_link($id);
589
- $title = apply_filters( 'the_title', get_page($id)->post_title);
590
  $menu = str_replace('<li class="page_item page-item-'.$id.'"><a href="'.$url.'">'.$title.'</a></li>', '', $menu);
591
  $menu = str_replace('<li class="page_item page-item-'.$id.' current_page_item"><a href="'.$url.'">'.$title.'</a></li>', '', $menu);
592
  }
593
  return $menu;
594
  }
595
 
 
 
 
 
 
 
 
596
  // translates widget titles
597
  function widget_title($title) {
598
  return __($title, 'pll_string');
6
  private $default_locale;
7
  private $list_textdomains = array(); // all text domains
8
  private $search_form_filter = false; // did we pass our get_search_form filter ?
9
+ private $page_id;
10
 
11
  // options often needed
 
 
12
  private $page_for_posts;
13
  private $page_on_front;
14
 
15
  function __construct() {
16
+ parent::__construct();
17
 
18
  // init options often needed
 
 
19
  $this->page_for_posts = get_option('page_for_posts');
20
  $this->page_on_front = get_option('page_on_front');
21
 
26
 
27
  // filters posts according to the language
28
  add_filter('pre_get_posts', array(&$this, 'pre_get_posts'));
29
+ add_filter('wp', array(&$this, 'post_get_posts'));
30
  }
31
 
32
  // set these filters and actions only once the current language has been defined
38
  add_filter('terms_clauses', array(&$this, 'terms_clauses'), 10, 3);
39
 
40
  // meta in the html head section
 
41
  add_action('wp_head', array(&$this, 'wp_head'));
42
 
43
+ // modifies the page link in case the front page is not in the default language
44
+ add_filter('page_link', array(&$this, 'page_link'), 10, 2);
45
+
46
  // prevents redirection of the homepage
47
  add_filter('redirect_canonical', array(&$this, 'redirect_canonical'), 10, 2);
48
 
68
  foreach (array('feed_link', 'author_link', 'post_type_archive_link', 'year_link', 'month_link', 'day_link') as $filter)
69
  add_filter($filter, array(&$this, 'archive_link'));
70
 
71
+ $this->add_post_term_link_filters(); // these filters are in base as they may be used on admin side too
 
 
 
 
 
 
 
72
 
73
  // filters the nav menus according to the current language
74
+ add_filter('theme_mod_nav_menu_locations', array(&$this, 'nav_menu_locations'));
75
  add_filter('wp_nav_menu_args', array(&$this, 'wp_nav_menu_args'));
76
  add_filter('wp_nav_menu_items', array(&$this, 'wp_nav_menu_items'), 10, 2);
77
  add_filter('wp_nav_menu_objects', array(&$this, 'wp_nav_menu_objects'), 10, 2);
144
  // returns the current language
145
  function get_current_language() {
146
 
147
+ if ($this->curlang)
148
  return $this->curlang;
149
 
150
  // no language set for 404 and attachment
190
  if (!($this->curlang = $this->get_current_language()))
191
  return; // something went wrong
192
 
193
+ // set a cookie to remember the language. check headers have not been sent to avoid ugly error
194
+ if (!headers_sent())
195
+ setcookie('wordpress_polylang', $this->curlang->slug, time() + 31536000 /* 1 year */, COOKIEPATH, COOKIE_DOMAIN);
196
+
197
+ // set all our language filters and actions
198
  $this->add_language_filters();
199
 
200
  // our override_load_textdomain filter has done its job. let's remove it before calling load_textdomain
205
  foreach ($this->list_textdomains as $textdomain)
206
  load_textdomain( $textdomain['domain'], str_replace($this->default_locale, $new_locale, $textdomain['mo']));
207
 
208
+ // and finally load user defined strings (check first that base64_decode is not disabled)
209
+ if (function_exists('base64_decode')) {
210
+ global $l10n;
211
+ $mo = new MO();
212
+ $reader = new POMO_StringReader(base64_decode(get_option('polylang_mo'.$this->curlang->term_id)));
213
+ $mo->import_from_reader($reader);
214
+ $l10n['pll_string'] = &$mo;
215
+ }
216
 
217
  // reinitializes wp_locale for weekdays and months, as well as for text direction
218
  global $wp_locale;
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 = $this->add_language_to_link(_get_page_link($link_id), $this->curlang);
251
  else
252
  $url = $this->add_language_to_link(home_url(), $this->curlang);
253
 
268
  // If permalinks are used, WordPress does set and use $query->queried_object_id and sets $query->query_vars['page_id'] to 0
269
  // and does set and use $query->query_vars['page_id'] if permalinks are not used :(
270
  if (isset($query->queried_object_id))
271
+ $this->page_id = $query->queried_object_id;
272
  elseif (isset($qvars['page_id']))
273
+ $this->page_id = $qvars['page_id'];
274
 
275
+ if (isset($this->page_id) && $this->page_id && $this->get_post($this->page_id, $this->get_post_language($this->page_for_posts)) == $this->page_for_posts) {
276
+ $query->set('lang',$this->get_post_language($this->page_id)->slug);
277
  $query->queried_object_id = $this->page_for_posts;
278
  $query->query_vars['page_id'] = $this->page_for_posts; // FIXME the trick works but breaks .current-menu-item and .current_page_item
279
  $query->is_page = false;
282
  $query->is_singular = false;
283
  }
284
  }
285
+
286
  // FIXME to generalize as I probably forget things
287
+ $is_archive = (count($query->query) == 1 && isset($qvars['paged']) && $qvars['paged']) ||
 
 
288
  (isset($qvars['m']) && $qvars['m']) ||
 
289
  (isset($qvars['author']) && $qvars['author']) ||
290
+ (isset($qvars['post_type']) && is_post_type_archive() && !in_array($qvars['post_type'], get_post_types(array('show_ui' => false))));
291
+
292
+ // sets 404 when the language is not set for archives needing the language in the url
293
+ if (!$this->options['hide_default'] && !isset($qvars['lang']) && !$GLOBALS['wp_rewrite']->using_permalinks() && $is_archive)
294
+ $query->set_404();
295
+
296
+ // sets the language in case we hide the default language
297
+ if ($this->options['hide_default'] && !isset($qvars['lang']) && ($is_archive || (count($query->query) == 1 && isset($qvars['feed']) && $qvars['feed']) ))
298
  $query->set('lang', $this->options['default_lang']);
299
 
300
  // allow filtering recent posts by the current language
332
  }
333
  }
334
 
335
+ // used only for page for posts: after posts have been selected, come back to right page_id
336
+ // may be useful for some plugins ?
337
+ function post_get_posts() {
338
+ if ($this->page_id) {
339
+ global $wp_query;
340
+ $wp_query->queried_object_id = $this->page_id;
341
+ $wp_query->query_vars['page_id'] = $this->page_id;
342
+ }
343
+ }
344
+
345
  // filters categories and post tags by language when needed
346
  function terms_clauses($clauses, $taxonomies, $args) {
347
  // does nothing except on taxonomies which have show_ui set to 1 (includes category and post_tags)
348
  foreach ($taxonomies as $tax) {
349
+ if (!get_taxonomy($tax)->show_ui)
350
  return $clauses;
351
  }
352
 
356
 
357
  // meta in the html head section
358
  function wp_head() {
 
 
 
 
 
 
 
 
 
 
 
 
359
  // outputs references to translated pages (if exists) in the html head section
360
  foreach ($this->get_languages_list() as $language) {
361
  if ($language->slug != $this->curlang->slug && $url = $this->get_translation_url($language))
363
  }
364
  }
365
 
366
+ // modifies the page link in case the front page is not in the default language
367
+ function page_link($link, $id) {
368
+ if ($this->page_on_front && $id == $this->get_post($this->page_on_front, $this->options['default_lang']))
369
+ return home_url('/');
370
+ return _get_page_link($id);
371
+ }
372
+
373
  // prevents redirection of the homepage
374
  function redirect_canonical($redirect_url, $requested_url) {
375
  return $requested_url == _get_page_link($this->page_on_front) ? false : $redirect_url;
439
  return $sql . $wpdb->prepare(" AND pll_tr.term_taxonomy_id = %d", $this->curlang->term_taxonomy_id);
440
  }
441
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  // modifies the author and date links to add the language parameter (as well as feed link)
443
  function archive_link($link) {
444
  return $this->add_language_to_link($link, $this->curlang);
455
  $url = get_permalink($id);
456
 
457
  // page for posts
458
+ elseif (get_option('show_on_front') == 'page' && isset($wp_query->queried_object_id) &&
459
+ $this->get_post($wp_query->queried_object_id, $language) == ($id = $this->get_post($this->page_for_posts, $language)))
460
  $url = get_permalink($id);
461
 
462
  elseif (is_page() && $id = $this->get_post($wp_query->queried_object_id, $language))
494
 
495
  if (is_tax('post_format'))
496
  $url = esc_url($base.'type/'.$qvars['post_format'].'/');
497
+
498
+ if (is_post_type_archive())
499
+ $url = esc_url($base.$qvars['post_type'].'/');
500
  }
501
  else
502
  $url = $hide ? remove_query_arg('lang') : add_query_arg('lang', $language->slug);
508
  return isset($url) ? $url : null;
509
  }
510
 
511
+ // filters the nav menus according to the current language when called from get_nav_menu_locations()
512
+ // mainly for Artisteer generated themes
513
+ function nav_menu_locations($menus) {
514
+ if (is_array($menus)) {
515
+ foreach($menus as $location => $menu) {
516
+ $menu_lang = get_option('polylang_nav_menus');
517
+ if (isset($menu_lang[$location][$this->curlang->slug]))
518
+ $menus[$location] = $menu_lang[$location][$this->curlang->slug];
519
+ }
520
+ }
521
+ return $menus;
522
+ }
523
+
524
+ // filters the nav menus according to the current language when called from wp_nav_menus
525
  function wp_nav_menu_args($args) {
526
  if (!$args['menu'] && $args['theme_location']) {
527
  $menu_lang = get_option('polylang_nav_menus');
531
  return $args;
532
  }
533
 
 
 
 
 
 
 
 
534
  // adds the language switcher at the end of the menu
535
  function wp_nav_menu_items($items, $args) {
536
  $menu_lang = get_option('polylang_nav_menus');
537
+ return isset($args->theme_location) && isset($menu_lang[$args->theme_location]['switcher']) && $menu_lang[$args->theme_location]['switcher'] ?
538
  $items . $this->the_languages(array_merge($menu_lang[$args->theme_location], array('menu' => 1, 'echo' => 0))) : $items;
539
  }
540
 
552
  $item->classes = array_merge($item->classes, $classes);
553
  }
554
  }
 
 
 
 
 
 
555
  return $menu_items;
556
  }
557
 
574
  if ($this->page_on_front) {
575
  $id = $this->get_post($this->page_on_front, $this->curlang);
576
  $url = _get_page_link($id);
577
+ $title = apply_filters('the_title', get_page($id)->post_title);
578
  $menu = str_replace('<li class="page_item page-item-'.$id.'"><a href="'.$url.'">'.$title.'</a></li>', '', $menu);
579
  $menu = str_replace('<li class="page_item page-item-'.$id.' current_page_item"><a href="'.$url.'">'.$title.'</a></li>', '', $menu);
580
  }
581
  return $menu;
582
  }
583
 
584
+ // filters the widgets according to the current language
585
+ function widget_display_callback($instance, $widget, $args) {
586
+ $widget_lang = get_option('polylang_widgets');
587
+ // don't display if a language filter is set and this is not the current one
588
+ return isset($widget_lang[$widget->id]) && $widget_lang[$widget->id] && $widget_lang[$widget->id] != $this->curlang->slug ? false : $instance;
589
+ }
590
+
591
  // translates widget titles
592
  function widget_title($title) {
593
  return __($title, 'pll_string');
include/languages-form.php CHANGED
@@ -57,7 +57,7 @@ if (isset($_GET['error'])) {?>
57
  <option value=""></option>';<?php
58
  include(PLL_INC.'/languages.php');
59
  foreach ($languages as $lg) {
60
- printf('<option value="%1$s-%2$s-%3$s">%4$s - %2$s</option>'."\n", esc_attr($lg[0]), esc_attr($lg[1]), $lg[3] ? '1' : '0' , esc_html($lg[2]));
61
  } ?>
62
  </select>
63
  <p><?php _e('You can choose a language in the list or directly edit it below.', 'polylang');?></p>
57
  <option value=""></option>';<?php
58
  include(PLL_INC.'/languages.php');
59
  foreach ($languages as $lg) {
60
+ printf('<option value="%1$s-%2$s-%3$s">%4$s - %2$s</option>'."\n", esc_attr($lg[0]), esc_attr($lg[1]), isset($lg[3]) ? '1' : '0' , esc_html($lg[2]));
61
  } ?>
62
  </select>
63
  <p><?php _e('You can choose a language in the list or directly edit it below.', 'polylang');?></p>
include/languages.php CHANGED
@@ -10,6 +10,7 @@ $languages = array(
10
  array('bs', 'bs_BA', 'Bosanski'),
11
  array('ca', 'ca', 'Català'),
12
  array('cs', 'cs_CZ', 'Čeština'),
 
13
  array('da', 'da_DK', 'Dansk'),
14
  array('de', 'de_DE', 'Deutsch'),
15
  array('el', 'el', 'Ελληνικά'),
@@ -22,6 +23,7 @@ $languages = array(
22
  array('et', 'et', 'Eesti'),
23
  array('fa', 'fa_IR', 'فارسی', 'rtl'),
24
  array('fi', 'fi', 'Suomi'),
 
25
  array('fr', 'fr_FR', 'Français'),
26
  array('fy', 'fy', 'Frysk'),
27
  array('gl', 'gl_ES', 'Galego'),
@@ -31,15 +33,18 @@ $languages = array(
31
  array('id', 'id_ID', 'Bahasa Indonesia'),
32
  array('it', 'it_IT', 'Italiano'),
33
  array('ja', 'ja', '日本語'),
 
 
34
  array('ko', 'ko_KR', '한국어'),
35
  array('lv', 'lv', 'Latviešu valoda'),
36
  array('mk', 'mk_MK', 'македонски јазик'),
37
  array('my', 'my_MM', 'ဗမာစာ'),
38
- array('nb', 'nb_NO', 'Norsk'),
39
  array('nl', 'nl_NL', 'Nederlands'),
40
  array('pl', 'pl_PL', 'Polski'),
41
  array('pt', 'pt_BR', 'Português'),
42
  array('pt', 'pt_PT', 'Português'),
 
43
  array('ru', 'ru_RU', 'Русский'),
44
  array('si', 'si_LK', 'සිංහල'),
45
  array('sk', 'sk_SK', 'Slovenčina'),
10
  array('bs', 'bs_BA', 'Bosanski'),
11
  array('ca', 'ca', 'Català'),
12
  array('cs', 'cs_CZ', 'Čeština'),
13
+ array('cy', 'cy', 'Cymraeg'),
14
  array('da', 'da_DK', 'Dansk'),
15
  array('de', 'de_DE', 'Deutsch'),
16
  array('el', 'el', 'Ελληνικά'),
23
  array('et', 'et', 'Eesti'),
24
  array('fa', 'fa_IR', 'فارسی', 'rtl'),
25
  array('fi', 'fi', 'Suomi'),
26
+ array('fo', 'fo', 'Føroyskt'),
27
  array('fr', 'fr_FR', 'Français'),
28
  array('fy', 'fy', 'Frysk'),
29
  array('gl', 'gl_ES', 'Galego'),
33
  array('id', 'id_ID', 'Bahasa Indonesia'),
34
  array('it', 'it_IT', 'Italiano'),
35
  array('ja', 'ja', '日本語'),
36
+ array('jv', 'jv_ID', 'Basa Jawa'),
37
+ array('ka', 'ka_GE', 'ქართული'),
38
  array('ko', 'ko_KR', '한국어'),
39
  array('lv', 'lv', 'Latviešu valoda'),
40
  array('mk', 'mk_MK', 'македонски јазик'),
41
  array('my', 'my_MM', 'ဗမာစာ'),
42
+ array('nb', 'nb_NO', 'Norsk Bokmål'),
43
  array('nl', 'nl_NL', 'Nederlands'),
44
  array('pl', 'pl_PL', 'Polski'),
45
  array('pt', 'pt_BR', 'Português'),
46
  array('pt', 'pt_PT', 'Português'),
47
+ array('ro', 'ro_RO', 'Română'),
48
  array('ru', 'ru_RU', 'Русский'),
49
  array('si', 'si_LK', 'සිංහල'),
50
  array('sk', 'sk_SK', 'Slovenčina'),
js/admin.dev.js ADDED
@@ -0,0 +1,305 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var pll_tagBox;
2
+
3
+ // mainly copy paste of WP code
4
+ (function($){
5
+
6
+ pll_tagBox = {
7
+ clean : function(tags) {
8
+ return tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
9
+ },
10
+
11
+ parseTags : function(el) {
12
+ var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'), thetags = taxbox.find('.the-tags'), current_tags = thetags.val().split(','), new_tags = [];
13
+ delete current_tags[num];
14
+
15
+ $.each( current_tags, function(key, val) {
16
+ val = $.trim(val);
17
+ if ( val ) {
18
+ new_tags.push(val);
19
+ }
20
+ });
21
+
22
+ thetags.val( this.clean( new_tags.join(',') ) );
23
+
24
+ this.quickClicks(taxbox);
25
+ return false;
26
+ },
27
+
28
+ quickClicks : function(el) {
29
+ var thetags = $('.the-tags', el),
30
+ tagchecklist = $('.tagchecklist', el),
31
+ id = $(el).attr('id'),
32
+ current_tags, disabled;
33
+
34
+ if ( !thetags.length )
35
+ return;
36
+
37
+ disabled = thetags.prop('disabled');
38
+
39
+ current_tags = thetags.val().split(',');
40
+ tagchecklist.empty();
41
+
42
+ $.each( current_tags, function( key, val ) {
43
+ var span, xbutton;
44
+
45
+ val = $.trim( val );
46
+
47
+ if ( ! val )
48
+ return;
49
+
50
+ // Create a new span, and ensure the text is properly escaped.
51
+ span = $('<span />').text( val );
52
+
53
+ // If tags editing isn't disabled, create the X button.
54
+ if ( ! disabled ) {
55
+ xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
56
+ xbutton.click( function(){ pll_tagBox.parseTags(this); });
57
+ span.prepend('&nbsp;').prepend( xbutton );
58
+ }
59
+
60
+ // Append the span to the tag list.
61
+ tagchecklist.append( span );
62
+ });
63
+ },
64
+
65
+ flushTags : function(el, a, f) {
66
+ a = a || false;
67
+ var text, tags = $('.the-tags', el), newtag = $('input.newtag', el), newtags;
68
+
69
+ text = a ? $(a).text() : newtag.val();
70
+ tagsval = tags.val();
71
+ newtags = tagsval ? tagsval + ',' + text : text;
72
+
73
+ newtags = this.clean( newtags );
74
+ newtags = array_unique_noempty( newtags.split(',') ).join(',');
75
+ tags.val(newtags);
76
+ this.quickClicks(el);
77
+
78
+ if ( !a )
79
+ newtag.val('');
80
+ if ( 'undefined' == typeof(f) )
81
+ newtag.focus();
82
+
83
+ return false;
84
+ },
85
+
86
+ get : function(id, a) {
87
+ var tax = id.substr(id.indexOf('-')+1);
88
+
89
+ // add the language in the $_POST variable
90
+ var data = {
91
+ action: 'get-tagcloud',
92
+ lang: $('#post_lang_choice').attr('value'),
93
+ tax: tax
94
+ }
95
+
96
+ $.post(ajaxurl, data, function(r, stat) {
97
+ if ( 0 == r || 'success' != stat )
98
+ r = wpAjax.broken;
99
+
100
+ r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
101
+ $('a', r).click(function(){
102
+ pll_tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);
103
+ return false;
104
+ });
105
+
106
+ // add an if else condition to allow modifying the tags outputed when switching the language
107
+ if (a == 1)
108
+ $('#'+id).after(r);
109
+ else {
110
+ v = $('.the-tagcloud').css('display');
111
+ $('.the-tagcloud').replaceWith(r);
112
+ $('.the-tagcloud').css('display', v);
113
+ }
114
+ });
115
+ },
116
+
117
+ suggest : function() {
118
+ ajaxtag = $('div.ajaxtag');
119
+ // add the unbind function to allow calling the function when the language is modified
120
+ $('input.newtag', ajaxtag).unbind().blur(function() {
121
+ if ( this.value == '' )
122
+ $(this).parent().siblings('.taghint').css('visibility', '');
123
+ }).focus(function(){
124
+ $(this).parent().siblings('.taghint').css('visibility', 'hidden');
125
+ }).keyup(function(e){
126
+ if ( 13 == e.which ) {
127
+ pll_tagBox.flushTags( $(this).closest('.tagsdiv') );
128
+ return false;
129
+ }
130
+ }).keypress(function(e){
131
+ if ( 13 == e.which ) {
132
+ e.preventDefault();
133
+ return false;
134
+ }
135
+ }).each(function(){
136
+ // add the language in the $_GET variable
137
+ var lang = $('#post_lang_choice').attr('value');
138
+ var tax = $(this).closest('div.tagsdiv').attr('id');
139
+ $(this).suggest( ajaxurl + '?action=polylang-ajax-tag-search&lang=' + lang + '&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: "," } );
140
+ });
141
+ },
142
+
143
+ init : function() {
144
+ var t = this, ajaxtag = $('div.ajaxtag');
145
+
146
+ $('.tagsdiv').each( function() {
147
+ pll_tagBox.quickClicks(this);
148
+ });
149
+
150
+ $('input.tagadd', ajaxtag).click(function(){
151
+ t.flushTags( $(this).closest('.tagsdiv') );
152
+ });
153
+
154
+ $('div.taghint', ajaxtag).click(function(){
155
+ $(this).css('visibility', 'hidden').parent().siblings('.newtag').focus();
156
+ });
157
+
158
+ pll_tagBox.suggest();
159
+
160
+ // save tags on post save/publish
161
+ $('#post').submit(function(){
162
+ $('div.tagsdiv').each( function() {
163
+ pll_tagBox.flushTags(this, false, 1);
164
+ });
165
+ });
166
+
167
+ // tag cloud
168
+ $('a.tagcloud-link').click(function(){
169
+ pll_tagBox.get( $(this).attr('id'), 1 );
170
+ $(this).unbind().click(function(){
171
+ $(this).siblings('.the-tagcloud').toggle();
172
+ return false;
173
+ });
174
+ return false;
175
+ });
176
+ }
177
+ };
178
+
179
+ })(jQuery);
180
+
181
+ jQuery(document).ready(function($) {
182
+
183
+ // collect taxonomies - code partly copied from WordPress
184
+ var taxonomies = new Array();
185
+ $('.categorydiv').each( function(){
186
+ var this_id = $(this).attr('id'), taxonomyParts, taxonomy;
187
+
188
+ taxonomyParts = this_id.split('-');
189
+ taxonomyParts.shift();
190
+ taxonomy = taxonomyParts.join('-');
191
+ taxonomies.push(taxonomy); // store the taxonomy for future use
192
+
193
+ // add our hidden field in the new category form - for each hierarchical taxonomy
194
+ $('#' + taxonomy + '-add-submit').before($('<input />')
195
+ .attr('type', 'hidden')
196
+ .attr('id', taxonomy + '-lang')
197
+ .attr('name', 'term_lang_choice')
198
+ .attr('value', $('#post_lang_choice').attr('value'))
199
+ );
200
+ });
201
+
202
+ // ajax for changing the post's language in the languages metabox
203
+ $('#post_lang_choice').change( function() {
204
+ var data = {
205
+ action: 'post_lang_choice',
206
+ lang: $(this).attr('value'),
207
+ taxonomies: taxonomies,
208
+ post_id: $('#post_ID').attr('value')
209
+ }
210
+
211
+ $.post(ajaxurl, data , function(response) {
212
+ var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
213
+ $.each(res.responses, function() {
214
+ switch (this.what) {
215
+ case 'translations': // translations fields
216
+ $('#post-translations').html(this.data);
217
+ break;
218
+ case 'taxonomy': // categories metabox for posts
219
+ var tax = this.data;
220
+ $('#' + tax + 'checklist').html(this.supplemental.all);
221
+ $('#' + tax + 'checklist-pop').html(this.supplemental.populars);
222
+ $('#new' + tax + '_parent').replaceWith(this.supplemental.dropdown);
223
+ $('#' + tax + '-lang').val($('#post_lang_choice').attr('value')); // hidden field
224
+ break;
225
+ case 'pages': // parent dropdown list for pages
226
+ $('#parent_id').replaceWith(this.data);
227
+ break;
228
+ default:
229
+ break;
230
+ }
231
+ });
232
+
233
+ // modifies the language in the tag cloud
234
+ $('.tagcloud-link').each(function() {
235
+ var id = $(this).attr('id');
236
+ pll_tagBox.get(id, 0);
237
+ });
238
+
239
+ // modifies the language in the tags suggestion input
240
+ pll_tagBox.suggest();
241
+ });
242
+ });
243
+
244
+ // Tag box
245
+
246
+ // replace WP class by our own to avoid using tagBox functions
247
+ $('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){
248
+ if ( this.id.indexOf('tagsdiv-') === 0 ) {
249
+ $(this).attr('id', 'pll-' + this.id);
250
+ }
251
+ });
252
+
253
+ // copy paste WP code
254
+ // replace tagsdiv by pll-tagsdiv and tagBox by pll_tagBox
255
+ if ( $('#pll-tagsdiv-post_tag').length ) {
256
+ pll_tagBox.init();
257
+ } else {
258
+ $('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){
259
+ if ( this.id.indexOf('pll-tagsdiv-') === 0 ) {
260
+ pll_tagBox.init();
261
+ return false;
262
+ }
263
+ });
264
+ }
265
+
266
+
267
+ // ajax for changing the term's language
268
+ $('#term_lang_choice').change(function() {
269
+ var data = {
270
+ action: 'term_lang_choice',
271
+ lang: $(this).attr('value'),
272
+ term_id: $("input[name='tag_ID']").attr('value'),
273
+ taxonomy: $("input[name='taxonomy']").attr('value')
274
+ }
275
+
276
+ $.post(ajaxurl, data, function(response) {
277
+ var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
278
+ $.each(res.responses, function() {
279
+ switch (this.what) {
280
+ case 'translations': // translations fields
281
+ $("#term-translations").html(this.data);
282
+ break;
283
+ case 'parent': // parent dropdown list for hierarchical taxonomies
284
+ $('#parent').replaceWith(this.data);
285
+ break;
286
+ default:
287
+ break;
288
+ }
289
+ });
290
+ });
291
+ });
292
+
293
+
294
+ // languages form
295
+ // fills the fields based on the language dropdown list choice
296
+ $('#lang_list').change(function() {
297
+ value = $(this).attr('value').split('-');
298
+ selected = $("select option:selected").text().split(' - ');
299
+ $('input[name="slug"]').val(value[0]);
300
+ $('input[name="description"]').val(value[1]);
301
+ $('input[name="rtl"]').val([value[2]]);
302
+ $('input[name="name"]').val(selected[0]);
303
+ });
304
+
305
+ });
js/admin.js CHANGED
@@ -1,305 +1,13 @@
1
- var pll_tagBox;
2
-
3
- // mainly copy paste of WP code
4
- (function($){
5
-
6
- pll_tagBox = {
7
- clean : function(tags) {
8
- return tags.replace(/\s*,\s*/g, ',').replace(/,+/g, ',').replace(/[,\s]+$/, '').replace(/^[,\s]+/, '');
9
- },
10
-
11
- parseTags : function(el) {
12
- var id = el.id, num = id.split('-check-num-')[1], taxbox = $(el).closest('.tagsdiv'), thetags = taxbox.find('.the-tags'), current_tags = thetags.val().split(','), new_tags = [];
13
- delete current_tags[num];
14
-
15
- $.each( current_tags, function(key, val) {
16
- val = $.trim(val);
17
- if ( val ) {
18
- new_tags.push(val);
19
- }
20
- });
21
-
22
- thetags.val( this.clean( new_tags.join(',') ) );
23
-
24
- this.quickClicks(taxbox);
25
- return false;
26
- },
27
-
28
- quickClicks : function(el) {
29
- var thetags = $('.the-tags', el),
30
- tagchecklist = $('.tagchecklist', el),
31
- id = $(el).attr('id'),
32
- current_tags, disabled;
33
-
34
- if ( !thetags.length )
35
- return;
36
-
37
- disabled = thetags.prop('disabled');
38
-
39
- current_tags = thetags.val().split(',');
40
- tagchecklist.empty();
41
-
42
- $.each( current_tags, function( key, val ) {
43
- var span, xbutton;
44
-
45
- val = $.trim( val );
46
-
47
- if ( ! val )
48
- return;
49
-
50
- // Create a new span, and ensure the text is properly escaped.
51
- span = $('<span />').text( val );
52
-
53
- // If tags editing isn't disabled, create the X button.
54
- if ( ! disabled ) {
55
- xbutton = $( '<a id="' + id + '-check-num-' + key + '" class="ntdelbutton">X</a>' );
56
- xbutton.click( function(){ pll_tagBox.parseTags(this); });
57
- span.prepend('&nbsp;').prepend( xbutton );
58
- }
59
-
60
- // Append the span to the tag list.
61
- tagchecklist.append( span );
62
- });
63
- },
64
-
65
- flushTags : function(el, a, f) {
66
- a = a || false;
67
- var text, tags = $('.the-tags', el), newtag = $('input.newtag', el), newtags;
68
-
69
- text = a ? $(a).text() : newtag.val();
70
- tagsval = tags.val();
71
- newtags = tagsval ? tagsval + ',' + text : text;
72
-
73
- newtags = this.clean( newtags );
74
- newtags = array_unique_noempty( newtags.split(',') ).join(',');
75
- tags.val(newtags);
76
- this.quickClicks(el);
77
-
78
- if ( !a )
79
- newtag.val('');
80
- if ( 'undefined' == typeof(f) )
81
- newtag.focus();
82
-
83
- return false;
84
- },
85
-
86
- get : function(id, a) {
87
- var tax = id.substr(id.indexOf('-')+1);
88
-
89
- // add the language in the $_POST variable
90
- var data = {
91
- action: 'get-tagcloud',
92
- lang: jQuery('#post_lang_choice').attr('value'),
93
- tax: tax
94
- }
95
-
96
- $.post(ajaxurl, data, function(r, stat) {
97
- if ( 0 == r || 'success' != stat )
98
- r = wpAjax.broken;
99
-
100
- r = $('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');
101
- $('a', r).click(function(){
102
- pll_tagBox.flushTags( $(this).closest('.inside').children('.tagsdiv'), this);
103
- return false;
104
- });
105
-
106
- // add an if else condition to allow modifying the tags outputed when switching the language
107
- if (a == 1)
108
- $('#'+id).after(r);
109
- else {
110
- v = $('.the-tagcloud').css('display');
111
- $('.the-tagcloud').replaceWith(r);
112
- $('.the-tagcloud').css('display', v);
113
- }
114
- });
115
- },
116
-
117
- suggest : function() {
118
- ajaxtag = $('div.ajaxtag');
119
- // add the unbind function to allow calling the function when the language is modified
120
- $('input.newtag', ajaxtag).unbind().blur(function() {
121
- if ( this.value == '' )
122
- $(this).parent().siblings('.taghint').css('visibility', '');
123
- }).focus(function(){
124
- $(this).parent().siblings('.taghint').css('visibility', 'hidden');
125
- }).keyup(function(e){
126
- if ( 13 == e.which ) {
127
- pll_tagBox.flushTags( $(this).closest('.tagsdiv') );
128
- return false;
129
- }
130
- }).keypress(function(e){
131
- if ( 13 == e.which ) {
132
- e.preventDefault();
133
- return false;
134
- }
135
- }).each(function(){
136
- // add the language in the $_GET variable
137
- var lang = jQuery('#post_lang_choice').attr('value');
138
- var tax = $(this).closest('div.tagsdiv').attr('id');
139
- $(this).suggest( ajaxurl + '?action=polylang-ajax-tag-search&lang=' + lang + '&tax=' + tax, { delay: 500, minchars: 2, multiple: true, multipleSep: "," } );
140
- });
141
- },
142
-
143
- init : function() {
144
- var t = this, ajaxtag = $('div.ajaxtag');
145
-
146
- $('.tagsdiv').each( function() {
147
- pll_tagBox.quickClicks(this);
148
- });
149
-
150
- $('input.tagadd', ajaxtag).click(function(){
151
- t.flushTags( $(this).closest('.tagsdiv') );
152
- });
153
-
154
- $('div.taghint', ajaxtag).click(function(){
155
- $(this).css('visibility', 'hidden').parent().siblings('.newtag').focus();
156
- });
157
-
158
- pll_tagBox.suggest();
159
-
160
- // save tags on post save/publish
161
- $('#post').submit(function(){
162
- $('div.tagsdiv').each( function() {
163
- pll_tagBox.flushTags(this, false, 1);
164
- });
165
- });
166
-
167
- // tag cloud
168
- $('a.tagcloud-link').click(function(){
169
- pll_tagBox.get( $(this).attr('id'), 1 );
170
- $(this).unbind().click(function(){
171
- $(this).siblings('.the-tagcloud').toggle();
172
- return false;
173
- });
174
- return false;
175
- });
176
- }
177
- };
178
-
179
- })(jQuery);
180
-
181
- jQuery(document).ready(function($) {
182
-
183
- // collect taxonomies - code partly copied from WordPress
184
- var taxonomies = new Array();
185
- $('.categorydiv').each( function(){
186
- var this_id = $(this).attr('id'), taxonomyParts, taxonomy;
187
-
188
- taxonomyParts = this_id.split('-');
189
- taxonomyParts.shift();
190
- taxonomy = taxonomyParts.join('-');
191
- taxonomies.push(taxonomy); // store the taxonomy for future use
192
-
193
- // add our hidden field in the new category form - for each hierarchical taxonomy
194
- jQuery('#' + taxonomy + '-add-submit').before($('<input />')
195
- .attr('type', 'hidden')
196
- .attr('id', taxonomy + '-lang')
197
- .attr('name', 'term_lang_choice')
198
- .attr('value', jQuery('#post_lang_choice').attr('value'))
199
- );
200
- });
201
-
202
- // ajax for post metabox
203
- jQuery('#post_lang_choice').change( function() {
204
- var data = {
205
- action: 'post_lang_choice',
206
- lang: jQuery(this).attr('value'),
207
- taxonomies: taxonomies,
208
- post_id: jQuery('#post_ID').attr('value')
209
- }
210
-
211
- jQuery.post(ajaxurl, data , function(response) {
212
- var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
213
- $.each(res.responses, function() {
214
- switch (this.what) {
215
- case 'translations': // translations fields
216
- jQuery('#post-translations').html(this.data);
217
- break;
218
- case 'taxonomy': // categories metabox for posts
219
- var tax = this.data;
220
- jQuery('#' + tax + 'checklist').html(this.supplemental.all);
221
- jQuery('#' + tax + 'checklist-pop').html(this.supplemental.populars);
222
- jQuery('#new' + tax + '_parent').replaceWith(this.supplemental.dropdown);
223
- jQuery('#' + tax + '-lang').val(jQuery('#post_lang_choice').attr('value')); // hidden field
224
- break;
225
- case 'pages': // parent dropdown list for pages
226
- jQuery('#parent_id').replaceWith(this.data);
227
- break;
228
- default:
229
- break;
230
- }
231
- });
232
-
233
- // modifies the language in the tag cloud
234
- jQuery('.tagcloud-link').each(function() {
235
- var id = $(this).attr('id');
236
- pll_tagBox.get(id, 0);
237
- });
238
-
239
- // modifies the language in the tags suggestion input
240
- pll_tagBox.suggest();
241
- });
242
- });
243
-
244
- // Tag box
245
-
246
- // replace WP class by our own to avoid using tagBox functions
247
- $('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){
248
- if ( this.id.indexOf('tagsdiv-') === 0 ) {
249
- $(this).attr('id', 'pll-' + this.id);
250
- }
251
- });
252
-
253
- // copy paste WP code
254
- // replace tagsdiv by pll-tagsdiv and tagBox by pll_tagBox
255
- if ( $('#pll-tagsdiv-post_tag').length ) {
256
- pll_tagBox.init();
257
- } else {
258
- $('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){
259
- if ( this.id.indexOf('pll-tagsdiv-') === 0 ) {
260
- pll_tagBox.init();
261
- return false;
262
- }
263
- });
264
- }
265
-
266
-
267
- // ajax for term edit
268
- jQuery('#term_lang_choice').change(function() {
269
- var data = {
270
- action: 'term_lang_choice',
271
- lang: jQuery(this).attr('value'),
272
- term_id: jQuery("input[name='tag_ID']").attr('value'),
273
- taxonomy: jQuery("input[name='taxonomy']").attr('value')
274
- }
275
-
276
- jQuery.post(ajaxurl, data, function(response) {
277
- var res = wpAjax.parseAjaxResponse(response, 'ajax-response');
278
- $.each(res.responses, function() {
279
- switch (this.what) {
280
- case 'translations': // translations fields
281
- jQuery("#term-translations").html(this.data);
282
- break;
283
- case 'parent': // parent dropdown list for hierarchical taxonomies
284
- jQuery('#parent').replaceWith(this.data);
285
- break;
286
- default:
287
- break;
288
- }
289
- });
290
- });
291
- });
292
-
293
-
294
- // languages form
295
- // fills the fields based on dropdown list choice
296
- jQuery('#lang_list').change(function() {
297
- value = jQuery(this).attr('value').split('-');
298
- selected = $("select option:selected").text().split(' - ');
299
- jQuery('input[name="slug"]').val(value[0]);
300
- jQuery('input[name="description"]').val(value[1]);
301
- jQuery('input[name="rtl"]').val([value[2]]);
302
- jQuery('input[name="name"]').val(selected[0]);
303
- });
304
-
305
- });
1
+ var pll_tagBox;(function($){pll_tagBox={clean:function(tags){return tags.replace(/\s*,\s*/g,',').replace(/,+/g,',').replace(/[,\s]+$/,'').replace(/^[,\s]+/,'');},parseTags:function(el){var id=el.id,num=id.split('-check-num-')[1],taxbox=$(el).closest('.tagsdiv'),thetags=taxbox.find('.the-tags'),current_tags=thetags.val().split(','),new_tags=[];delete current_tags[num];$.each(current_tags,function(key,val){val=$.trim(val);if(val){new_tags.push(val);}});thetags.val(this.clean(new_tags.join(',')));this.quickClicks(taxbox);return false;},quickClicks:function(el){var thetags=$('.the-tags',el),tagchecklist=$('.tagchecklist',el),id=$(el).attr('id'),current_tags,disabled;if(!thetags.length)
2
+ return;disabled=thetags.prop('disabled');current_tags=thetags.val().split(',');tagchecklist.empty();$.each(current_tags,function(key,val){var span,xbutton;val=$.trim(val);if(!val)
3
+ return;span=$('<span />').text(val);if(!disabled){xbutton=$('<a id="'+id+'-check-num-'+key+'" class="ntdelbutton">X</a>');xbutton.click(function(){pll_tagBox.parseTags(this);});span.prepend(' ').prepend(xbutton);}
4
+ tagchecklist.append(span);});},flushTags:function(el,a,f){a=a||false;var text,tags=$('.the-tags',el),newtag=$('input.newtag',el),newtags;text=a?$(a).text():newtag.val();tagsval=tags.val();newtags=tagsval?tagsval+','+text:text;newtags=this.clean(newtags);newtags=array_unique_noempty(newtags.split(',')).join(',');tags.val(newtags);this.quickClicks(el);if(!a)
5
+ newtag.val('');if('undefined'==typeof(f))
6
+ newtag.focus();return false;},get:function(id,a){var tax=id.substr(id.indexOf('-')+1);var data={action:'get-tagcloud',lang:$('#post_lang_choice').attr('value'),tax:tax}
7
+ $.post(ajaxurl,data,function(r,stat){if(0==r||'success'!=stat)
8
+ r=wpAjax.broken;r=$('<p id="tagcloud-'+tax+'" class="the-tagcloud">'+r+'</p>');$('a',r).click(function(){pll_tagBox.flushTags($(this).closest('.inside').children('.tagsdiv'),this);return false;});if(a==1)
9
+ $('#'+id).after(r);else{v=$('.the-tagcloud').css('display');$('.the-tagcloud').replaceWith(r);$('.the-tagcloud').css('display',v);}});},suggest:function(){ajaxtag=$('div.ajaxtag');$('input.newtag',ajaxtag).unbind().blur(function(){if(this.value=='')
10
+ $(this).parent().siblings('.taghint').css('visibility','');}).focus(function(){$(this).parent().siblings('.taghint').css('visibility','hidden');}).keyup(function(e){if(13==e.which){pll_tagBox.flushTags($(this).closest('.tagsdiv'));return false;}}).keypress(function(e){if(13==e.which){e.preventDefault();return false;}}).each(function(){var lang=$('#post_lang_choice').attr('value');var tax=$(this).closest('div.tagsdiv').attr('id');$(this).suggest(ajaxurl+'?action=polylang-ajax-tag-search&lang='+lang+'&tax='+tax,{delay:500,minchars:2,multiple:true,multipleSep:","});});},init:function(){var t=this,ajaxtag=$('div.ajaxtag');$('.tagsdiv').each(function(){pll_tagBox.quickClicks(this);});$('input.tagadd',ajaxtag).click(function(){t.flushTags($(this).closest('.tagsdiv'));});$('div.taghint',ajaxtag).click(function(){$(this).css('visibility','hidden').parent().siblings('.newtag').focus();});pll_tagBox.suggest();$('#post').submit(function(){$('div.tagsdiv').each(function(){pll_tagBox.flushTags(this,false,1);});});$('a.tagcloud-link').click(function(){pll_tagBox.get($(this).attr('id'),1);$(this).unbind().click(function(){$(this).siblings('.the-tagcloud').toggle();return false;});return false;});}};})(jQuery);jQuery(document).ready(function($){var taxonomies=new Array();$('.categorydiv').each(function(){var this_id=$(this).attr('id'),taxonomyParts,taxonomy;taxonomyParts=this_id.split('-');taxonomyParts.shift();taxonomy=taxonomyParts.join('-');taxonomies.push(taxonomy);$('#'+taxonomy+'-add-submit').before($('<input />').attr('type','hidden').attr('id',taxonomy+'-lang').attr('name','term_lang_choice').attr('value',$('#post_lang_choice').attr('value')));});$('#post_lang_choice').change(function(){var data={action:'post_lang_choice',lang:$(this).attr('value'),taxonomies:taxonomies,post_id:$('#post_ID').attr('value')}
11
+ $.post(ajaxurl,data,function(response){var res=wpAjax.parseAjaxResponse(response,'ajax-response');$.each(res.responses,function(){switch(this.what){case'translations':$('#post-translations').html(this.data);break;case'taxonomy':var tax=this.data;$('#'+tax+'checklist').html(this.supplemental.all);$('#'+tax+'checklist-pop').html(this.supplemental.populars);$('#new'+tax+'_parent').replaceWith(this.supplemental.dropdown);$('#'+tax+'-lang').val($('#post_lang_choice').attr('value'));break;case'pages':$('#parent_id').replaceWith(this.data);break;default:break;}});$('.tagcloud-link').each(function(){var id=$(this).attr('id');pll_tagBox.get(id,0);});pll_tagBox.suggest();});});$('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){if(this.id.indexOf('tagsdiv-')===0){$(this).attr('id','pll-'+this.id);}});if($('#pll-tagsdiv-post_tag').length){pll_tagBox.init();}else{$('#side-sortables, #normal-sortables, #advanced-sortables').children('div.postbox').each(function(){if(this.id.indexOf('pll-tagsdiv-')===0){pll_tagBox.init();return false;}});}
12
+ $('#term_lang_choice').change(function(){var data={action:'term_lang_choice',lang:$(this).attr('value'),term_id:$("input[name='tag_ID']").attr('value'),taxonomy:$("input[name='taxonomy']").attr('value')}
13
+ $.post(ajaxurl,data,function(response){var res=wpAjax.parseAjaxResponse(response,'ajax-response');$.each(res.responses,function(){switch(this.what){case'translations':$("#term-translations").html(this.data);break;case'parent':$('#parent').replaceWith(this.data);break;default:break;}});});});$('#lang_list').change(function(){value=$(this).attr('value').split('-');selected=$("select option:selected").text().split(' - ');$('input[name="slug"]').val(value[0]);$('input[name="description"]').val(value[1]);$('input[name="rtl"]').val([value[2]]);$('input[name="name"]').val(selected[0]);});});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/polylang-de_DE.mo CHANGED
Binary file
languages/polylang-de_DE.po CHANGED
@@ -10,455 +10,458 @@ msgstr ""
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:185
 
21
  msgid "Error: Restore of local flags failed!"
22
  msgstr "Fehler: Wiederherstellung der lokalen Fahnen fehlgeschlagen!"
23
 
24
- #@ polylang
25
  #: include/admin-filters.php:512
26
  #: include/admin-filters.php:529
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/admin-filters.php:514
35
  #: include/admin-filters.php:532
 
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:71
 
51
  msgid "Title:"
52
  msgstr "Titel :"
53
 
54
- #@ polylang
55
  #: include/admin.php:482
 
56
  msgid "Displays language names"
57
  msgstr "Darstellung der Namen der Sprachen"
58
 
59
- #@ polylang
60
  #: include/admin.php:483
 
61
  msgid "Displays flags"
62
  msgstr "Darstellung der Fahnen"
63
 
64
- #@ polylang
65
  #: include/admin.php:488
 
66
  msgid "Displays as dropdown"
67
  msgstr "Als Auswahlbox darstellen"
68
 
69
- #@ polylang
70
  #: include/admin.php:484
 
71
  msgid "Forces link to front page"
72
  msgstr "Erzwingt einen Link zur Startseite"
73
 
74
- #@ default
75
- #@ polylang
76
  #: include/admin.php:25
77
  #: include/admin.php:298
 
 
78
  msgid "Settings"
79
  msgstr "Einstellungen"
80
 
81
- #@ polylang
82
  #: include/admin-filters.php:185
83
  #: include/admin.php:32
84
  #: include/admin.php:291
85
  #: include/list-table.php:13
 
86
  msgid "Languages"
87
  msgstr "Sprachen"
88
 
89
- #@ polylang
90
  #: include/admin.php:296
 
91
  msgid "Menus"
92
  msgstr "Menüs"
93
 
94
- #@ polylang
95
  #: include/admin.php:316
 
96
  msgid "Enter a valid WorPress locale"
97
  msgstr "Bitte geben Sie eine gültige Sprachdatei an"
98
 
99
- #@ polylang
100
  #: include/admin.php:317
 
101
  msgid "The language code must be 2 characters long"
102
  msgstr "Der Sprachcode muss 2 Buchstaben betragen"
103
 
104
- #@ polylang
105
  #: include/admin.php:318
 
106
  msgid "The language code must be unique"
107
  msgstr "Der Sprachcode muss eindeutig sein"
108
 
109
- #@ polylang
110
  #: include/admin.php:319
 
111
  msgid "The language must have a name"
112
  msgstr "Die Sprache muss einen Namen haben"
113
 
114
- #@ polylang
115
  #: include/admin.php:487
 
116
  msgid "Displays a language switcher at the end of the menu"
117
  msgstr "Zeigt einen Sprachenumschalter am Ende des Menüs"
118
 
119
- #@ polylang
120
  #: include/admin-filters.php:202
 
121
  msgid "Page's language:"
122
  msgstr "Sprache der Seite :"
123
 
124
- #@ polylang
125
  #: include/admin-filters.php:202
 
126
  msgid "Post's language:"
127
  msgstr "Sprache des Artikels :"
128
 
129
- #@ polylang
130
  #: include/list-table.php:127
131
  #: include/term-translations.php:6
132
  #: include/term-translations.php:11
 
133
  msgid "Translations"
134
  msgstr "Übersetzungen"
135
 
136
- #@ polylang
137
  #: include/term-translations.php:16
 
138
  msgid "Translation"
139
  msgstr "Übersetzung"
140
 
141
- #@ polylang
142
  #: include/list-table.php:26
143
  #: include/post-translations.php:6
144
  #: include/post-translations.php:29
145
  #: include/term-translations.php:18
146
  #: include/term-translations.php:65
 
147
  msgid "Edit"
148
  msgstr "Bearbeiten"
149
 
150
- #@ polylang
151
  #: include/post-translations.php:34
152
  #: include/term-translations.php:54
 
153
  msgid "Add new"
154
  msgstr "Hinzufügen"
155
 
156
- #@ polylang
157
  #: include/admin-filters.php:172
 
158
  msgid "Show all languages"
159
  msgstr "Alle Sprachen anzeigen"
160
 
161
- #@ polylang
162
  #: include/admin-filters.php:714
 
163
  msgid "Theme locations and languages"
164
  msgstr "Verortung der Vorlage und Sprachen"
165
 
166
- #@ polylang
167
  #: include/admin-filters.php:719
168
  #, php-format
 
169
  msgid "Please go to the %slanguages page%s to set theme locations and languages"
170
  msgstr "Du solltest zur %sSprachenseite%s gehen, um die Verortung der Vorlage und die Sprachen einzustellen."
171
 
172
- #@ polylang
173
  #: include/admin-filters.php:730
 
174
  msgid "The widget is displayed for:"
175
  msgstr "Zeigt das Widget für :"
176
 
177
- #@ polylang
178
  #: include/base.php:33
 
179
  msgid "All languages"
180
  msgstr "Alle Sprachen"
181
 
182
- #@ polylang
183
  #: include/list-table.php:27
 
184
  msgid "Delete"
185
  msgstr "Löschen"
186
 
187
- #@ polylang
188
  #: include/languages-form.php:67
189
  #: include/list-table.php:45
 
190
  msgid "Full name"
191
  msgstr "Name"
192
 
193
- #@ polylang
194
  #: include/languages-form.php:73
195
  #: include/list-table.php:46
 
196
  msgid "Locale"
197
  msgstr "Sprachdatei"
198
 
199
- #@ polylang
200
  #: include/list-table.php:47
 
201
  msgid "Code"
202
  msgstr "Code"
203
 
204
- #@ polylang
205
  #: include/list-table.php:49
 
206
  msgid "Flag"
207
  msgstr "Fahne"
208
 
209
- #@ polylang
210
  #: include/list-table.php:50
 
211
  msgid "Posts"
212
  msgstr "Artikel"
213
 
214
- #@ default
215
  #. translators: Calendar caption: 1: month name, 2: 4-digit year
216
  #: include/calendar.php:106
217
  #, php-format
 
218
  msgctxt "calendar caption"
219
  msgid "%1$s %2$s"
220
  msgstr "%1$s %2$s"
221
 
222
- #@ default
223
  #: include/calendar.php:132
224
  #: include/calendar.php:140
225
  #, php-format
 
226
  msgid "View posts for %1$s %2$s"
227
  msgstr "Siehe Artikel für %1$s %2$s"
228
 
229
- #@ polylang
230
  #: include/languages-form.php:33
 
231
  msgid "Edit language"
232
  msgstr "Sprache bearbeiten"
233
 
234
- #@ polylang
235
  #: include/languages-form.php:33
236
  #: include/languages-form.php:98
 
237
  msgid "Add new language"
238
  msgstr "Neue Sprache hinzufügen"
239
 
240
- #@ polylang
241
  #: include/languages-form.php:55
 
242
  msgid "Choose a language"
243
  msgstr "Sprache auswählen"
244
 
245
- #@ polylang
246
  #: include/languages-form.php:63
 
247
  msgid "You can choose a language in the list or directly edit it below."
248
  msgstr "Du kannst eine Sprache in der Liste auswählen oder sie unten direkt bearbeiten."
249
 
250
- #@ polylang
251
  #: include/languages-form.php:69
 
252
  msgid "The name is how it is displayed on your site (for example: English)."
253
  msgstr "Dieser Name wird dann auf der Website angezeigt (beispielsweise : Deutsch)"
254
 
255
- #@ polylang
256
  #: include/languages-form.php:76
 
257
  msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
258
  msgstr "Wordpress Sprachdatei für die Sprache (beispielweise : de_DE). Du musst die .mo-Datei für diese Sprache installieren."
259
 
260
- #@ polylang
261
  #: include/languages-form.php:80
 
262
  msgid "Language code"
263
  msgstr "Sprachcode"
264
 
265
- #@ polylang
266
  #: include/languages-form.php:82
 
267
  msgid "2-letters ISO 639-1 language code (for example: en)"
268
  msgstr "2 Buchstaben ISO 639-1 Sprachcode (beispielsweise : de)"
269
 
270
- #@ default
271
  #: include/languages-form.php:98
 
272
  msgid "Update"
273
  msgstr "Aktualisieren"
274
 
275
- #@ polylang
276
  #: include/languages-form.php:134
 
277
  msgid "Language switcher"
278
  msgstr "Sprachenumschalter"
279
 
280
- #@ polylang
281
  #: include/languages-form.php:173
 
282
  msgid "Default language"
283
  msgstr "Standardsprache"
284
 
285
- #@ polylang
286
  #: include/languages-form.php:191
 
287
  msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
288
  msgstr "Es gibt Artikel, Seite, Kategorien oder Schlagwörter ohne Spracheinstellung. Willst du alle auf die Standardsprache einstellen ?"
289
 
290
- #@ polylang
291
  #: include/languages-form.php:199
 
292
  msgid "Detect browser language"
293
  msgstr "Browsersprache erkennen"
294
 
295
- #@ polylang
296
  #: include/languages-form.php:205
 
297
  msgid "When the front page is visited, set the language according to the browser preference"
298
  msgstr "Beim Besuch der Startseite erscheint sie in der Standardsprache des Browsers"
299
 
300
- #@ polylang
301
  #: include/languages-form.php:212
 
302
  msgid "URL modifications"
303
  msgstr "URL-Veränderungen"
304
 
305
- #@ polylang
306
  #: include/languages-form.php:218
 
307
  msgid "Keep /language/ in pretty permalinks. Example:"
308
  msgstr "/language/ in schönen Permalinks behalten. Zum Beispiel :"
309
 
310
- #@ polylang
311
  #: include/languages-form.php:226
 
312
  msgid "Remove /language/ in pretty permalinks. Example:"
313
  msgstr "/language/ in Permalinks entfernen. Zum Beispiel :"
314
 
315
- #@ polylang
316
  #: include/languages-form.php:234
 
317
  msgid "Hide URL language information for default language"
318
  msgstr "URL Informationen für die Standardsprache verstecken"
319
 
320
- #@ polylang
321
  #: include/post-translations.php:1
 
322
  msgid "ID of pages in other languages:"
323
  msgstr "ID der Seiten in anderen Sprachen :"
324
 
325
- #@ polylang
326
  #: include/post-translations.php:1
 
327
  msgid "ID of posts in other languages:"
328
  msgstr "ID der Artikel in anderen Sprachen :"
329
 
330
- #@ polylang
331
  #: include/post-translations.php:5
 
332
  msgid "Page ID"
333
  msgstr "ID der Seite"
334
 
335
- #@ polylang
336
  #: include/post-translations.php:5
 
337
  msgid "Post ID"
338
  msgstr "Artikel-ID"
339
 
340
- #@ polylang
341
  #: include/admin-filters.php:761
 
342
  msgid "Admin language"
343
  msgstr "Adminsprache"
344
 
345
- #@ polylang
346
  #: include/admin-filters.php:148
347
  #: include/admin-filters.php:575
 
348
  msgid "Add new translation"
349
  msgstr "Neue Übersetzung hinzufügen"
350
 
351
- #@ default
352
  #: include/admin-filters.php:262
 
353
  msgid "(no parent)"
354
  msgstr "(kein Elternteil)"
355
 
356
- #@ polylang
357
  #: include/admin.php:298
358
  #: include/list-table.php:104
 
359
  msgid "Strings translation"
360
- msgstr "Übersetung von Sätzen"
361
 
362
- #@ polylang
363
  #: include/admin.php:320
 
364
  msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
365
  msgstr "Die Sprache wurde erstellt, aber die WordPress Sprachdatei wurde nicht heruntergeladen. Bitte händisch installieren."
366
 
367
- #@ default
368
  #: include/admin.php:497
 
369
  msgid "Site Title"
370
  msgstr "Titel der Website"
371
 
372
- #@ default
373
  #: include/admin.php:498
 
374
  msgid "Tagline"
375
  msgstr "Tagline"
376
 
377
- #@ polylang
378
  #: include/admin.php:517
 
379
  msgid "Widget title"
380
  msgstr "Titel des Widgets"
381
 
382
- #@ polylang
383
  #: include/languages-form.php:93
384
  #: include/list-table.php:48
 
385
  msgid "Order"
386
  msgstr "Reihenfolge"
387
 
388
- #@ polylang
389
  #: include/languages-form.php:95
 
390
  msgid "Position of the language in the language switcher"
391
  msgstr "Position der Sprache im Sprachenumschalter"
392
 
393
- #@ polylang
394
  #: include/list-table.php:105
 
395
  msgid "Strings translations"
396
  msgstr "Übersetungen von Sätzen"
397
 
398
- #@ polylang
399
  #: include/list-table.php:125
 
400
  msgid "Name"
401
  msgstr "Name"
402
 
403
- #@ polylang
404
  #: include/list-table.php:126
 
405
  msgid "String"
406
  msgstr "Zeichenfolge"
407
 
408
- #@ polylang
409
  #: include/term-translations.php:48
 
410
  msgid "No untranslated term"
411
  msgstr "Kein unübersetzter Ausdruck"
412
 
413
- #@ polylang
414
  #: polylang.php:186
415
  #, php-format
 
416
  msgid "Please move your local flags from %s to %s"
417
  msgstr "Bitte entfernen Sie Ihre lokalen Flaggen von %s bis %s"
418
 
419
- #@ default
420
  #: include/admin-filters.php:697
 
421
  msgid "None"
422
  msgstr "Keine"
423
 
424
- #@ polylang
425
  #: include/admin.php:473
 
426
  msgid "Upgrading language files&#8230;"
427
- msgstr "Sprachdateien&#8230; werden aktualisiert"
428
 
429
- #@ polylang
430
  #: include/admin.php:485
 
431
  msgid "Hides the current language"
432
  msgstr "Versteckt die aktuelle Sprache"
433
 
434
- #@ polylang
435
  #: include/languages-form.php:86
 
436
  msgid "Text direction"
437
  msgstr "Textrichtung"
438
 
439
- #@ polylang
440
  #: include/languages-form.php:87
 
441
  msgid "left to right"
442
  msgstr "von links nach rechts"
443
 
444
- #@ polylang
445
  #: include/languages-form.php:88
 
446
  msgid "right to left"
447
  msgstr "von rechts nach links"
448
 
449
- #@ polylang
450
  #: include/languages-form.php:89
 
451
  msgid "Choose the text direction for the language"
452
  msgstr "Wählen Sie die Textrichtung für die Sprache aus"
453
 
454
- #@ polylang
455
  #: include/languages-form.php:241
 
456
  msgid "Add language information to all URL including posts, pages, categories and post tags (not recommended)"
457
  msgstr "Sprachinformationen allen URLs beifügen inkl. Artikel, Seiten, Kategorien und Artikelschlagwörter (nicht empfohlen)"
458
 
459
- #@ default
460
  #: polylang.php:88
461
  #, php-format
 
462
  msgid "You are using WordPress %s. Polylang requires at least WordPress %s."
463
  msgstr "Sie benutzen WordPress %s. Polylang benötigt mindestens WordPress %s."
464
 
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
  #: polylang.php:185
23
+ #@ polylang
24
  msgid "Error: Restore of local flags failed!"
25
  msgstr "Fehler: Wiederherstellung der lokalen Fahnen fehlgeschlagen!"
26
 
 
27
  #: include/admin-filters.php:512
28
  #: include/admin-filters.php:529
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 "Sprache"
35
 
 
36
  #: include/admin-filters.php:514
37
  #: include/admin-filters.php:532
38
+ #@ polylang
39
  msgid "Sets the language"
40
  msgstr "definiert die Sprache"
41
 
 
42
  #: include/widget.php:6
43
+ #@ polylang
44
  msgid "Language Switcher"
45
  msgstr "Sprachenumschalter"
46
 
 
47
  #: include/widget.php:6
48
+ #@ polylang
49
  msgid "Displays a language switcher"
50
  msgstr "Zeigt einen Sprachenumschalter"
51
 
 
52
  #: include/widget.php:71
53
+ #@ polylang
54
  msgid "Title:"
55
  msgstr "Titel :"
56
 
 
57
  #: include/admin.php:482
58
+ #@ polylang
59
  msgid "Displays language names"
60
  msgstr "Darstellung der Namen der Sprachen"
61
 
 
62
  #: include/admin.php:483
63
+ #@ polylang
64
  msgid "Displays flags"
65
  msgstr "Darstellung der Fahnen"
66
 
 
67
  #: include/admin.php:488
68
+ #@ polylang
69
  msgid "Displays as dropdown"
70
  msgstr "Als Auswahlbox darstellen"
71
 
 
72
  #: include/admin.php:484
73
+ #@ polylang
74
  msgid "Forces link to front page"
75
  msgstr "Erzwingt einen Link zur Startseite"
76
 
 
 
77
  #: include/admin.php:25
78
  #: include/admin.php:298
79
+ #@ default
80
+ #@ polylang
81
  msgid "Settings"
82
  msgstr "Einstellungen"
83
 
 
84
  #: include/admin-filters.php:185
85
  #: include/admin.php:32
86
  #: include/admin.php:291
87
  #: include/list-table.php:13
88
+ #@ polylang
89
  msgid "Languages"
90
  msgstr "Sprachen"
91
 
 
92
  #: include/admin.php:296
93
+ #@ polylang
94
  msgid "Menus"
95
  msgstr "Menüs"
96
 
 
97
  #: include/admin.php:316
98
+ #@ polylang
99
  msgid "Enter a valid WorPress locale"
100
  msgstr "Bitte geben Sie eine gültige Sprachdatei an"
101
 
 
102
  #: include/admin.php:317
103
+ #@ polylang
104
  msgid "The language code must be 2 characters long"
105
  msgstr "Der Sprachcode muss 2 Buchstaben betragen"
106
 
 
107
  #: include/admin.php:318
108
+ #@ polylang
109
  msgid "The language code must be unique"
110
  msgstr "Der Sprachcode muss eindeutig sein"
111
 
 
112
  #: include/admin.php:319
113
+ #@ polylang
114
  msgid "The language must have a name"
115
  msgstr "Die Sprache muss einen Namen haben"
116
 
 
117
  #: include/admin.php:487
118
+ #@ polylang
119
  msgid "Displays a language switcher at the end of the menu"
120
  msgstr "Zeigt einen Sprachenumschalter am Ende des Menüs"
121
 
 
122
  #: include/admin-filters.php:202
123
+ #@ polylang
124
  msgid "Page's language:"
125
  msgstr "Sprache der Seite :"
126
 
 
127
  #: include/admin-filters.php:202
128
+ #@ polylang
129
  msgid "Post's language:"
130
  msgstr "Sprache des Artikels :"
131
 
 
132
  #: include/list-table.php:127
133
  #: include/term-translations.php:6
134
  #: include/term-translations.php:11
135
+ #@ polylang
136
  msgid "Translations"
137
  msgstr "Übersetzungen"
138
 
 
139
  #: include/term-translations.php:16
140
+ #@ polylang
141
  msgid "Translation"
142
  msgstr "Übersetzung"
143
 
 
144
  #: include/list-table.php:26
145
  #: include/post-translations.php:6
146
  #: include/post-translations.php:29
147
  #: include/term-translations.php:18
148
  #: include/term-translations.php:65
149
+ #@ polylang
150
  msgid "Edit"
151
  msgstr "Bearbeiten"
152
 
 
153
  #: include/post-translations.php:34
154
  #: include/term-translations.php:54
155
+ #@ polylang
156
  msgid "Add new"
157
  msgstr "Hinzufügen"
158
 
 
159
  #: include/admin-filters.php:172
160
+ #@ polylang
161
  msgid "Show all languages"
162
  msgstr "Alle Sprachen anzeigen"
163
 
 
164
  #: include/admin-filters.php:714
165
+ #@ polylang
166
  msgid "Theme locations and languages"
167
  msgstr "Verortung der Vorlage und Sprachen"
168
 
 
169
  #: include/admin-filters.php:719
170
  #, php-format
171
+ #@ polylang
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
  #: include/admin-filters.php:730
176
+ #@ polylang
177
  msgid "The widget is displayed for:"
178
  msgstr "Zeigt das Widget für :"
179
 
 
180
  #: include/base.php:33
181
+ #@ polylang
182
  msgid "All languages"
183
  msgstr "Alle Sprachen"
184
 
 
185
  #: include/list-table.php:27
186
+ #@ polylang
187
  msgid "Delete"
188
  msgstr "Löschen"
189
 
 
190
  #: include/languages-form.php:67
191
  #: include/list-table.php:45
192
+ #@ polylang
193
  msgid "Full name"
194
  msgstr "Name"
195
 
 
196
  #: include/languages-form.php:73
197
  #: include/list-table.php:46
198
+ #@ polylang
199
  msgid "Locale"
200
  msgstr "Sprachdatei"
201
 
 
202
  #: include/list-table.php:47
203
+ #@ polylang
204
  msgid "Code"
205
  msgstr "Code"
206
 
 
207
  #: include/list-table.php:49
208
+ #@ polylang
209
  msgid "Flag"
210
  msgstr "Fahne"
211
 
 
212
  #: include/list-table.php:50
213
+ #@ polylang
214
  msgid "Posts"
215
  msgstr "Artikel"
216
 
 
217
  #. translators: Calendar caption: 1: month name, 2: 4-digit year
218
  #: include/calendar.php:106
219
  #, php-format
220
+ #@ default
221
  msgctxt "calendar caption"
222
  msgid "%1$s %2$s"
223
  msgstr "%1$s %2$s"
224
 
 
225
  #: include/calendar.php:132
226
  #: include/calendar.php:140
227
  #, php-format
228
+ #@ default
229
  msgid "View posts for %1$s %2$s"
230
  msgstr "Siehe Artikel für %1$s %2$s"
231
 
 
232
  #: include/languages-form.php:33
233
+ #@ polylang
234
  msgid "Edit language"
235
  msgstr "Sprache bearbeiten"
236
 
 
237
  #: include/languages-form.php:33
238
  #: include/languages-form.php:98
239
+ #@ polylang
240
  msgid "Add new language"
241
  msgstr "Neue Sprache hinzufügen"
242
 
 
243
  #: include/languages-form.php:55
244
+ #@ polylang
245
  msgid "Choose a language"
246
  msgstr "Sprache auswählen"
247
 
 
248
  #: include/languages-form.php:63
249
+ #@ polylang
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
  #: include/languages-form.php:69
254
+ #@ polylang
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
  #: include/languages-form.php:76
259
+ #@ polylang
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
  #: include/languages-form.php:80
264
+ #@ polylang
265
  msgid "Language code"
266
  msgstr "Sprachcode"
267
 
 
268
  #: include/languages-form.php:82
269
+ #@ polylang
270
  msgid "2-letters ISO 639-1 language code (for example: en)"
271
  msgstr "2 Buchstaben ISO 639-1 Sprachcode (beispielsweise : de)"
272
 
 
273
  #: include/languages-form.php:98
274
+ #@ default
275
  msgid "Update"
276
  msgstr "Aktualisieren"
277
 
 
278
  #: include/languages-form.php:134
279
+ #@ polylang
280
  msgid "Language switcher"
281
  msgstr "Sprachenumschalter"
282
 
 
283
  #: include/languages-form.php:173
284
+ #@ polylang
285
  msgid "Default language"
286
  msgstr "Standardsprache"
287
 
 
288
  #: include/languages-form.php:191
289
+ #@ polylang
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
  #: include/languages-form.php:199
294
+ #@ polylang
295
  msgid "Detect browser language"
296
  msgstr "Browsersprache erkennen"
297
 
 
298
  #: include/languages-form.php:205
299
+ #@ polylang
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
  #: include/languages-form.php:212
304
+ #@ polylang
305
  msgid "URL modifications"
306
  msgstr "URL-Veränderungen"
307
 
 
308
  #: include/languages-form.php:218
309
+ #@ polylang
310
  msgid "Keep /language/ in pretty permalinks. Example:"
311
  msgstr "/language/ in schönen Permalinks behalten. Zum Beispiel :"
312
 
 
313
  #: include/languages-form.php:226
314
+ #@ polylang
315
  msgid "Remove /language/ in pretty permalinks. Example:"
316
  msgstr "/language/ in Permalinks entfernen. Zum Beispiel :"
317
 
 
318
  #: include/languages-form.php:234
319
+ #@ polylang
320
  msgid "Hide URL language information for default language"
321
  msgstr "URL Informationen für die Standardsprache verstecken"
322
 
 
323
  #: include/post-translations.php:1
324
+ #@ polylang
325
  msgid "ID of pages in other languages:"
326
  msgstr "ID der Seiten in anderen Sprachen :"
327
 
 
328
  #: include/post-translations.php:1
329
+ #@ polylang
330
  msgid "ID of posts in other languages:"
331
  msgstr "ID der Artikel in anderen Sprachen :"
332
 
 
333
  #: include/post-translations.php:5
334
+ #@ polylang
335
  msgid "Page ID"
336
  msgstr "ID der Seite"
337
 
 
338
  #: include/post-translations.php:5
339
+ #@ polylang
340
  msgid "Post ID"
341
  msgstr "Artikel-ID"
342
 
 
343
  #: include/admin-filters.php:761
344
+ #@ polylang
345
  msgid "Admin language"
346
  msgstr "Adminsprache"
347
 
 
348
  #: include/admin-filters.php:148
349
  #: include/admin-filters.php:575
350
+ #@ polylang
351
  msgid "Add new translation"
352
  msgstr "Neue Übersetzung hinzufügen"
353
 
 
354
  #: include/admin-filters.php:262
355
+ #@ default
356
  msgid "(no parent)"
357
  msgstr "(kein Elternteil)"
358
 
 
359
  #: include/admin.php:298
360
  #: include/list-table.php:104
361
+ #@ polylang
362
  msgid "Strings translation"
363
+ msgstr "Übersetzung von Sätzen"
364
 
 
365
  #: include/admin.php:320
366
+ #@ polylang
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
  #: include/admin.php:497
371
+ #@ default
372
  msgid "Site Title"
373
  msgstr "Titel der Website"
374
 
 
375
  #: include/admin.php:498
376
+ #@ default
377
  msgid "Tagline"
378
  msgstr "Tagline"
379
 
 
380
  #: include/admin.php:517
381
+ #@ polylang
382
  msgid "Widget title"
383
  msgstr "Titel des Widgets"
384
 
 
385
  #: include/languages-form.php:93
386
  #: include/list-table.php:48
387
+ #@ polylang
388
  msgid "Order"
389
  msgstr "Reihenfolge"
390
 
 
391
  #: include/languages-form.php:95
392
+ #@ polylang
393
  msgid "Position of the language in the language switcher"
394
  msgstr "Position der Sprache im Sprachenumschalter"
395
 
 
396
  #: include/list-table.php:105
397
+ #@ polylang
398
  msgid "Strings translations"
399
  msgstr "Übersetungen von Sätzen"
400
 
 
401
  #: include/list-table.php:125
402
+ #@ polylang
403
  msgid "Name"
404
  msgstr "Name"
405
 
 
406
  #: include/list-table.php:126
407
+ #@ polylang
408
  msgid "String"
409
  msgstr "Zeichenfolge"
410
 
 
411
  #: include/term-translations.php:48
412
+ #@ polylang
413
  msgid "No untranslated term"
414
  msgstr "Kein unübersetzter Ausdruck"
415
 
 
416
  #: polylang.php:186
417
  #, php-format
418
+ #@ polylang
419
  msgid "Please move your local flags from %s to %s"
420
  msgstr "Bitte entfernen Sie Ihre lokalen Flaggen von %s bis %s"
421
 
 
422
  #: include/admin-filters.php:697
423
+ #@ default
424
  msgid "None"
425
  msgstr "Keine"
426
 
 
427
  #: include/admin.php:473
428
+ #@ polylang
429
  msgid "Upgrading language files&#8230;"
430
+ msgstr "Sprachdateien werden aktualisiert&#8230;"
431
 
 
432
  #: include/admin.php:485
433
+ #@ polylang
434
  msgid "Hides the current language"
435
  msgstr "Versteckt die aktuelle Sprache"
436
 
 
437
  #: include/languages-form.php:86
438
+ #@ polylang
439
  msgid "Text direction"
440
  msgstr "Textrichtung"
441
 
 
442
  #: include/languages-form.php:87
443
+ #@ polylang
444
  msgid "left to right"
445
  msgstr "von links nach rechts"
446
 
 
447
  #: include/languages-form.php:88
448
+ #@ polylang
449
  msgid "right to left"
450
  msgstr "von rechts nach links"
451
 
 
452
  #: include/languages-form.php:89
453
+ #@ polylang
454
  msgid "Choose the text direction for the language"
455
  msgstr "Wählen Sie die Textrichtung für die Sprache aus"
456
 
 
457
  #: include/languages-form.php:241
458
+ #@ polylang
459
  msgid "Add language information to all URL including posts, pages, categories and post tags (not recommended)"
460
  msgstr "Sprachinformationen allen URLs beifügen inkl. Artikel, Seiten, Kategorien und Artikelschlagwörter (nicht empfohlen)"
461
 
 
462
  #: polylang.php:88
463
  #, php-format
464
+ #@ default
465
  msgid "You are using WordPress %s. Polylang requires at least WordPress %s."
466
  msgstr "Sie benutzen WordPress %s. Polylang benötigt mindestens WordPress %s."
467
 
languages/polylang-nl_NL.mo CHANGED
Binary file
languages/polylang-nl_NL.po CHANGED
@@ -4,7 +4,7 @@ msgstr ""
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"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -377,12 +377,12 @@ msgstr "URL aanpassingen"
377
  #@ polylang
378
  #: include/languages-form.php:218
379
  msgid "Keep /language/ in pretty permalinks. Example:"
380
- msgstr "Behoud /taal/ in pretty permalinks. Voorbeeld:"
381
 
382
  #@ polylang
383
  #: include/languages-form.php:226
384
  msgid "Remove /language/ in pretty permalinks. Example:"
385
- msgstr "Verwijder /taal/ in pretty permalinks. Voorbeeld:"
386
 
387
  #@ polylang
388
  #: include/languages-form.php:234
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: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
377
  #@ polylang
378
  #: include/languages-form.php:218
379
  msgid "Keep /language/ in pretty permalinks. Example:"
380
+ msgstr "Behoud /language/ in pretty permalinks. Voorbeeld:"
381
 
382
  #@ polylang
383
  #: include/languages-form.php:226
384
  msgid "Remove /language/ in pretty permalinks. Example:"
385
+ msgstr "Verwijder /language/ in pretty permalinks. Voorbeeld:"
386
 
387
  #@ polylang
388
  #: include/languages-form.php:234
languages/polylang-pl_PL.mo ADDED
Binary file
languages/polylang-pl_PL.po ADDED
@@ -0,0 +1,379 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: polylang\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-01-23 15:00+0100\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: \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==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: _e;__;_x\n"
16
+ "X-Poedit-Basepath: .\n"
17
+ "X-Poedit-SearchPath-0: ..\n"
18
+ "X-Poedit-SearchPath-1: ../include\n"
19
+
20
+ #: ../polylang.php:88
21
+ #, php-format
22
+ msgid "You are using WordPress %s. Polylang requires at least WordPress %s."
23
+ msgstr "Używasz WordPress %s. Polylang wymaga przynajmniej WordPress %s."
24
+
25
+ #: ../polylang.php:185
26
+ msgid "Error: Restore of local flags failed!"
27
+ msgstr "Błąd: Odtworzenie lokalnych flag nie powiodło się!"
28
+
29
+ #: ../polylang.php:186
30
+ #, php-format
31
+ msgid "Please move your local flags from %s to %s"
32
+ msgstr "Proszę przenieś twoje lokalne flagi z %s do %s"
33
+
34
+ #: ../include/widget.php:6
35
+ msgid "Language Switcher"
36
+ msgstr "Przełącznik języka"
37
+
38
+ #: ../include/widget.php:6
39
+ msgid "Displays a language switcher"
40
+ msgstr "Wyświetla przełącznik języka"
41
+
42
+ #: ../include/widget.php:71
43
+ msgid "Title:"
44
+ msgstr "Tytuł:"
45
+
46
+ #: ../include/admin.php:25
47
+ #: ../include/admin.php:298
48
+ msgid "Settings"
49
+ msgstr "Ustawienia"
50
+
51
+ #: ../include/admin.php:32
52
+ #: ../include/admin.php:291
53
+ #: ../include/admin-filters.php:185
54
+ #: ../include/list-table.php:13
55
+ msgid "Languages"
56
+ msgstr "Języki"
57
+
58
+ #: ../include/admin.php:296
59
+ msgid "Menus"
60
+ msgstr "Menu"
61
+
62
+ #: ../include/admin.php:298
63
+ #: ../include/list-table.php:104
64
+ msgid "Strings translation"
65
+ msgstr "Tłumaczenie ciągów tekstowych"
66
+
67
+ #: ../include/admin.php:316
68
+ msgid "Enter a valid WorPress locale"
69
+ msgstr "Wpisz prawidłową lokalizację WordPress"
70
+
71
+ #: ../include/admin.php:317
72
+ msgid "The language code must be 2 characters long"
73
+ msgstr "Kod języka musi się składać z 2 znaków"
74
+
75
+ #: ../include/admin.php:318
76
+ msgid "The language code must be unique"
77
+ msgstr "Kod języka musi być unikalny"
78
+
79
+ #: ../include/admin.php:319
80
+ msgid "The language must have a name"
81
+ msgstr "Język musi mieć nazwę"
82
+
83
+ #: ../include/admin.php:320
84
+ msgid "The language was created, but the WordPress language file was not downloaded. Please install it manually."
85
+ msgstr "Język został dodany, ale plik językowy WordPress nie został załadowany. Proszę zainstalować go manualnie."
86
+
87
+ #: ../include/admin.php:473
88
+ msgid "Upgrading language files&#8230;"
89
+ msgstr "Uaktualnianie pliku językowego&#8230;"
90
+
91
+ #: ../include/admin.php:482
92
+ msgid "Displays language names"
93
+ msgstr "Wyświetla nazwy języków"
94
+
95
+ #: ../include/admin.php:483
96
+ msgid "Displays flags"
97
+ msgstr "Wyświetla flagi"
98
+
99
+ #: ../include/admin.php:484
100
+ msgid "Forces link to front page"
101
+ msgstr "Wymusza link do strony głównej"
102
+
103
+ #: ../include/admin.php:485
104
+ msgid "Hides the current language"
105
+ msgstr "Ukrywa aktualny język"
106
+
107
+ #: ../include/admin.php:487
108
+ msgid "Displays a language switcher at the end of the menu"
109
+ msgstr "Wyświetla przełącznik języków na końcu menu"
110
+
111
+ #: ../include/admin.php:488
112
+ msgid "Displays as dropdown"
113
+ msgstr "Wyświetla się jako menu rozwijane"
114
+
115
+ #: ../include/admin.php:497
116
+ msgid "Site Title"
117
+ msgstr "Tytuł witryny"
118
+
119
+ #: ../include/admin.php:498
120
+ msgid "Tagline"
121
+ msgstr "Tagline"
122
+
123
+ #: ../include/admin.php:517
124
+ msgid "Widget title"
125
+ msgstr "Nazwa widgeta"
126
+
127
+ #: ../include/term-translations.php:6
128
+ #: ../include/term-translations.php:11
129
+ #: ../include/list-table.php:127
130
+ msgid "Translations"
131
+ msgstr "Tłumaczenia"
132
+
133
+ #: ../include/term-translations.php:15
134
+ #: ../include/admin-filters.php:512
135
+ #: ../include/admin-filters.php:529
136
+ #: ../include/list-table.php:12
137
+ #: ../include/post-translations.php:4
138
+ msgid "Language"
139
+ msgstr "Język"
140
+
141
+ #: ../include/term-translations.php:16
142
+ msgid "Translation"
143
+ msgstr "Tłumaczenie"
144
+
145
+ #: ../include/term-translations.php:18
146
+ #: ../include/term-translations.php:65
147
+ #: ../include/list-table.php:26
148
+ #: ../include/post-translations.php:6
149
+ #: ../include/post-translations.php:29
150
+ msgid "Edit"
151
+ msgstr "Edytuj"
152
+
153
+ #: ../include/term-translations.php:48
154
+ msgid "No untranslated term"
155
+ msgstr "Brak nieprzetłumaczonego terminu"
156
+
157
+ #: ../include/term-translations.php:54
158
+ #: ../include/post-translations.php:34
159
+ msgid "Add new"
160
+ msgstr "Dodaj nowy"
161
+
162
+ #: ../include/admin-filters.php:148
163
+ #: ../include/admin-filters.php:575
164
+ msgid "Add new translation"
165
+ msgstr "Dodaj nowe tłumaczenie"
166
+
167
+ #: ../include/admin-filters.php:172
168
+ msgid "Show all languages"
169
+ msgstr "Pokaż wszystkie języki"
170
+
171
+ #: ../include/admin-filters.php:202
172
+ msgid "Page's language:"
173
+ msgstr "Język strony:"
174
+
175
+ #: ../include/admin-filters.php:202
176
+ msgid "Post's language:"
177
+ msgstr "Język wpisu:"
178
+
179
+ #: ../include/admin-filters.php:262
180
+ msgid "(no parent)"
181
+ msgstr "(brak strony nadrzędnej)"
182
+
183
+ #: ../include/admin-filters.php:514
184
+ #: ../include/admin-filters.php:532
185
+ msgid "Sets the language"
186
+ msgstr "Ustawia język"
187
+
188
+ #: ../include/admin-filters.php:697
189
+ msgid "None"
190
+ msgstr "Żaden"
191
+
192
+ #: ../include/admin-filters.php:714
193
+ msgid "Theme locations and languages"
194
+ msgstr "Lokalizacje motywów i języki"
195
+
196
+ #: ../include/admin-filters.php:719
197
+ #, php-format
198
+ msgid "Please go to the %slanguages page%s to set theme locations and languages"
199
+ msgstr "Proszę idź do %sstrony języka%s aby ustawić lokalizacje motywu i języki"
200
+
201
+ #: ../include/admin-filters.php:730
202
+ msgid "The widget is displayed for:"
203
+ msgstr "Widget wyświetlany jest dla:"
204
+
205
+ #: ../include/admin-filters.php:761
206
+ msgid "Admin language"
207
+ msgstr "Język administratora"
208
+
209
+ #: ../include/list-table.php:27
210
+ msgid "Delete"
211
+ msgstr "Usuń"
212
+
213
+ #: ../include/list-table.php:45
214
+ #: ../include/languages-form.php:67
215
+ msgid "Full name"
216
+ msgstr "Pełna nazwa"
217
+
218
+ #: ../include/list-table.php:46
219
+ #: ../include/languages-form.php:73
220
+ msgid "Locale"
221
+ msgstr "Lokalizacja"
222
+
223
+ #: ../include/list-table.php:47
224
+ msgid "Code"
225
+ msgstr "Kod"
226
+
227
+ #: ../include/list-table.php:48
228
+ #: ../include/languages-form.php:93
229
+ msgid "Order"
230
+ msgstr "Kolejność"
231
+
232
+ #: ../include/list-table.php:49
233
+ msgid "Flag"
234
+ msgstr "Flaga"
235
+
236
+ #: ../include/list-table.php:50
237
+ msgid "Posts"
238
+ msgstr "Wpisy"
239
+
240
+ #: ../include/list-table.php:105
241
+ msgid "Strings translations"
242
+ msgstr "Tłumaczenia ciągów tekstowych"
243
+
244
+ #: ../include/list-table.php:125
245
+ msgid "Name"
246
+ msgstr "Nazwa"
247
+
248
+ #: ../include/list-table.php:126
249
+ msgid "String"
250
+ msgstr "Ciąg tekstowy"
251
+
252
+ #: ../include/calendar.php:106
253
+ #, php-format
254
+ msgid "%1$s %2$s"
255
+ msgstr "%1$s %2$s"
256
+
257
+ #: ../include/calendar.php:132
258
+ #: ../include/calendar.php:140
259
+ #, php-format
260
+ msgid "View posts for %1$s %2$s"
261
+ msgstr "Zobacz wpisy dla %1$s %2$s"
262
+
263
+ #: ../include/languages-form.php:33
264
+ msgid "Edit language"
265
+ msgstr "Edytuj język"
266
+
267
+ #: ../include/languages-form.php:33
268
+ #: ../include/languages-form.php:98
269
+ msgid "Add new language"
270
+ msgstr "Dodaj nowy język"
271
+
272
+ #: ../include/languages-form.php:55
273
+ msgid "Choose a language"
274
+ msgstr "Wybierz język"
275
+
276
+ #: ../include/languages-form.php:63
277
+ msgid "You can choose a language in the list or directly edit it below."
278
+ msgstr "Możesz wybrać język z listy lub edytować go bezpośrednio poniżej"
279
+
280
+ #: ../include/languages-form.php:69
281
+ msgid "The name is how it is displayed on your site (for example: English)."
282
+ msgstr "Nazwa, tak jak będzie wyświetlana na stronie (np. English)"
283
+
284
+ #: ../include/languages-form.php:76
285
+ msgid "Wordpress Locale for the language (for example: en_US). You will need to install the .mo file for this language."
286
+ msgstr "Lokalizacja WordPress dla języka (np. en_US). Dla tego języka będziesz musiał zainstalować plik .mo."
287
+
288
+ #: ../include/languages-form.php:80
289
+ msgid "Language code"
290
+ msgstr "Kod języka"
291
+
292
+ #: ../include/languages-form.php:82
293
+ msgid "2-letters ISO 639-1 language code (for example: en)"
294
+ msgstr "2-literowy kod języka w ISO 639-1 (np. en)"
295
+
296
+ #: ../include/languages-form.php:86
297
+ msgid "Text direction"
298
+ msgstr "Kierunek zapisu języka"
299
+
300
+ #: ../include/languages-form.php:87
301
+ msgid "left to right"
302
+ msgstr "od lewej do prawej"
303
+
304
+ #: ../include/languages-form.php:88
305
+ msgid "right to left"
306
+ msgstr "od prawej do lewej"
307
+
308
+ #: ../include/languages-form.php:89
309
+ msgid "Choose the text direction for the language"
310
+ msgstr "Wybierz kierunek zapisu języka"
311
+
312
+ #: ../include/languages-form.php:95
313
+ msgid "Position of the language in the language switcher"
314
+ msgstr "Pozycja języka w przełączniku języka"
315
+
316
+ #: ../include/languages-form.php:98
317
+ msgid "Update"
318
+ msgstr "Aktualizacja"
319
+
320
+ #: ../include/languages-form.php:134
321
+ msgid "Language switcher"
322
+ msgstr "Przełącznik języka"
323
+
324
+ #: ../include/languages-form.php:173
325
+ msgid "Default language"
326
+ msgstr "Domyślny język"
327
+
328
+ #: ../include/languages-form.php:191
329
+ msgid "There are posts, pages, categories or tags without language set. Do you want to set them all to default language ?"
330
+ msgstr "Istnieją wpisy, strony, kategorie i tagi bez określonego języka. Czy chcesz ustawić dla nich domyślny język?"
331
+
332
+ #: ../include/languages-form.php:199
333
+ msgid "Detect browser language"
334
+ msgstr "Wykryj język przeglądarki"
335
+
336
+ #: ../include/languages-form.php:205
337
+ msgid "When the front page is visited, set the language according to the browser preference"
338
+ msgstr "Przy wejściu na stronę domową, ustaw język zgodnie z ustawieniami przeglądarki"
339
+
340
+ #: ../include/languages-form.php:212
341
+ msgid "URL modifications"
342
+ msgstr "Modyfikacje URL"
343
+
344
+ #: ../include/languages-form.php:218
345
+ msgid "Keep /language/ in pretty permalinks. Example:"
346
+ msgstr "Zachowaj /language/ w przyjaznych permalinkach. Np.:"
347
+
348
+ #: ../include/languages-form.php:226
349
+ msgid "Remove /language/ in pretty permalinks. Example:"
350
+ msgstr "Usuń /language/ z przyjaznych permalinków. Np.:"
351
+
352
+ #: ../include/languages-form.php:234
353
+ msgid "Hide URL language information for default language"
354
+ msgstr "Ukryj informację o języku w URL dla domyślnego języka"
355
+
356
+ #: ../include/languages-form.php:241
357
+ msgid "Add language information to all URL including posts, pages, categories and post tags (not recommended)"
358
+ msgstr "Dodaj informację o języku do wszystkich URL w tym do wpisów, stron, kategorii i tagów (nie rekomendowane)"
359
+
360
+ #: ../include/base.php:33
361
+ msgid "All languages"
362
+ msgstr "Wszystkie języki"
363
+
364
+ #: ../include/post-translations.php:1
365
+ msgid "ID of pages in other languages:"
366
+ msgstr "ID stron w innych językach"
367
+
368
+ #: ../include/post-translations.php:1
369
+ msgid "ID of posts in other languages:"
370
+ msgstr "ID wpisów w innych językach"
371
+
372
+ #: ../include/post-translations.php:5
373
+ msgid "Page ID"
374
+ msgstr "ID strony"
375
+
376
+ #: ../include/post-translations.php:5
377
+ msgid "Post ID"
378
+ msgstr "ID wpisu"
379
+
polylang.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
- Version: 0.7.1
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
@@ -10,8 +10,9 @@ Description: Adds multilingual capability to Wordpress
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
14
- published by the Free Software Foundation.
 
15
 
16
  This program is distributed in the hope that it will be useful,
17
  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -23,7 +24,7 @@ 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.7.1');
27
  define('PLL_MIN_WP_VERSION', '3.1');
28
 
29
  define('POLYLANG_DIR', dirname(__FILE__)); // our directory
@@ -133,7 +134,7 @@ class Polylang extends Polylang_Base {
133
  $options = get_option('polylang');
134
  if (!$options) {
135
  $options['browser'] = 1; // default language for the front page is set by browser preference
136
- $options['rewrite'] = 0; // do not remove /language/ in permalinks
137
  $options['hide_default'] = 0; // do not remove URL language information for default language
138
  $options['force_lang'] = 0; // do not add URL language information when useless
139
  }
@@ -203,7 +204,7 @@ class Polylang extends Polylang_Base {
203
  $tr[$language->slug] = $meta;
204
  }
205
 
206
- if(!empty($tr)) {
207
  $tr = serialize(array_merge(array($lang->slug => $id), $tr));
208
  update_metadata($type, $id, '_translations', $tr);
209
  }
@@ -247,8 +248,8 @@ class Polylang extends Polylang_Base {
247
  if (version_compare($options['version'], '0.7', '<'))
248
  $options['force_lang'] = 0; // option introduced in 0.7
249
 
250
- if (version_compare($options['version'], '0.7.1', '<'))
251
- $GLOBALS['wp_rewrite']->flush_rules(); // rewrite rules have been modified
252
 
253
  $options['version'] = POLYLANG_VERSION;
254
  update_option('polylang', $options);
@@ -288,6 +289,8 @@ class Polylang extends Polylang_Base {
288
  }
289
 
290
  // rewrites rules if pretty permalinks are used
 
 
291
  function rewrite_rules_array($rules) {
292
  $options = get_option('polylang');
293
  $newrules = array();
@@ -296,67 +299,54 @@ class Polylang extends Polylang_Base {
296
  if (!($listlanguages = $this->get_languages_list()))
297
  return $rules;
298
 
299
- // put the default language at the end in case the language information is hidden for default language
300
- // thanks to brbrbr http://wordpress.org/support/topic/plugin-polylang-rewrite-rules-not-correct
301
- foreach ($listlanguages as $key => $language) {
302
- if ($options['default_lang'] == $language->slug) {
303
- unset ($listlanguages[$key]);
304
- break;
305
- }
306
- }
307
- $listlanguages[] = $language;
308
 
309
- // modifies the rules created by WordPress when '/language/' is removed in permalinks
310
- if ($options['rewrite']) {
311
- foreach ($listlanguages as $language) {
312
- $slug = $options['default_lang'] == $language->slug && $options['hide_default'] ? '' : $language->slug . '/';
313
- $newrules[$slug.'feed/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?lang='.$language->slug.'&feed=$matches[1]';
314
- $newrules[$slug.'(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?lang='.$language->slug.'&feed=$matches[1]';
315
- $newrules[$slug.'page/?([0-9]{1,})/?$'] = 'index.php?lang='.$language->slug.'&paged=$matches[1]';
316
- if ($slug)
317
- $newrules[$slug.'?$'] = 'index.php?lang='.$language->slug;
318
- }
319
- unset($rules['([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$']); // => index.php?lang=$matches[1]&feed=$matches[2]
320
- unset($rules['([^/]+)/(feed|rdf|rss|rss2|atom)/?$']); // => index.php?lang=$matches[1]&feed=$matches[2]
321
- unset($rules['([^/]+)/page/?([0-9]{1,})/?$']); // => index.php?lang=$matches[1]&paged=$matches[2]
322
- unset($rules['([^/]+)/?$']); // => index.php?lang=$matches[1]
323
- }
324
 
325
- $base = $options['rewrite'] ? '' : 'language/';
326
 
327
- // rewrite rules for comments feed filtered by language
328
- foreach ($listlanguages as $language) {
329
- $slug = $options['default_lang'] == $language->slug && $options['hide_default'] ? '' : $base.$language->slug . '/';
330
- $newrules[$slug.'comments/feed/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?lang='.$language->slug.'&feed=$matches[1]&withcomments=1';
331
- $newrules[$slug.'comments/(feed|rdf|rss|rss2|atom)/?$'] = 'index.php?lang='.$language->slug.'&feed=$matches[1]&withcomments=1';
332
- }
333
- unset($rules['comments/feed/(feed|rdf|rss|rss2|atom)/?$']); // => index.php?&feed=$matches[1]&withcomments=1
334
- unset($rules['comments/(feed|rdf|rss|rss2|atom)/?$']); // => index.php?&feed=$matches[1]&withcomments=1
335
 
336
- // rewrite rules for archives filtered by language
337
- foreach ($rules as $key => $rule) {
338
- $is_archive = strpos($rule, 'post_format=') || strpos($rule, 'author_name=') || strpos($rule, 'post_type=') || strpos($rule, 'year=') && !(
339
- strpos($rule, 'p=') ||
340
- strpos($rule, 'name=') ||
341
- strpos($rule, 'page=') ||
342
- strpos($rule, 'cpage=') );
343
-
344
- if ($is_archive) {
345
- foreach ($listlanguages as $language) {
346
- $slug = $options['default_lang'] == $language->slug && $options['hide_default'] ? '' : $base.$language->slug . '/';
347
- $newrules[$slug.$key] = str_replace('?', '?lang='.$language->slug.'&', $rule);
348
- }
349
- unset($rules[$key]); // now useless
 
350
  }
351
- }
352
 
353
- // optionally add the language information to all urls
354
- if ($options['force_lang']) {
355
- foreach ($rules as $key => $rule) {
356
- foreach ($listlanguages as $language) {
357
- $slug = $options['default_lang'] == $language->slug && $options['hide_default'] ? '' : $base.$language->slug . '/';
358
- $newrules[$slug.$key] = $rules[$key];
359
- }
 
 
360
  unset($rules[$key]); // now useless
361
  }
362
  }
2
  /*
3
  Plugin Name: Polylang
4
  Plugin URI: http://wordpress.org/extend/plugins/polylang/
5
+ Version: 0.7.2
6
  Author: F. Demarle
7
  Description: Adds multilingual capability to Wordpress
8
  */
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, published by
14
+ the Free Software Foundation, either version 2 of the License, or
15
+ (at your option) any later version.
16
 
17
  This program is distributed in the hope that it will be useful,
18
  but WITHOUT ANY WARRANTY; without even the implied warranty of
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
+ define('POLYLANG_VERSION', '0.7.2');
28
  define('PLL_MIN_WP_VERSION', '3.1');
29
 
30
  define('POLYLANG_DIR', dirname(__FILE__)); // our directory
134
  $options = get_option('polylang');
135
  if (!$options) {
136
  $options['browser'] = 1; // default language for the front page is set by browser preference
137
+ $options['rewrite'] = 1; // remove /language/ in permalinks (was the opposite before 0.7.2)
138
  $options['hide_default'] = 0; // do not remove URL language information for default language
139
  $options['force_lang'] = 0; // do not add URL language information when useless
140
  }
204
  $tr[$language->slug] = $meta;
205
  }
206
 
207
+ if (!empty($tr)) {
208
  $tr = serialize(array_merge(array($lang->slug => $id), $tr));
209
  update_metadata($type, $id, '_translations', $tr);
210
  }
248
  if (version_compare($options['version'], '0.7', '<'))
249
  $options['force_lang'] = 0; // option introduced in 0.7
250
 
251
+ if (version_compare($options['version'], '0.7.2', '<'))
252
+ $GLOBALS['wp_rewrite']->flush_rules(); // rewrite rules have been modified in 0.7.1 & 0.7.2
253
 
254
  $options['version'] = POLYLANG_VERSION;
255
  update_option('polylang', $options);
289
  }
290
 
291
  // rewrites rules if pretty permalinks are used
292
+ // always make sure the default language is at the end in case the language information is hidden for default language
293
+ // thanks to brbrbr http://wordpress.org/support/topic/plugin-polylang-rewrite-rules-not-correct
294
  function rewrite_rules_array($rules) {
295
  $options = get_option('polylang');
296
  $newrules = array();
299
  if (!($listlanguages = $this->get_languages_list()))
300
  return $rules;
301
 
302
+ $languages = array();
303
+ foreach ($listlanguages as $language)
304
+ if (!$options['hide_default'] || $options['default_lang'] != $language->slug)
305
+ $languages[] = $language->slug;
 
 
 
 
 
306
 
307
+ if ($languages) {
308
+ $slug = '('.implode('|', $languages).')/';
309
+ $slug = $options['rewrite'] ? $slug : 'language/'.$slug;
310
+ }
311
+
312
+ foreach ($rules as $key => $rule) {
313
+ $is_archive = strpos($rule, 'post_format=') || strpos($rule, 'author_name=') || strpos($rule, 'post_type=') || strpos($rule, 'year=') &&
314
+ !(strpos($rule, 'p=') || strpos($rule, 'name=') || strpos($rule, 'page=') || strpos($rule, 'cpage='));
 
 
 
 
 
 
 
315
 
316
+ $is_comment_feed = strpos($rule, 'withcomments=1');
317
 
318
+ // modifies the rules created by WordPress for our taxonomy
319
+ if (strpos($rule, 'lang=')) {
320
+ $newkey = $options['rewrite'] ? str_replace('([^/]+)/', '', $key) : str_replace('language/([^/]+)/', '', $key);
321
+ if (isset($slug))
322
+ $newrules[$slug.$newkey] = $rule;
 
 
 
323
 
324
+ // take care not to create the rule [?$] => index.php?lang=$matches[1] !
325
+ if ($options['hide_default'] && $newkey != '?$')
326
+ $newrules[$newkey] = str_replace('lang=$matches[1]', 'lang='.$options['default_lang'], $rule);
327
+
328
+ unset($rules[$key]);
329
+ }
330
+
331
+ // special case for pages which do not accept adding the lang parameter
332
+ // FIXME check if it's still the case for WP3.4
333
+ elseif ($options['force_lang'] && strpos($rule, 'pagename')) {
334
+ if (isset($slug))
335
+ $newrules[$slug.$key] = str_replace(array('[4]', '[3]', '[2]', '[1]'), array('[5]', '[4]', '[3]', '[2]'), $rule); // hopefully it is sufficient !
336
+
337
+ if (!$options['hide_default'])
338
+ unset($rules[$key]); // now useless
339
  }
 
340
 
341
+ // rewrite rules filtered by language
342
+ elseif ($is_archive || $is_comment_feed || $options['force_lang']) {
343
+ if (isset($slug))
344
+ $newrules[$slug.$key] = str_replace(array('[8]', '[7]', '[6]', '[5]', '[4]', '[3]', '[2]', '[1]', '?'),
345
+ array('[9]', '[8]', '[7]', '[6]', '[5]', '[4]', '[3]', '[2]', '?lang=$matches[1]&'), $rule); // hopefully it is sufficient !
346
+
347
+ if ($options['hide_default'])
348
+ $newrules[$key] = str_replace('?', '?lang='.$options['default_lang'].'&', $rule);
349
+
350
  unset($rules[$key]); // now useless
351
  }
352
  }
readme.txt CHANGED
@@ -4,12 +4,16 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: bilingual, language, i18n, international, l10n, localization, multilanguage, multilingual, multisite, translate, translation
5
  Requires at least: 3.1
6
  Tested up to: 3.3.1
7
- Stable tag: 0.7.1
8
 
9
  Polylang adds multilingual content management support to WordPress.
10
 
11
  == Description ==
12
 
 
 
 
 
13
  = Upgrade Notice =
14
 
15
  When upgrading from 0.5.1 or older, 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). When upgrading from 0.6.1 or older, people using RTL languages must edit these languages and set the text direction to RTL in order for Polylang to work properly (the RTL property of the language is not set automatically when upgrading).
@@ -37,6 +41,7 @@ The plugin admin interface is currently available in:
37
  * Greek contributed by [theodotos](http://www.ubuntucy.org)
38
  * Dutch contributed by [AlbertGn](http://wordpress.org/support/profile/albertgn)
39
  * Hebrew contributed by [ArielK](http://www.arielk.net)
 
40
 
41
  Other translators are welcome !
42
 
@@ -80,11 +85,55 @@ Yes. You have to use PNG or JPG files and name them with the WordPress locale co
80
 
81
  1. The Polylang languages admin panel in WordPress 3.3.1
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  == Changelog ==
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  = 0.7.1 (2012-02-06) =
86
 
87
- * Allow using ISO 639-2 (3 characters) languages codes
88
  * The predefined languages dropdown list now displays the locale to help differentiate some languages
89
  * Add 5 new languages to predefined list
90
  * Bug correction: the filter 'pll_copy_post_metas' does not work
4
  Tags: bilingual, language, i18n, international, l10n, localization, multilanguage, multilingual, multisite, translate, translation
5
  Requires at least: 3.1
6
  Tested up to: 3.3.1
7
+ Stable tag: 0.7.2
8
 
9
  Polylang adds multilingual content management support to WordPress.
10
 
11
  == Description ==
12
 
13
+ = Announcement =
14
+
15
+ [A development version of Polylang 0.8 is available](http://wordpress.org/support/topic/development-of-polylang-version-08).
16
+
17
  = Upgrade Notice =
18
 
19
  When upgrading from 0.5.1 or older, 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). When upgrading from 0.6.1 or older, people using RTL languages must edit these languages and set the text direction to RTL in order for Polylang to work properly (the RTL property of the language is not set automatically when upgrading).
41
  * Greek contributed by [theodotos](http://www.ubuntucy.org)
42
  * Dutch contributed by [AlbertGn](http://wordpress.org/support/profile/albertgn)
43
  * Hebrew contributed by [ArielK](http://www.arielk.net)
44
+ * Polish contributed by [Peter Paciorkiewicz](http://www.paciorkiewicz.pl)
45
 
46
  Other translators are welcome !
47
 
85
 
86
  1. The Polylang languages admin panel in WordPress 3.3.1
87
 
88
+ == Contribute ==
89
+
90
+ If you wonder how you can help Polylang, here are some ideas. As you will read, there is no need to be a PHP developper!
91
+
92
+ = Help other users of Polylang =
93
+
94
+ The [support forum](http://wordpress.org/tags/polylang?forum_id=10) is here so that users of the plugin can get help when they need it. However, I will not always available to answer questions. You don't need to be a developer to help out. Very often similar questions have been answered in the past. You can subscribe to the tag ['polylang'](http://wordpress.org/tags/polylang) (emails or RSS feed, see just below the topic list) to know when a new topic has been posted.
95
+
96
+ = Report bugs =
97
+
98
+ Don't hesitate to report bugs on the [support forum](http://wordpress.org/tags/polylang?forum_id=10).
99
+
100
+ = Test new versions =
101
+
102
+ You can subscribe to the tag ['polylang-dev'](http://wordpress.org/tags/polylang-dev) that I use to announce development versions and then, test the new versions and report bugs before the final release. It helps a lot!
103
+
104
+ = Translate the admin interface =
105
+
106
+ Polylang is already available in 8 languages. It's very easy to add a new one ! Download [poedit](http://www.poedit.net/download.php) (available for Windows, Mac OS X and Linux). Rename the file polylang.pot found in the polylang/languages directory into something like polylang-your_locale.po. Open the file with poedit and start translating (keeping strange codes such as %s, %1$s as is). Once done, just save and you will get two files polylang-your_locale.po and polylang-your_locale.mo that you can send to the author. The translation will be included with the next release.
107
+
108
+ = Communicate =
109
+
110
+ If you like Polylang, you can spread the world... Rating the plugin is very easy, you can write some words about the plugin, make a link to the plugin page...
111
+
112
+ = What else ? =
113
+
114
+ Every suggestions are welcome.
115
+
116
  == Changelog ==
117
 
118
+ = 0.7.2 (2012-02-15) =
119
+
120
+ * Add Polish translation contributed by [Peter Paciorkiewicz](http://www.paciorkiewicz.pl)
121
+ * Add 5 new languages to predefined list
122
+ * completely reworked rewrite rules
123
+ * Bug correction: custom nav menus do not work in Artisteer generated themes
124
+ * Bug correction: having a single language causes multiple warnings while saving post/page.
125
+ * Bug correction: custom nav menu broken on archives pages
126
+ * Bug correction: the language switcher does not link to translated post type archive when using pretty permalinks
127
+ * Bug correction: the tags are not saved in the right language when translated tags have the same name
128
+ * Bug correction: bad link in post preview when adding language code to all urls
129
+ * Bug correction: feed not filtered by language when adding language code to all urls
130
+ * Bug correction: duplicate canonical link when used together with WordPress SEO by Yoast
131
+ * Bug correction: the all posts admin page is messed if another plugin adds a column
132
+ * Bug correction: 404 error on static front page when adding language code to all urls (including default language)
133
+
134
  = 0.7.1 (2012-02-06) =
135
 
136
+ * Allow using 3 characters languages codes (ISO 639-2 or 639-3)
137
  * The predefined languages dropdown list now displays the locale to help differentiate some languages
138
  * Add 5 new languages to predefined list
139
  * Bug correction: the filter 'pll_copy_post_metas' does not work