Ticket #11838: 11838.crazy.translations.diff
| File 11838.crazy.translations.diff, 12.8 KB (added by , 16 years ago) |
|---|
-
wp-admin/edit-tag-form.php
10 10 if ( !defined('ABSPATH') ) 11 11 die('-1'); 12 12 13 if ( !current_user_can('manage_categories') )14 wp_die(__('You do not have sufficient permissions to edit tags for this blog.'));15 16 13 if ( 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 printf( _x('A %s was not selected for editing.', '%s: singular taxonomy name'), $tax->singular_label); ?></strong></p></div> 18 15 <?php 19 16 return; 20 17 } … … 23 20 do_action('edit_category_form_pre', $tag ); 24 21 else 25 22 do_action('edit_tag_form_pre', $tag); 26 do_action('edit_' . $taxonomy . '_form_pre', $tag, $taxonomy); ?>23 do_action('edit_' . $taxonomy . '_form_pre', $tag, $taxonomy); ?> 27 24 28 25 <div class="wrap"> 29 26 <?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> 31 28 <div id="ajax-response"></div> 32 29 <form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate"> 33 30 <input type="hidden" name="action" value="editedtag" /> … … 36 33 <?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?> 37 34 <table class="form-table"> 38 35 <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> 41 39 </tr> 42 40 <?php if ( !is_multisite() ) { ?> 43 41 <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> 45 43 <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" /> 46 44 <p class="description"><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td> 47 45 </tr> 48 46 <?php } ?> 49 <?php if ( is_taxonomy_hierarchical($taxonomy) ) {?>47 <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> 50 48 <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> 52 50 <td> 53 51 <?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 ) : ?> 54 53 <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; ?> 55 55 </td> 56 56 </tr> 57 <?php }?>57 <?php endif; // is_taxonomy_hierarchical() ?> 58 58 <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> 60 60 <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br /> 61 61 <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td> 62 62 </tr> … … 68 68 do_action('edit_' . $taxonomy . '_form_fields', $tag, $taxonomy); 69 69 ?> 70 70 </table> 71 <p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php e sc_attr_e('Update Tag'); ?>" /></p>72 <?php 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> 72 <?php 73 73 if ( 'category' == $taxonomy ) 74 74 do_action('edit_category_form_', $tag); 75 75 else -
wp-admin/edit-tags.php
150 150 151 151 require_once ('admin-header.php'); 152 152 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] = sprintf(_x('%s added.', '%s: singular taxonomy name'), $tax->singular_label); 154 $messages[2] = sprintf(_x('%s deleted.', '%s: singular taxonomy name'), $tax->singular_label); 155 $messages[3] = sprintf(_x('%s updated.', '%s: singular taxonomy name'), $tax->singular_label); 156 $messages[4] = sprintf(_x('%s not added.', '%s: singular taxonomy name'), $tax->singular_label); 157 $messages[5] = sprintf(_x('%s not updated.', '%s: singular taxonomy name'), $tax->singular_label); 158 $messages[6] = sprintf(_x('%s deleted.', '%s: plural taxonomy name'), $tax->label); 159 159 160 ?> 161 160 162 <div class="wrap nosubsub"> 161 163 <?php screen_icon(); ?> 162 164 <h2><?php echo esc_html( $title ); … … 174 176 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 175 177 <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" /> 176 178 <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> 178 180 <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" /> 179 <input type="submit" value="<?php e sc_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" /> 180 182 </p> 181 183 </form> 182 184 <br class="clear" /> … … 234 236 </div> 235 237 236 238 <div class="clear"></div> 237 239 <?php $table_type = 'category' == $taxonomy ? 'categories' : 'edit-tags'; ?> 238 240 <table class="widefat tag fixed" cellspacing="0"> 239 241 <thead> 240 242 <tr> 241 <?php print_column_headers( 'edit-tags'); ?>243 <?php print_column_headers($table_type); ?> 242 244 </tr> 243 245 </thead> 244 246 245 247 <tfoot> 246 248 <tr> 247 <?php print_column_headers( 'edit-tags', false); ?>249 <?php print_column_headers($table_type, false); ?> 248 250 </tr> 249 251 </tfoot> 250 252 … … 272 274 273 275 <br class="clear" /> 274 276 </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 275 286 </div> 276 287 </div><!-- /col-right --> 277 288 … … 279 290 <div class="col-wrap"> 280 291 281 292 <div class="tagcloud"> 282 <h3><?php _e('Popular Tags'); ?></h3>293 <h3><?php printf(_x('Popular %s', '%s: plural taxonomy name'), $tax->label); ?></h3> 283 294 <?php 284 295 if ( current_user_can($tax->edit_cap) ) 285 296 wp_tag_cloud(array('taxonomy' => $taxonomy, 'link' => 'edit')); … … 288 299 ?> 289 300 </div> 290 301 291 <?php if ( current_user_can($tax->edit_cap) ) { 302 <?php 303 if ( current_user_can($tax->edit_cap) ) { 292 304 if ( 'category' == $taxonomy ) 293 305 do_action('add_category_form_pre', (object)array('parent' => 0) ); 294 306 else … … 297 309 ?> 298 310 299 311 <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> 301 313 <form id="addtag" method="post" action="edit-tags.php" class="validate"> 302 314 <input type="hidden" name="action" value="add-tag" /> 303 315 <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" /> 304 316 <?php wp_nonce_field('add-tag'); ?> 305 317 306 318 <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> 308 320 <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" /> 309 <p><?php _e('The name is how the tagappears on your site.'); ?></p>321 <p><?php _e('The name is how it appears on your site.'); ?></p> 310 322 </div> 311 <?php if ( !is_multisite() ) {?>323 <?php if ( !is_multisite() ) : ?> 312 324 <div class="form-field"> 313 <label for="slug"><?php _e('Tag slug')?></label>325 <label for="slug"><?php echo _x('Slug', 'Taxonomy Slug'); ?></label> 314 326 <input name="slug" id="slug" type="text" value="" size="40" /> 315 327 <p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p> 316 328 </div> 317 <?php }?>318 <?php if ( is_taxonomy_hierarchical($taxonomy) ) {?>329 <?php endif; // is_multisite() ?> 330 <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> 319 331 <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> 321 333 <?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> 334 <?php if ( 'category' == $taxonomy ) : ?> 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; ?> 323 337 </div> 324 <?php }?>338 <?php endif; // is_taxonomy_hierarchical() ?> 325 339 <div class="form-field"> 326 <label for="description"><?php _e('Description')?></label>340 <label for="description"><?php echo _x('Description', 'Taxonomy Description'); ?></label> 327 341 <textarea name="description" id="description" rows="5" cols="40"></textarea> 328 342 <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p> 329 343 </div> 330 331 <?php 344 <?php 332 345 if ( 'category' == $taxonomy ) 333 346 do_action('add_category_form_fields'); 334 347 else 335 348 do_action('add_tag_form_fields', $taxonomy); 336 349 do_action('add_' . $taxonomy . '_form_fields', $taxonomy); 337 350 ?> 338 339 <p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p> 351 <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> 340 352 <?php 341 353 if ( 'category' == $taxonomy ) 342 354 do_action('edit_category_form', (object)array('parent' => 0) ); … … 361 373 362 374 include('admin-footer.php'); 363 375 364 ?> 376 ?> 377 No newline at end of file -
wp-includes/taxonomy.php
18 18 register_taxonomy( 'category', 'post', array( 'hierarchical' => true, 19 19 'update_count_callback' => '_update_post_term_count', 20 20 'label' => __('Categories'), 21 'singular_label' => __('Category'), 21 22 'query_var' => false, 22 23 'rewrite' => false 23 24 ) ) ; … … 26 27 'hierarchical' => false, 27 28 'update_count_callback' => '_update_post_term_count', 28 29 'label' => __('Post Tags'), 30 'singular_label' => __('Post Tag'), //For the record, I'd prefer this to be changed to "Tags" and "Tag" 29 31 'query_var' => false, 30 32 'rewrite' => false 31 33 ) ) ; … … 212 214 if ( empty($args[$cap]) ) 213 215 $args[$cap] = 'manage_categories'; 214 216 } 217 218 if ( empty($args['singular_label']) ) 219 $args['singular_label'] = $args['label']; 215 220 216 221 $args['name'] = $taxonomy; 217 222 $args['object_type'] = (array) $object_type;