Plugin Directory

Changeset 884221


Ignore:
Timestamp:
03/29/2014 03:44:25 PM (12 years ago)
Author:
maor
Message:

Added translation support, POT in place

File:
1 edited

Legend:

Unmodified
Added
Removed
  • optimized-dropdown-menus/trunk/optimized-dm.php

    r638382 r884221  
    77Author URI: http://maorchasen.com
    88Version: 1.1
     9Text Domain: optimized_dd
    910Tags: widget-only, widget, seo
    1011License: GPL2
     
    4950        // If no menus exists, direct the user to go and create some.
    5051        if ( !$menus ) {
    51             echo '<p>'. sprintf( __('No menus have been created yet. <a href="%s">Create some</a>.'), admin_url('nav-menus.php') ) .'</p>';
     52            echo '<p>'. sprintf( __('No menus have been created yet. <a href="%s">Create some</a>.', 'optimized_dd' ), admin_url('nav-menus.php') ) .'</p>';
    5253            return;
    5354        }
    5455    ?>
    5556        <p>
    56             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label>
     57            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'optimized_dd') ?></label>
    5758            <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo esc_attr( $title ); ?>" />
    5859        </p>
    5960        <p>
    60             <label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:'); ?></label>
     61            <label for="<?php echo $this->get_field_id('nav_menu'); ?>"><?php _e('Select Menu:', 'optimized_dd'); ?></label>
    6162            <select id="<?php echo $this->get_field_id('nav_menu'); ?>" name="<?php echo $this->get_field_name('nav_menu'); ?>">
    6263    <?php
     
    7374        <p>
    7475            <input class="checkbox" type="checkbox" <?php echo ($html5 == 'on') ? 'checked="checked"' : ''; ?> id="<?php echo $this->get_field_id( 'html5' ); ?>" name="<?php echo $this->get_field_name( 'html5' ); ?>" />
    75             <label for="<?php echo $this->get_field_id( 'html5' ); ?>">&nbsp;Use HTML5 <code>&lt;nav&gt;</code> element?</label>
     76            <label for="<?php echo $this->get_field_id( 'html5' ); ?>">&nbsp;<?php echo sprintf( _x( 'Use HTML5 %s element?', '<nav>', 'optimized_dd' ), '<code>&lt;nav&gt;</code>' ); ?></label>
    7677        </p>
    7778        <?php
     
    7980
    8081    function update( $new_instance, $old_instance ) {
    81        
    8282        $instance['title'] = $new_instance['title'];
    8383        $instance['nav_menu'] = (int) $new_instance['nav_menu'];
     
    125125        add_action( 'widgets_init', array( $this, 'load_widget' ) );
    126126        add_action( 'template_redirect', array( $this, 'setup_frontend_js' ) );
     127        // i18n
     128        add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
     129    }
     130
     131    function load_textdomain() {
     132        load_plugin_textdomain( 'optimized_dd', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
    127133    }
    128134
Note: See TracChangeset for help on using the changeset viewer.