WordPress.org

Make WordPress Core

Changeset 13077


Ignore:
Timestamp:
02/13/10 03:08:16 (5 years ago)
Author:
dd32
Message:

Introduce Custom Taxonomies Translation strings, Correctly identifies the taxonomy in the Strings of the edit pages. See #11838

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-tag-form.php

    r13035 r13077  
    1111    die('-1'); 
    1212 
    13 if ( !current_user_can('manage_categories') ) 
    14     wp_die(__('You do not have sufficient permissions to edit tags for this blog.')); 
    15  
    1613if ( empty($tag_ID) ) { ?> 
    17     <div id="message" class="updated"><p><strong><?php _e('A tag was not selected for editing.'); ?></strong></p></div> 
     14    <div id="message" class="updated"><p><strong><?php _e('A item was not selected for editing.'); ?></strong></p></div> 
    1815<?php 
    1916    return; 
     
    2825<div class="wrap"> 
    2926<?php screen_icon(); ?> 
    30 <h2><?php _e('Edit Tag'); ?></h2> 
     27<h2><?php printf(_x('Edit %s', '%s: singular taxonomy name'), $tax->singular_label); ?></h2> 
    3128<div id="ajax-response"></div> 
    3229<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"> 
     
    3734    <table class="form-table"> 
    3835        <tr class="form-field form-required"> 
    39             <th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th> 
    40             <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" /></td> 
     36            <th scope="row" valign="top"><label for="name"><?php echo _x('Name', 'Taxonomy Name'); ?></label></th> 
     37            <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" /> 
     38            <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td> 
    4139        </tr> 
    4240<?php if ( !is_multisite() ) { ?> 
    4341        <tr class="form-field"> 
    44             <th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th> 
     42            <th scope="row" valign="top"><label for="slug"><?php echo _x('Slug', 'Taxonomy Slug'); ?></label></th> 
    4543            <td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" /> 
    4644            <p class="description"><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td> 
    4745        </tr> 
    4846<?php } ?> 
    49 <?php if ( is_taxonomy_hierarchical($taxonomy) ) { ?> 
     47<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> 
    5048        <tr class="form-field"> 
    51             <th scope="row" valign="top"><label for="parent"><?php _e('Category Parent') ?></label></th> 
     49            <th scope="row" valign="top"><label for="parent"><?php echo _x('Parent', 'Taxonomy Parent'); ?></label></th> 
    5250            <td> 
    5351                <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'name' => 'parent', 'orderby' => 'name', 'taxonomy' => $taxonomy, 'selected' => $tag->parent, 'exclude' => $tag->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br /> 
     52                <?php if ( 'category' == $taxonomy ) : ?> 
    5453                <span class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></span> 
     54                <?php endif; ?> 
    5555            </td> 
    5656        </tr> 
    57 <?php } ?> 
     57<?php endif; // is_taxonomy_hierarchical() ?> 
    5858        <tr class="form-field"> 
    59             <th scope="row" valign="top"><label for="description"><?php _e('Description') ?></label></th> 
     59            <th scope="row" valign="top"><label for="description"><?php echo _x('Description', 'Taxonomy Description'); ?></label></th> 
    6060            <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br /> 
    6161            <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td> 
     
    6969        ?> 
    7070    </table> 
    71 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p> 
     71<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr( sprintf(_x('Update %s', '%s: singular taxonomy name'), $tax->singular_label)); ?>" /></p> 
    7272<?php 
    7373if ( 'category' == $taxonomy ) 
  • trunk/wp-admin/edit-tags.php

    r13046 r13077  
    151151require_once ('admin-header.php'); 
    152152 
    153 $messages[1] = __('Tag added.'); 
    154 $messages[2] = __('Tag deleted.'); 
    155 $messages[3] = __('Tag updated.'); 
    156 $messages[4] = __('Tag not added.'); 
    157 $messages[5] = __('Tag not updated.'); 
    158 $messages[6] = __('Tags deleted.'); ?> 
     153$messages[1] = __('Item added.'); 
     154$messages[2] = __('Item deleted.'); 
     155$messages[3] = __('Item updated.'); 
     156$messages[4] = __('Item not added.'); 
     157$messages[5] = __('Item not updated.'); 
     158$messages[6] = __('Items deleted.'); 
     159 
     160?> 
    159161 
    160162<div class="wrap nosubsub"> 
     
    175177<input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 
    176178<p class="search-box"> 
    177     <label class="screen-reader-text" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label> 
     179    <label class="screen-reader-text" for="tag-search-input"><?php printf(_x('Search %s', '%s: plural taxonomy name'), $tax->label); ?>:</label> 
    178180    <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 
    179     <input type="submit" value="<?php esc_attr_e( 'Search Tags' ); ?>" class="button" /> 
     181    <input type="submit" value="<?php echo esc_attr( sprintf(_x('Search %s', '%s: plural taxonomy name'), $tax->label) ); ?>" class="button" /> 
    180182</p> 
    181183</form> 
     
    235237 
    236238<div class="clear"></div> 
    237  
     239<?php $table_type = ('category' == $taxonomy ? 'categories' : 'edit-tags'); ?> 
    238240<table class="widefat tag fixed" cellspacing="0"> 
    239241    <thead> 
    240242    <tr> 
    241 <?php print_column_headers('edit-tags'); ?> 
     243<?php print_column_headers($table_type); ?> 
    242244    </tr> 
    243245    </thead> 
     
    245247    <tfoot> 
    246248    <tr> 
    247 <?php print_column_headers('edit-tags', false); ?> 
     249<?php print_column_headers($table_type, false); ?> 
    248250    </tr> 
    249251    </tfoot> 
     
    273275<br class="clear" /> 
    274276</form> 
     277 
     278<?php if ( 'category' == $taxonomy ) : ?> 
     279<div class="form-wrap">  
     280<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>  
     281<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>  
     282</div>  
     283<?php endif; ?> 
     284 
     285 
    275286</div> 
    276287</div><!-- /col-right --> 
     
    280291 
    281292<div class="tagcloud"> 
    282 <h3><?php _e('Popular Tags'); ?></h3> 
     293<h3><?php printf(_x('Popular %s', '%s: plural taxonomy name'), $tax->label); ?></h3> 
    283294<?php 
    284295if ( current_user_can($tax->edit_cap) ) 
     
    289300</div> 
    290301 
    291 <?php if ( current_user_can($tax->edit_cap) ) { 
     302<?php 
     303if ( current_user_can($tax->edit_cap) ) { 
    292304    if ( 'category' == $taxonomy ) 
    293305        do_action('add_category_form_pre', (object)array('parent' => 0) );  // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form 
     
    298310 
    299311<div class="form-wrap"> 
    300 <h3><?php _e('Add a New Tag'); ?></h3> 
     312<h3><?php printf(_x('Add a New %s', '%s: singular taxonomy name'), $tax->singular_label); ?></h3> 
    301313<form id="addtag" method="post" action="edit-tags.php" class="validate"> 
    302314<input type="hidden" name="action" value="add-tag" /> 
     
    305317 
    306318<div class="form-field form-required"> 
    307     <label for="tag-name"><?php _e('Tag name') ?></label> 
     319    <label for="tag-name"><?php echo _x('Name', 'Taxonomy Name'); ?></label> 
    308320    <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" /> 
    309     <p><?php _e('The name is how the tag appears on your site.'); ?></p> 
    310 </div> 
    311 <?php if ( !is_multisite() ) { ?> 
     321    <p><?php _e('The name is how it appears on your site.'); ?></p> 
     322</div> 
     323<?php if ( !is_multisite() ) : ?> 
    312324<div class="form-field"> 
    313     <label for="slug"><?php _e('Tag slug') ?></label> 
     325    <label for="slug"><?php echo _x('Slug', 'Taxonomy Slug'); ?></label> 
    314326    <input name="slug" id="slug" type="text" value="" size="40" /> 
    315327    <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p> 
    316328</div> 
    317 <?php } ?> 
    318 <?php if ( is_taxonomy_hierarchical($taxonomy) ) { ?> 
     329<?php endif; // is_multisite() ?> 
     330<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> 
    319331<div class="form-field"> 
    320     <label for="category_parent"><?php _e('Category Parent') ?></label> 
     332    <label for="parent"><?php echo _x('Parent', 'Taxonomy Parent'); ?></label> 
    321333    <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'taxonomy' => $taxonomy, 'name' => 'parent', 'orderby' => 'name', 'hierarchical' => true, 'show_option_none' => __('None'))); ?> 
    322     <p><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p> 
    323 </div> 
    324 <?php } ?> 
     334    <?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?> 
     335        <p><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p> 
     336    <?php endif; ?> 
     337</div> 
     338<?php endif; // is_taxonomy_hierarchical() ?> 
    325339<div class="form-field"> 
    326     <label for="description"><?php _e('Description') ?></label> 
     340    <label for="description"><?php echo _x('Description', 'Taxonomy Description'); ?></label> 
    327341    <textarea name="description" id="description" rows="5" cols="40"></textarea> 
    328342    <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p> 
     
    334348do_action($taxonomy . '_add_form_fields', $taxonomy); 
    335349?> 
    336  
    337 <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p> 
     350<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php echo esc_attr(sprintf(_x('Add %s', '%s: singular  taxonomy name'), $tax->singular_label)); ?>" /></p> 
    338351<?php 
    339352if ( 'category' == $taxonomy ) 
Note: See TracChangeset for help on using the changeset viewer.