WordPress.org

Plugin Directory

Changeset 616447


Ignore:
Timestamp:
10/23/12 18:58:56 (18 months ago)
Author:
Chouby
Message:

0.9.4 in trunk

Location:
polylang/trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • polylang/trunk/include/admin.php

    r612378 r616447  
    5858 
    5959        // for widgets 
    60         $widget_lang = get_option('polylang_widgets'); 
     60        $widget_lang = get_option('polylang_widgets', array()); // returns empty array if not set yet 
    6161 
    6262        $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; 
     
    110110 
    111111                    // delete menus locations 
    112                     foreach ($locations as $location => $description) 
    113                         unset($menu_lang[$location][$lang_slug]); 
     112                    foreach ($locations as $location => $description) { 
     113                        if (isset($menu_lang[$location][$lang_slug])) 
     114                            unset($menu_lang[$location][$lang_slug]); 
     115                    } 
    114116                    update_option('polylang_nav_menus', $menu_lang); 
    115117 
     
    268270 
    269271                // fills existing posts & terms with default language 
    270                 if (isset($_POST['fill_languages'])) { 
     272                if (isset($_POST['fill_languages']) && $nolang = $this->get_objects_with_no_lang()) { 
    271273                    global $wpdb; 
    272                     $nolang = $this->get_objects_with_no_lang(); 
    273274                    $lang = $this->get_language($options['default_lang']); 
    274275 
  • polylang/trunk/include/core.php

    r614707 r616447  
    733733 
    734734    // filters the nav menus according to the current language when called from get_nav_menu_locations() 
    735     // mainly for Artisteer generated themes 
     735    // mainly for Artisteer generated themes and themes which test has_nav_menu 
    736736    function nav_menu_locations($menus) { 
    737         if (is_array($menus)) { 
    738             foreach($menus as $location => $menu) { 
    739                 $menu_lang = get_option('polylang_nav_menus'); 
    740                 if (isset($menu_lang[$location][$this->curlang->slug])) 
    741                     $menus[$location] = $menu_lang[$location][$this->curlang->slug]; 
    742             } 
     737        $menu_lang = get_option('polylang_nav_menus'); 
     738        foreach(get_registered_nav_menus() as $location => $menu) { 
     739            if (isset($menu_lang[$location][$this->curlang->slug])) 
     740                $menus[$location] = $menu_lang[$location][$this->curlang->slug]; 
    743741        } 
    744742        return $menus; 
  • polylang/trunk/include/languages.php

    r612378 r616447  
    66// [3] => not set for ltr scripts, 'rtl' otherwise 
    77$languages = array( 
     8    array('af', 'af', 'Afrikaans'), 
    89    array('ar', 'ar', 'العربية', 'rtl'), 
    910    array('be', 'be_BY', 'Беларуская мова'), 
  • polylang/trunk/polylang.php

    r614927 r616447  
    33Plugin Name: Polylang 
    44Plugin URI: http://wordpress.org/extend/plugins/polylang/ 
    5 Version: 0.9.3.8 
     5Version: 0.9.4 
    66Author: F. Demarle 
    77Description: Adds multilingual capability to Wordpress 
     
    2525*/ 
    2626 
    27 define('POLYLANG_VERSION', '0.9.3.8'); 
     27define('POLYLANG_VERSION', '0.9.4'); 
    2828define('PLL_MIN_WP_VERSION', '3.1'); 
    2929 
     
    6767 
    6868        // manages plugin activation and deactivation 
    69         register_activation_hook( __FILE__, array(&$this, 'activate') ); 
    70         register_deactivation_hook( __FILE__, array(&$this, 'deactivate') ); 
     69        register_activation_hook( __FILE__, array(&$this, 'activate')); 
     70        register_deactivation_hook( __FILE__, array(&$this, 'deactivate')); 
    7171 
    7272        // stopping here if we are going to deactivate the plugin avoids breaking rewrite rules 
    7373        if (isset($_GET['action']) && $_GET['action'] == 'deactivate' && isset($_GET['plugin']) && $_GET['plugin'] == 'polylang/polylang.php') 
    7474            return; 
     75 
     76        // blog creation on multisite 
     77        add_action('wpmu_new_blog', array(&$this, 'wpmu_new_blog')); 
    7578 
    7679        // manages plugin upgrade 
     
    107110    function activate() { 
    108111        global $wp_version, $wpdb; 
    109         $style = '<p style = "font-family: sans-serif; font-size: 12px; color: #333; margin: -5px">%s</p>'; 
     112        load_plugin_textdomain('polylang', false, basename(POLYLANG_DIR).'/languages'); // plugin i18n 
    110113 
    111114        if (version_compare($wp_version, PLL_MIN_WP_VERSION , '<'))  
    112             die (sprintf($style, sprintf(__('You are using WordPress %s. Polylang requires at least WordPress %s.', 'polylang'), $wp_version, PLL_MIN_WP_VERSION))); 
     115            die (sprintf('<p style = "font-family: sans-serif; font-size: 12px; color: #333; margin: -5px">%s</p>', 
     116                sprintf(__('You are using WordPress %s. Polylang requires at least WordPress %s.', 'polylang'), $wp_version, PLL_MIN_WP_VERSION))); 
    113117 
    114118        // check if it is a network activation - if so, run the activation function for each blog 
     
    116120            foreach ($wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")) as $blog_id) { 
    117121                switch_to_blog($blog_id); 
    118                 $r = $this->_activate(); 
     122                $this->_activate(); 
    119123            } 
    120124            restore_current_blog(); 
    121125        } 
    122126        else 
    123             $r = $this->_activate(); 
    124  
    125         if (!$r) 
    126             die (sprintf($style, __('For some reasons, Polylang could not create a table in your database.', 'polylang'))); 
     127            $this->_activate(); 
    127128    } 
    128129 
     
    147148 
    148149        if ($r === false) 
    149             return false; 
     150            die (sprintf('<p style = "font-family: sans-serif; font-size: 12px; color: #333; margin: -5px">%s</p>', 
     151                __('For some reasons, Polylang could not create a table in your database.', 'polylang'))); 
    150152 
    151153        // codex tells to use the init action to call register_taxonomy but I need it now for my rewrite rules 
     
    169171        $this->prepare_rewrite_rules(); 
    170172        flush_rewrite_rules(); 
    171         return true; 
    172173    } 
    173174 
     
    191192    function _deactivate() { 
    192193        flush_rewrite_rules(); 
     194    } 
     195 
     196    // blog creation on multisite 
     197    function wpmu_new_blog($blog_id) { 
     198        switch_to_blog($blog_id); 
     199        $r = $this->_activate(); 
     200        restore_current_blog(); 
    193201    } 
    194202 
  • polylang/trunk/readme.txt

    r614927 r616447  
    2222* As a bonus, each user can set the WordPress admin language in its profile 
    2323 
    24 The plugin admin interface is currently available in 18 languages: English, French, German contributed by [Christian Ries](http://www.singbyfoot.lu), Russian contributed by [yoyurec](http://yoyurec.in.ua), Greek contributed by [theodotos](http://www.ubuntucy.org), Dutch contributed by [AlbertGn](http://wordpress.org/support/profile/albertgn), Hebrew contributed by [ArielK](http://www.arielk.net), Polish contributed by [Peter Paciorkiewicz](http://www.paciorkiewicz.pl), Latvian contributed by [@AndyDeGroo](http://twitter.com/AndyDeGroo), Italian contributed by [Luca Barbetti](http://wordpress.org/support/profile/lucabarbetti), Danish contributed by [Compute](http://wordpress.org/support/profile/compute), Spanish contributed by Curro, Portuguese contributed by [Vitor Carvalho](http://vcarvalho.com/), Lithuanian contributed by [Naglis Jonaitis](http://najo.lt/), Turkish contributed by [darchws](http://darch.ws/), Finnish contributed by [Jani Alha](http://www.wysiwyg.fi), Bulgarian contributed by [pavelsof](http://wordpress.org/support/profile/pavelsof), Belarusian contributed by [Alexander Markevitch](http://fourfeathers.by/) 
     24The plugin admin interface is currently available in 19 languages: English, French, German contributed by [Christian Ries](http://www.singbyfoot.lu), Russian contributed by [yoyurec](http://yoyurec.in.ua), Greek contributed by [theodotos](http://www.ubuntucy.org), Dutch contributed by [AlbertGn](http://wordpress.org/support/profile/albertgn), Hebrew contributed by [ArielK](http://www.arielk.net), Polish contributed by [Peter Paciorkiewicz](http://www.paciorkiewicz.pl), Latvian contributed by [@AndyDeGroo](http://twitter.com/AndyDeGroo), Italian contributed by [Luca Barbetti](http://wordpress.org/support/profile/lucabarbetti), Danish contributed by [Compute](http://wordpress.org/support/profile/compute), Spanish contributed by Curro, Portuguese contributed by [Vitor Carvalho](http://vcarvalho.com/), Lithuanian contributed by [Naglis Jonaitis](http://najo.lt/), Turkish contributed by [darchws](http://darch.ws/), Finnish contributed by [Jani Alha](http://www.wysiwyg.fi), Bulgarian contributed by [pavelsof](http://wordpress.org/support/profile/pavelsof), Belarusian contributed by [Alexander Markevitch](http://fourfeathers.by/), Afrikaans contributed by [Kobus Joubert](http://translate3d.com/) 
    2525 
    2626 
     
    8181= Translate the admin interface = 
    8282 
    83 Polylang is already available in 18 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. 
     83Polylang is already available in 19 languages. It's very easy to add a new one ! Download [poedit](http://www.poedit.net/download.php) (available for Windows, Mac OS X and Linux). Rename the file polylang.pot found in the polylang/languages directory into something like polylang-your_locale.po. Open the file with poedit and start translating (keeping strange codes such as %s, %1$s as is). Once done, just save and you will get two files polylang-your_locale.po and polylang-your_locale.mo that you can send to the author. The translation will be included with the next release. 
    8484 
    8585= Communicate = 
     
    9393== Changelog == 
    9494 
    95 = 0.9.4 = 
    96  
     95= 0.9.4 (2012-10-23) = 
     96 
     97* Add Afrikaans translation contributed by [Kobus Joubert](http://translate3d.com/) 
    9798* Add Belarusian translation contributed by [Alexander Markevitch](http://fourfeathers.by/) 
    98 * Add Belarusian (be_BY) to predefined languages list (automatic download and update of language files won't work) 
     99* Add Afrikaans (af) and Belarusian (be_BY) to predefined languages list (automatic download and update of language files won't work) 
    99100* Add the possibility to translate the date format and time format 
    100101* Add compatibility with the 'icl_get_home_url' function from the WPML API 
     
    105106* Bug correction: the admin language filter messes the categories languages when editing a post and the parent dropdown list when editing a category 
    106107* Bug correction: search form does not work when using a static front page (introduced in 0.9.2) 
     108* Bug correction: can't set languages for categories and post tags on blogs created after polylang has been activated at network level 
     109* Bug correction: menus don't work with catch box theme ('has_nav_menu' not correctly filtered) 
    107110 
    108111= 0.9.3 (2012-10-08) = 
Note: See TracChangeset for help on using the changeset viewer.