WordPress.org

Plugin Directory

Changeset 1603696


Ignore:
Timestamp:
02/26/17 02:46:28 (3 months ago)
Author:
celloexpressions
Message:

List Custom Taxonomy Widget: basic internationalization fixes - make all text strings translatable, add missing text domains. Add a filter for the dropdown-submit button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • list-custom-taxonomy-widget/trunk/list-custom-taxonomy-widget.php

    r1392576 r1603696  
    99 * Tags: custom taxonomy, custom tax, widget, sidebar, category, categories, taxonomy, custom category, custom categories, post types, custom post types, custom post type categories 
    1010 * License: GPL 
     11 * Text Domain: list-custom-taxonomy-widget 
    1112  
    1213===================================================================================== 
    13 Copyright (C) 2016 Nick Halsey 
     14Copyright (C) 2017 Nick Halsey 
    1415 
    1516This program is free software; you can redistribute it and/or 
     
    3637    /** constructor */ 
    3738    function __construct() { 
    38         parent::__construct( 'lc_taxonomy', $name = 'List Custom Taxonomy', array( 
     39        parent::__construct( 'lc_taxonomy', $name = __( 'List Custom Taxonomy', 'list-custom-taxonomy-widget' ), array( 
    3940            'customize_selective_refresh' => true, 
    4041        ) ); 
     
    131132            echo '<form action="'. get_bloginfo('url'). '" method="get">'; 
    132133            wp_dropdown_categories($args); 
    133             echo '<input type="submit" value="go &raquo;" /></form>'; 
     134            $dropdown_submit_text = apply_filters( 'list_custom_taxonomy_widget_dropdown_submit_text', __( 'go &raquo;', 'list-custom-taxonomy-widget' ) ); 
     135            echo '<input type="submit" value"' . esc_attr( $dropdown_submit_text ) . '" /></form>'; 
    134136        } 
    135137        else { 
     
    151153                    'hierarchical'       => $hierarchical, 
    152154                    'title_li'           => '', 
    153                     'show_option_none'   => 'No Categories', 
     155                    'show_option_none'   => __( 'No Categories', 'list-custom-taxonomy-widget' ), 
    154156                    'number'             => null, 
    155157                    'echo'               => 1, 
     
    243245        // The widget form ?> 
    244246            <p> 
    245                 <label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __( 'Title:' ); ?></label> 
     247                <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'list-custom-taxonomy-widget' ); ?></label> 
    246248                <input id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" class="widefat" /> 
    247249            </p> 
    248250            <p> 
    249                 <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php echo __( 'Select Taxonomy:' ); ?></label> 
     251                <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e( 'Select Taxonomy:', 'list-custom-taxonomy-widget' ); ?></label> 
    250252                <select name="<?php echo $this->get_field_name('taxonomy'); ?>" id="<?php echo $this->get_field_id('taxonomy'); ?>" class="widefat" style="height: auto;" size="4"> 
    251253            <?php  
     
    265267            </select> 
    266268            </p> 
    267             <h4 class="lctw-expand-options"><a href="javascript:void(0)" onclick="lctwExpand('<?php echo $this->get_field_id('expandoptions'); ?>')" >More Options...</a></h4> 
     269            <h4 class="lctw-expand-options"><a href="javascript:void(0)" onclick="lctwExpand('<?php echo $this->get_field_id('expandoptions'); ?>')" ><?php _e( 'More Options&hellip;', 'list-custom-taxonomy-widget' ); ?></a></h4> 
    268270            <div class="lctw-all-options"> 
    269                 <h4 class="lctw-contract-options"><a href="javascript:void(0)" onclick="lctwContract('<?php echo $this->get_field_id('expandoptions'); ?>')" >Hide Extended Options</a></h4> 
     271                <h4 class="lctw-contract-options"><a href="javascript:void(0)" onclick="lctwContract('<?php echo $this->get_field_id('expandoptions'); ?>')" ><?php _e( 'Hide Extended Options', 'list-custom-taxonomy-widget' ); ?></a></h4> 
    270272                <input type="hidden" value="<?php echo $expandoptions; ?>" id="<?php echo $this->get_field_id('expandoptions'); ?>" name="<?php echo $this->get_field_name('expandoptions'); ?>" /> 
    271273                 
    272274                <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>"<?php checked( $showcount ); ?> /> 
    273                 <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show Post Counts' ); ?></label><br /> 
     275                <label for="<?php echo $this->get_field_id('count'); ?>"><?php _e( 'Show Post Counts', 'list-custom-taxonomy-widget' ); ?></label><br /> 
    274276                <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('hierarchical'); ?>" name="<?php echo $this->get_field_name('hierarchical'); ?>"<?php checked( $hierarchical ); ?> /> 
    275                 <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show Hierarchy' ); ?></label><br/> 
     277                <label for="<?php echo $this->get_field_id('hierarchical'); ?>"><?php _e( 'Show Hierarchy', 'list-custom-taxonomy-widget' ); ?></label><br/> 
    276278                <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('empty'); ?>" name="<?php echo $this->get_field_name('empty'); ?>"<?php checked( $empty ); ?> /> 
    277                 <label for="<?php echo $this->get_field_id('empty'); ?>"><?php _e( 'Show Empty Terms' ); ?></label></p> 
     279                <label for="<?php echo $this->get_field_id('empty'); ?>"><?php _e( 'Show Empty Terms', 'list-custom-taxonomy-widget' ); ?></label></p> 
    278280                 
    279281                <p> 
    280                     <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php echo __( 'Order By:' ); ?></label> 
     282                    <label for="<?php echo $this->get_field_id('orderby'); ?>"><?php _e( 'Order By:', 'list-custom-taxonomy-widget' ); ?></label> 
    281283                    <select name="<?php echo $this->get_field_name('orderby'); ?>" id="<?php echo $this->get_field_id('orderby'); ?>" class="widefat" > 
    282284                        <option value="ID" <?php if( $orderby == 'ID' ) { echo 'selected="selected"'; } ?>>ID</option> 
     
    300302                </p> 
    301303                <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> /> 
    302                 <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as Dropdown' ); ?></label></p> 
     304                <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e( 'Display as Dropdown', 'list-custom-taxonomy-widget' ); ?></label></p> 
    303305            </div> 
    304306<?php  
Note: See TracChangeset for help on using the changeset viewer.