WordPress.org

Plugin Directory

Changeset 606705


Ignore:
Timestamp:
10/01/12 19:59:44 (19 months ago)
Author:
husobj
Message:

Prepare for I18n.

Location:
password-protected/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • password-protected/trunk/admin/admin.php

    r606695 r606705  
    3737        add_settings_section( 
    3838            'password_protected', 
    39             __( 'Password Protected Settings', 'password_protected' ), 
     39            __( 'Password Protected Settings', 'password-protected' ), 
    4040            array( $this, 'password_protected_settings_section' ), 
    4141            $this->options_group 
     
    4343        add_settings_field( 
    4444            'password_protected_status', 
    45             __( 'Password Protected Status', 'password_protected' ), 
     45            __( 'Password Protected Status', 'password-protected' ), 
    4646            array( $this, 'password_protected_status_field' ), 
    4747            $this->options_group, 
     
    5050        add_settings_field( 
    5151            'password_protected_password', 
    52             __( 'New Password', 'password_protected' ), 
     52            __( 'New Password', 'password-protected' ), 
    5353            array( $this, 'password_protected_password_field' ), 
    5454            $this->options_group, 
     
    6969                return $old_val; 
    7070            } elseif ( empty( $val['confirm'] ) ) { 
    71                 add_settings_error( 'password_protected_password', 'password_protected_password', __( 'New password not saved. When setting a new password please enter it in both fields.', 'password_protected' ) ); 
     71                add_settings_error( 'password_protected_password', 'password_protected_password', __( 'New password not saved. When setting a new password please enter it in both fields.', 'password-protected' ) ); 
    7272                return $old_val; 
    7373            } elseif ( $val['new'] != $val['confirm'] ) { 
    74                 add_settings_error( 'password_protected_password', 'password_protected_password', __( 'New password not saved. Password fields did not match.', 'password_protected' ) ); 
     74                add_settings_error( 'password_protected_password', 'password_protected_password', __( 'New password not saved. Password fields did not match.', 'password-protected' ) ); 
    7575                return $old_val; 
    7676            } elseif ( $val['new'] == $val['confirm'] ) { 
    77                 add_settings_error( 'password_protected_password', 'password_protected_password', __( 'New password saved.', 'password_protected' ), 'updated' ); 
     77                add_settings_error( 'password_protected_password', 'password_protected_password', __( 'New password saved.', 'password-protected' ), 'updated' ); 
    7878                return $val['new']; 
    7979            } 
     
    8787     */ 
    8888    function password_protected_settings_section() { 
    89         echo '<p>' . __( 'Password protect your web site. Users will be asked to enter a password to view the site.', 'password_protected' ) . '</p>'; 
     89        echo '<p>' . __( 'Password protect your web site. Users will be asked to enter a password to view the site.', 'password-protected' ) . '</p>'; 
    9090    } 
    9191     
     
    9494     */ 
    9595    function password_protected_status_field() { 
    96         echo '<input name="password_protected_status" id="password_protected_status" type="checkbox" value="1" ' . checked( 1, get_option( 'password_protected_status' ), false ) . ' /> ' . __( 'Enabled', 'password_protected' ); 
    97         echo '<input name="password_protected_feeds" id="password_protected_feeds" type="checkbox" value="1" ' . checked( 1, get_option( 'password_protected_feeds' ), false ) . ' style="margin-left: 20px;" /> ' . __( 'Allow Feeds', 'password_protected' ); 
     96        echo '<input name="password_protected_status" id="password_protected_status" type="checkbox" value="1" ' . checked( 1, get_option( 'password_protected_status' ), false ) . ' /> ' . __( 'Enabled', 'password-protected' ); 
     97        echo '<input name="password_protected_feeds" id="password_protected_feeds" type="checkbox" value="1" ' . checked( 1, get_option( 'password_protected_feeds' ), false ) . ' style="margin-left: 20px;" /> ' . __( 'Allow Feeds', 'password-protected' ); 
    9898    } 
    9999     
     
    102102     */ 
    103103    function password_protected_password_field() { 
    104         echo '<input type="password" name="password_protected_password[new]" id="password_protected_password_new" size="16" value="" autocomplete="off"> <span class="description">' . __( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'password_protected' ) . '</span><br> 
    105             <input type="password" name="password_protected_password[confirm]" id="password_protected_password_confirm" size="16" value="" autocomplete="off"> <span class="description">' . __( 'Type your new password again.', 'password_protected' ) . '</span>'; 
    106     } 
    107      
    108     /** 
    109      * Allow Feeds Field 
    110      */ 
    111     function password_protected_feeds_field() { 
    112         echo '<input name="password_protected_feeds" id="password_protected_feeds" type="checkbox" value="1" ' . checked( 1, get_option( 'password_protected_feeds' ), false ) . ' /> ' . __( 'Allow Feeds', 'password_protected' ); 
     104        echo '<input type="password" name="password_protected_password[new]" id="password_protected_password_new" size="16" value="" autocomplete="off"> <span class="description">' . __( 'If you would like to change the password type a new one. Otherwise leave this blank.', 'password-protected' ) . '</span><br> 
     105            <input type="password" name="password_protected_password[confirm]" id="password_protected_password_confirm" size="16" value="" autocomplete="off"> <span class="description">' . __( 'Type your new password again.', 'password-protected' ) . '</span>'; 
    113106    } 
    114107     
     
    141134            $pwd = get_option( 'password_protected_password' ); 
    142135            if ( (bool) $status && empty( $pwd ) ) { 
    143                 echo '<div class="error"><p>' . __( 'You have enabled password protection but not yet set a password. Please set one below.', 'password_protected' ) . '</p></div>'; 
     136                echo '<div class="error"><p>' . __( 'You have enabled password protection but not yet set a password. Please set one below.', 'password-protected' ) . '</p></div>'; 
    144137            } 
    145138        } 
  • password-protected/trunk/password-protected.php

    r606695 r606705  
    4747        $this->errors = new WP_Error(); 
    4848        register_activation_hook( __FILE__, array( &$this, 'install' ) ); 
     49        add_action( 'plugins_loaded', array( $this, 'load_plugin_textdomain' ) ); 
    4950        add_action( 'init', array( $this, 'maybe_process_login' ), 1 ); 
    5051        add_action( 'wp', array( $this, 'disable_feeds' ) ); 
     
    5859     
    5960    /** 
     61     * I18n 
     62     */ 
     63    function load_plugin_textdomain() { 
     64        load_plugin_textdomain( 'password-protected', false, basename( dirname( __FILE__ ) ) . '/languages' ); 
     65    } 
     66     
     67    /** 
    6068     * Is Active? 
    6169     */ 
     
    8694     */ 
    8795    function disable_feed() { 
    88         wp_die( sprintf( __( 'Feeds are not available for this site. Please visit the <a href="%s">website</a>.', 'password_protected' ), get_bloginfo( 'url' ) ) ); 
     96        wp_die( sprintf( __( 'Feeds are not available for this site. Please visit the <a href="%s">website</a>.', 'password-protected' ), get_bloginfo( 'url' ) ) ); 
    8997    } 
    9098     
     
    115123                // ... otherwise incorrect password 
    116124                $this->clear_auth_cookie(); 
    117                 $this->errors->add( 'incorrect_password', 'Incorrect Password' ); 
     125                $this->errors->add( 'incorrect_password', __( 'Incorrect Password', 'password-protected' ) ); 
    118126            } 
    119127        } 
  • password-protected/trunk/theme/login.php

    r606704 r606705  
    3838// If cookies are disabled we can't log in even with a valid password. 
    3939if ( isset( $_POST['testcookie'] ) && empty( $_COOKIE[TEST_COOKIE] ) ) 
    40     $Password_Protected->errors->add( 'test_cookie', __( "<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress." ) ); 
     40    $Password_Protected->errors->add( 'test_cookie', __( "<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.", 'password-protected' ) ); 
    4141 
    4242// Shake it! 
     
    112112    <form name="loginform" id="loginform" action="<?php echo esc_url( home_url( '/' ) ); ?>" method="post"> 
    113113        <p> 
    114             <label for="password_protected_pass"><?php _e( 'Password' ) ?><br /> 
     114            <label for="password_protected_pass"><?php _e( 'Password', 'password-protected' ) ?><br /> 
    115115            <input type="password" name="password_protected_pwd" id="password_protected_pass" class="input" value="" size="20" tabindex="20" /></label> 
    116116        </p> 
    117117        <!-- 
    118         <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( ! empty( $_POST['rememberme'] ) ); ?> /> <?php esc_attr_e( 'Remember Me' ); ?></label></p> 
     118        <p class="forgetmenot"><label for="rememberme"><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( ! empty( $_POST['rememberme'] ) ); ?> /> <?php esc_attr_e( 'Remember Me', 'password-protected' ); ?></label></p> 
    119119        --> 
    120120        <p class="submit"> 
    121             <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e( 'Log In' ); ?>" tabindex="100" /> 
     121            <input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e( 'Log In', 'password-protected' ); ?>" tabindex="100" /> 
    122122            <input type="hidden" name="testcookie" value="1" /> 
    123123            <input type="hidden" name="password-protected" value="login" /> 
Note: See TracChangeset for help on using the changeset viewer.