Plugin Directory

Changeset 664567


Ignore:
Timestamp:
02/06/2013 10:17:10 PM (13 years ago)
Author:
codestyling
Message:

update 1.99.30

Location:
codestyling-localization/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • codestyling-localization/trunk/codestyling-localization.php

    r641938 r664567  
    44Plugin URI: http://www.code-styling.de/english/development/wordpress-plugin-codestyling-localization-en
    55Description: You can manage and edit all gettext translation files (*.po/*.mo) directly out of your WordPress Admin Center without any need of an external editor. It automatically detects the gettext ready components like <b>WordPress</b> itself or any <b>Plugin</b> / <b>Theme</b> supporting gettext, is able to scan the related source files and can assists you using <b>Google Translate API</b> or <b>Microsoft Translator API</b> during translation.This plugin supports <b>WordPress MU</b> and allows explicit <b>WPMU Plugin</b> translation too. It newly introduces ignore-case and regular expression search during translation. <b>BuddyPress</b> and <b>bbPress</b> as part of BuddyPress can be translated too. Produces transalation files are 100% compatible to <b>PoEdit</b>.
    6 Version: 1.99.29
     6Version: 1.99.30
    77Author: Heiko Rabe
    88Author URI: http://www.code-styling.de/english/
     
    4848//error_reporting(E_ALL|E_STRICT);
    4949//@unlink(dirname(__FILE__).'/.htaccess');
     50
     51if (!defined('E_RECOVERABLE_ERROR'))
     52    define('E_RECOVERABLE_ERROR', 4096);
     53if (!defined('E_DEPRECATED'))
     54    define('E_DEPRECATED', 8192);
     55if (!defined('E_USER_DEPRECATED '))
     56    define('E_USER_DEPRECATED ', 16384);
    5057
    5158function csp_split_url($url) {
     
    103110    //Attention: Google Chrome and Safari behave in different way (shared WebKit issue or all other are wrong?)!
    104111    list($csp_domain, $csp_target) = csp_split_url( ( function_exists("admin_url") ? rtrim(admin_url(), '/') : rtrim(get_site_url().'/wp-admin/', '/') ) );
     112    define('CSP_SELF_DOMAIN', $csp_domain);
    105113    if (
    106114        stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false
     
    21082116function csp_po_init_per_user_trans() {
    21092117    //process per user settings
    2110     if (defined('TRANSLATION_API_PER_USER') && (TRANSLATION_API_PER_USER === true) && current_user_can('manage_options')) {
     2118    if (is_user_logged_in() && defined('TRANSLATION_API_PER_USER') && (TRANSLATION_API_PER_USER === true) && current_user_can('manage_options')) {
    21112119        $myself = wp_get_current_user();
    21122120        $func = function_exists('get_user_meta') ? 'get_user_meta' : 'get_usermeta';
     
    23172325    <li><a href="http://wordpress.org/extend/plugins/debug-bar/" target="_blank">Debug Bar</a> <small>(by wordpressdotorg)</small></li>
    23182326    <li><a href="http://wordpress.org/extend/plugins/debug-bar-console/" target="_blank">Debug Bar Console</a> <small>(by koopersmith)</small></li>
     2327    <li><a href="http://wordpress.org/extend/plugins/wp-piwik/" target="_blank">WP-Piwik</a> <small>(by braekling)</small></li>
    23192328</ul>
    23202329<?php
     
    24152424        '/debug-bar/',
    24162425        '/debug-bar-console/',
    2417         '/localization/'
     2426        '/localization/',
     2427        '/wp-piwik/'
    24182428    );
    24192429    foreach($valid as $slug)
     
    24352445                if (isset($wp_scripts->registered[$token]->src) && !empty($wp_scripts->registered[$token]->src)) {
    24362446                    if (preg_match('|^http|', $wp_scripts->registered[$token]->src)) {
    2437                         if(!preg_match('|^'.str_replace('.','\.',get_site_url()).'|', $wp_scripts->registered[$token]->src)) {
     2447                        if(!preg_match('|^'.str_replace('.','\.',CSP_SELF_DOMAIN).'|', $wp_scripts->registered[$token]->src)) {
    24382448                            if (in_array($token, $csp_known_wordpress_externals) || csp_known_and_valid_cdn($wp_scripts->registered[$token]->src)) {
    24392449                                if (!in_array($token, $csp_external_scripts['cdn']['tokens'])) {
     
    25622572                        }
    25632573                    }
    2564                     elseif (stripos($url[1], get_site_url()) === false && !in_array($url[1], $csp_external_scripts['cdn']['scripts'])) {
     2574                    elseif (stripos($url[1], CSP_SELF_DOMAIN) === false && !in_array($url[1], $csp_external_scripts['cdn']['scripts'])) {
    25652575                        //external
    25662576                        $dirty_index[] = $i;           
     
    26142624                        }
    26152625                    }
    2616                     elseif (stripos($url[1], get_site_url()) === false && !in_array($url[1], $csp_external_scripts['cdn']['scripts'])) {
     2626                    elseif (stripos($url[1], CSP_SELF_DOMAIN) === false && !in_array($url[1], $csp_external_scripts['cdn']['scripts'])) {
    26172627                        //external
    26182628                        $dirty_index[] = $i;           
     
    31873197    foreach($rows as $data) :
    31883198?>
    3189 <tr<?php if (preg_match("/^".__("activated",CSP_PO_TEXTDOMAIN)."/", $data['status'])) echo " class=\"csp-active\""; ?>>
     3199<tr<?php if (__("activated",CSP_PO_TEXTDOMAIN) == $data['status']) echo " class=\"csp-active\""; ?>>
    31903200    <td align="center"><img alt="" src="<?php echo CSP_PO_BASE_URL."/images/".$data['img_type'].".gif"; ?>" /><div><strong><?php echo $data['type-desc']; ?></strong></div></td>
    31913201    <td>
  • codestyling-localization/trunk/includes/class-translationfile.php

    r629816 r664567  
    8585            'Content-Transfer-Encoding'     => '8bit',
    8686            'Plural-Forms'                  => 'nplurals=2; plural=n != 1;',
     87            'X-Generator'                   => 'CSL v1.x',
    8788            'X-Poedit-Language'             => '',
    8889            'X-Poedit-Country'              => '',
     
    9596        );
    9697        $this->header_vars = array_keys($this->header);
     98        $this->mo_header_vars = array(
     99            'PO-Revision-Date',
     100            'MIME-Version',
     101            'Content-Type',
     102            'Content-Transfer-Encoding',
     103            'Plural-Forms',
     104            'X-Generator',
     105            'Project-Id-Version'
     106        );
    97107        array_splice($this->header_vars, array_search('X-Poedit-KeywordsList', $this->header_vars), 1 );
    98108        $this->plural_definitions               = array(
     
    127137    }
    128138   
    129     function _set_header_from_string($head, $lang='') {
     139    function _set_header_from_string($head, $lang='', $mo_hdr_vars = false) {
    130140        if (!is_string($head)) return;
    131141        $hdr = explode("\n", $head);
     142        $hdr_vars = $mo_hdr_vars ? $this->mo_header_vars : $this->header_vars;
    132143        foreach($hdr as $e) {
    133144            if ($this->strings->_strpos($e, ':') === false) continue;
    134145            list($key, $val) = explode(':', $e, 2);
    135146            $key = trim($key);$val = str_replace("\\","/", trim($val));
    136             if (in_array($key, $this->header_vars)) {
     147            if (in_array($key, $hdr_vars)) {
    137148                $this->header[$key] = $val;
    138149                //ensure qualified pluralization forms now
    139                 if ($key == 'Plural-Forms') {
     150                if ($key == 'Plural-Forms' && !$mo_hdr_vars) {
    140151                    $func = '';
    141152                    foreach($this->plural_definitions as $f => $langs) {
     
    260271        $country = strtoupper($country);
    261272        $this->_set_header_from_string(
    262             "Project-Id-Version: $proj_id\nPO-Revision-Date: $timestamp\nLast-Translator: $translator\nX-Poedit-Language: $language\nX-Poedit-Country: $country\nX-Poedit-Basepath: $rel\nPlural-Forms: \nX-Textdomain-Support: yes",
     273            "Project-Id-Version: $proj_id\nPO-Revision-Date: $timestamp\nLast-Translator: $translator\nX-Poedit-Language: $language\nX-Poedit-Country: $country\nX-Poedit-Basepath: $rel\nPlural-Forms: \nX-Textdomain-Support: yes\n",
    263274            $po_lang
    264275        );
     
    359370            $po_lang = $this->strings->_substr($_POST['language'],0,2);
    360371        }
    361         $this->_set_header_from_string("PO-Revision-Date: $stamp\nPlural-Forms: \nX-Textdomain-Support: $tds", $po_lang);
     372        $this->_set_header_from_string("PO-Revision-Date: $stamp\nPlural-Forms: \nX-Textdomain-Support: $tds\n", $po_lang);
    362373
    363374        //write header if last because it has no code ref anyway
     
    432443        //update the revision date
    433444        $stamp = date("Y-m-d H:i:sO");
    434         $this->_set_header_from_string("PO-Revision-Date: $stamp\nPlural-Forms: \nX-Textdomain-Support: $tds");
     445        $this->_set_header_from_string("PO-Revision-Date: $stamp\nPlural-Forms: \nX-Textdomain-Support: $tds\n");
    435446
    436447        //write header if last because it has no code ref anyway
     
    628639    }
    629640   
     641    function _reduce_header_for_mofile() {
     642        if (isset($this->map[''])) {
     643            $header = $this->map[''];
     644           
     645            $this->map[''] = $header;
     646        }
     647    }
     648   
    630649    function write_mofile($mofile, $textdomain) {
    631650        //handle WordPress continent cities patch to separate "Center" for UI and Continent/City use
     
    635654            $this->map["Center"] = $trans;
    636655        }
     656       
     657        //reduce the mofile header
     658        $mohdr = $this->map['']['T'];
     659        $mohdr_h = $this->header;
     660        $this->header = array();
     661        $this->_set_header_from_string($mohdr, '', true);
     662       
    637663        $handle = @fopen($mofile, "wb");
    638         if ($handle === false) return false;
     664        if ($handle === false){
     665            $this->header = $mohdr_h;
     666            $this->_set_header_from_string($mohdr, '', false);
     667            return false;
     668        }
    639669        ksort($this->map, SORT_REGULAR);
    640670        //let's calculate none empty values
     
    669699        fwrite($handle,$trans_table);
    670700        fclose($handle);   
     701        $this->header = $mohdr_h;
     702        $this->_set_header_from_string($mohdr, '', false);
    671703        return true;
    672704    }
     
    679711            $this->map["Center"] = $trans;
    680712        }
     713
     714        //reduce the mofile header
     715        $mohdr = $this->map['']['T'];
     716        $mohdr_h = $this->header;
     717        $this->header = array();
     718        $this->_set_header_from_string($mohdr, '', true);
    681719       
    682720        $content = '';
     
    712750        $content = substr_replace($content, $org_table, 28, strlen($org_table));
    713751        $content = substr_replace($content, $trans_table, 28 + strlen($org_table), strlen($trans_table));
     752        $this->header = $mohdr_h;
     753        $this->_set_header_from_string($mohdr, '', false);
    714754        return $content;
    715755    }
     
    725765        $func = array(&$this, '_reset_data');
    726766        array_walk($this->map, $func);
    727         $this->_set_header_from_string("X-Textdomain-Support: yes");   
     767        $this->_set_header_from_string("X-Textdomain-Support: yes\n"); 
    728768    }
    729769   
  • codestyling-localization/trunk/includes/locale-definitions.php

    r551808 r664567  
    2929    'hr' => array('hr_HR'),
    3030    'hu' => array('hu_HU'),
     31    'hy' => array('hy_AM'),
    3132    'id' => array('id_ID'),
    3233    'in' => array('in_ID'),
     
    9798    'hr' => "Jezik",
    9899    'hu' => "Nyelv",
     100    'hy' => "լեզու",
    99101    'id' => "Bahasa",
    100102    'in' => "Bahasa",
     
    166168    'hr' => "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);",
    167169    'hu' => "nplurals=1; plural=0;",
     170    'hy' => "nplurals=2; plural=n != 1;",
    168171    'id' => "nplurals=2; plural=n != 1;",
    169172    'in' => "nplurals=2; plural=n != 1;",
     
    196199    'th' => "nplurals=1; plural=0;",
    197200    'tl' => "nplurals=2; plural=n != 1;",
    198     'tr' => "nplurals=1; plural=0;",
     201    'tr' => "nplurals=2; plural=(n>1);",
    199202    'uk' => "nplurals=3; plural=n%100/10==1 ? 2 : n%10==1 ? 0 : (n+9)%10>3 ? 2 : 1;",
    200203    'ug' => "nplurals=1; plural=0;",
     
    11291132        'microsoft-api' => 'hu'
    11301133    ),
     1134    'hy_AM' => array (
     1135        'country' => "Armenia",
     1136        'country-www' => 'hy',
     1137        'lang' => 'Armenian',
     1138        'lang-native' => 'հայերեն/Հայաստան',
     1139        'lang-www' => 'hy-AM',
     1140        'dir' => 'ltr',
     1141        'ms-loc' => 'hy',
     1142        'ms-cp' => 'CP1256',
     1143        'google-api' => 'hy',
     1144        'microsoft-api' => ''
     1145    ),
    11311146    'id_ID' => array (
    11321147        'country' => "Indonesia",
  • codestyling-localization/trunk/languages/codestyling-localization-de_DE.po

    r641938 r664567  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: CodeStyling Localization v1.99.29\n"
     3"Project-Id-Version: CodeStyling Localization v1.99.30\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2008-08-25 03:13+0100\n"
    6 "PO-Revision-Date: 2012-12-19 19:38:34+0000\n"
     6"PO-Revision-Date: 2012-12-27 17:01:53+0000\n"
    77"Last-Translator: Heiko Rabe <[email protected]>\n"
    88"Language-Team: \n"
     
    1111"Content-Transfer-Encoding: 8bit\n"
    1212"Plural-Forms: nplurals=2; plural=n != 1;\n"
     13"X-Generator: CSL v1.x\n"
    1314"X-Poedit-Language: German\n"
    1415"X-Poedit-Country: GERMANY\n"
     
    514515#: codestyling-localization.php:1752
    515516#: codestyling-localization.php:1996
    516 #: includes/class-translationfile.php:938
     517#: includes/class-translationfile.php:970
    517518#@ codestyling-localization
    518519msgid "m/d/Y H:i:s"
     
    557558#: codestyling-localization.php:3437
    558559#: codestyling-localization.php:3467
    559 #: includes/class-translationfile.php:938
     560#: includes/class-translationfile.php:970
    560561#@ codestyling-localization
    561562msgid "unknown"
     
    17431744#: codestyling-localization.php:0
    17441745#@ codestyling-localization
    1745 msgid "1.99.29"
    1746 msgstr ""
    1747 
     1746msgid "1.99.30"
     1747msgstr ""
     1748
Note: See TracChangeset for help on using the changeset viewer.