WordPress.org

Plugin Directory

Changeset 567871


Ignore:
Timestamp:
07/05/12 15:51:30 (22 months ago)
Author:
jbrinley
Message:

fix erroneous usage of and _e wrapper function

Location:
wp-router/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-router/trunk/WP_Route.class.php

    r567868 r567871  
    3434        foreach ( array('path', 'page_callback') as $property ) { 
    3535            if ( !isset($properties[$property]) || !$properties[$property] ) { 
    36                 throw new Exception(self::__("Missing $property")); 
     36                throw new Exception(sprintf(__("Missing %s", 'wp-router'), $property)); 
    3737            } 
    3838        } 
     
    6161            return $this->properties[$property]; 
    6262        } else { 
    63             throw new Exception(self::__("Property not found: $property.")); 
     63            throw new Exception(sprintf(__("Property not found: %s.", 'wp-router'), $property)); 
    6464        } 
    6565    } 
     
    7575    public function set( $property, $value ) { 
    7676        if ( in_array($property, array('id', 'path', 'page_callback')) && !$value ) { 
    77             throw new Exception(self::__("Invalid value for $property. Value may not be empty.")); 
     77            throw new Exception(sprintf(__("Invalid value for %s. Value may not be empty.", 'wp-router'), $property)); 
    7878        } 
    7979        if ( in_array($property, array('query_vars', 'title_arguments', 'page_arguments', 'access_arguments')) && !is_array($value) ) { 
    80             throw new Exception(self::__("Invalid value for $property: $value. Value must be an array.")); 
     80            throw new Exception(sprintf(__('Invalid value for %1$s: %2$s. Value must be an array.'), $property, $value)); 
    8181        } 
    8282        if ( isset($this->$property) ) { 
     
    248248     */ 
    249249    protected function error_403() { 
    250         $message = apply_filters('wp_router_access_denied_message', self::__('You are not authorized to access this page')); 
    251         $title = apply_filters('wp_router_access_denied_title', self::__('Access Denied')); 
     250        $message = apply_filters('wp_router_access_denied_message', __('You are not authorized to access this page', 'wp-router')); 
     251        $title = apply_filters('wp_router_access_denied_title', __('Access Denied', 'wp-router')); 
    252252        $args = apply_filters('wp_router_access_denied_args', array( 'response' => 403 )); 
    253253        wp_die($message, $title, $args); 
  • wp-router/trunk/WP_Router_Page.class.php

    r567866 r567871  
    7676    private static function make_post() { 
    7777        $post = array( 
    78             'post_title' => self::__('WP Router Placeholder Page'), 
     78            'post_title' => __('WP Router Placeholder Page', 'wp-router'), 
    7979            'post_status' => 'publish', 
    8080            'post_type' => self::POST_TYPE, 
  • wp-router/trunk/WP_Router_Utility.class.php

    r391925 r567871  
    99    const QUERY_VAR = 'WP_Route'; 
    1010    const PLUGIN_NAME = 'WP Router'; 
    11     const TEXT_DOMAIN = 'wp-router'; 
    1211    const DEBUG = FALSE; 
    1312    const MIN_PHP_VERSION = '5.2'; 
     
    1514    const DB_VERSION = 1; 
    1615    const PLUGIN_INIT_HOOK = 'wp_router_init'; 
    17  
    18  
    19     /** 
    20      * A wrapper around WP's __() to add the plugin's text domain 
    21      * 
    22      * @param string $string 
    23      * @return string|void 
    24      */ 
    25     public static function __( $string ) { 
    26         return __($string, self::TEXT_DOMAIN); 
    27     } 
    28  
    29     /** 
    30      * A wrapper around WP's _e() to add the plugin's text domain 
    31      * 
    32      * @param string $string 
    33      * @return void 
    34      */ 
    35     public static function _e( $string ) { 
    36         _e($string, self::TEXT_DOMAIN); 
    37     } 
    3816 
    3917    /** 
     
    6947 
    7048    public static function failed_to_load_notices( $php_version = self::MIN_PHP_VERSION, $wp_version = self::MIN_WP_VERSION ) { 
    71         printf( '<div class="error"><p>%s</p></div>', sprintf( self::__( '%1$s requires WordPress %2$s or higher and PHP %3$s or higher.' ), self::PLUGIN_NAME, $wp_version, $php_version ) ); 
     49        printf( '<div class="error"><p>%s</p></div>', sprintf( __( '%1$s requires WordPress %2$s or higher and PHP %3$s or higher.', 'wp-router' ), self::PLUGIN_NAME, $wp_version, $php_version ) ); 
    7250    } 
    7351 
  • wp-router/trunk/readme.txt

    r393086 r567871  
    44Tags: URL mapping, callback functions 
    55Requires at least: 3.0 
    6 Tested up to: 3.1 
     6Tested up to: 3.4 
    77Stable tag: trunk 
    88 
  • wp-router/trunk/wp-router.php

    r567865 r567871  
    66Author: Adelie Design 
    77Author URI: http://www.adeliedesign.com/ 
    8 Version: 0.3.2 
     8Version: 0.3.3 
    99*/ 
    1010/* 
Note: See TracChangeset for help on using the changeset viewer.