<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13077] trunk/wp-admin: Introduce Custom Taxonomies Translation strings,
Correctly identifies the taxonomy in the Strings of the edit pages.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13077">13077</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-02-13 03:08:16 +0000 (Sat, 13 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Introduce Custom Taxonomies Translation strings, Correctly identifies the taxonomy in the Strings of the edit pages. See <a href="http://trac.wordpress.org/ticket/11838">#11838</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminedittagformphp">trunk/wp-admin/edit-tag-form.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminedittagformphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tag-form.php (13076 => 13077)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tag-form.php        2010-02-13 02:54:54 UTC (rev 13076)
+++ trunk/wp-admin/edit-tag-form.php        2010-02-13 03:08:16 UTC (rev 13077)
</span><span class="lines">@@ -10,11 +10,8 @@
</span><span class="cx"> if ( !defined('ABSPATH') )
</span><span class="cx">         die('-1');
</span><span class="cx">
</span><del>-if ( !current_user_can('manage_categories') )
-        wp_die(__('You do not have sufficient permissions to edit tags for this blog.'));
-
</del><span class="cx"> if ( empty($tag_ID) ) { ?>
</span><del>-        <div id="message" class="updated"><p><strong><?php _e('A tag was not selected for editing.'); ?></strong></p></div>
</del><ins>+        <div id="message" class="updated"><p><strong><?php _e('A item was not selected for editing.'); ?></strong></p></div>
</ins><span class="cx"> <?php
</span><span class="cx">         return;
</span><span class="cx"> }
</span><span class="lines">@@ -27,7 +24,7 @@
</span><span class="cx">
</span><span class="cx"> <div class="wrap">
</span><span class="cx"> <?php screen_icon(); ?>
</span><del>-<h2><?php _e('Edit Tag'); ?></h2>
</del><ins>+<h2><?php printf(_x('Edit %s', '%s: singular taxonomy name'), $tax->singular_label); ?></h2>
</ins><span class="cx"> <div id="ajax-response"></div>
</span><span class="cx"> <form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate">
</span><span class="cx"> <input type="hidden" name="action" value="editedtag" />
</span><span class="lines">@@ -36,27 +33,30 @@
</span><span class="cx"> <?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?>
</span><span class="cx">         <table class="form-table">
</span><span class="cx">                 <tr class="form-field form-required">
</span><del>-                        <th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
-                        <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>
</del><ins>+                        <th scope="row" valign="top"><label for="name"><?php echo _x('Name', 'Taxonomy Name'); ?></label></th>
+                        <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
+                        <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td>
</ins><span class="cx">                 </tr>
</span><span class="cx"> <?php if ( !is_multisite() ) { ?>
</span><span class="cx">                 <tr class="form-field">
</span><del>-                        <th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
</del><ins>+                        <th scope="row" valign="top"><label for="slug"><?php echo _x('Slug', 'Taxonomy Slug'); ?></label></th>
</ins><span class="cx">                         <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" />
</span><span class="cx">                         <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>
</span><span class="cx">                 </tr>
</span><span class="cx"> <?php } ?>
</span><del>-<?php if ( is_taxonomy_hierarchical($taxonomy) ) { ?>
</del><ins>+<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
</ins><span class="cx">                 <tr class="form-field">
</span><del>-                        <th scope="row" valign="top"><label for="parent"><?php _e('Category Parent') ?></label></th>
</del><ins>+                        <th scope="row" valign="top"><label for="parent"><?php echo _x('Parent', 'Taxonomy Parent'); ?></label></th>
</ins><span class="cx">                         <td>
</span><span class="cx">                                 <?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 />
</span><ins>+                                <?php if ( 'category' == $taxonomy ) : ?>
</ins><span class="cx">                                 <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>
</span><ins>+                                <?php endif; ?>
</ins><span class="cx">                         </td>
</span><span class="cx">                 </tr>
</span><del>-<?php } ?>
</del><ins>+<?php endif; // is_taxonomy_hierarchical() ?>
</ins><span class="cx">                 <tr class="form-field">
</span><del>-                        <th scope="row" valign="top"><label for="description"><?php _e('Description') ?></label></th>
</del><ins>+                        <th scope="row" valign="top"><label for="description"><?php echo _x('Description', 'Taxonomy Description'); ?></label></th>
</ins><span class="cx">                         <td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br />
</span><span class="cx">                         <span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
</span><span class="cx">                 </tr>
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">                 do_action($taxonomy . '_edit_form_fields', $tag, $taxonomy);
</span><span class="cx">                 ?>
</span><span class="cx">         </table>
</span><del>-<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p>
</del><ins>+<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>
</ins><span class="cx"> <?php
</span><span class="cx"> if ( 'category' == $taxonomy )
</span><span class="cx">         do_action('edit_category_form', $tag);
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (13076 => 13077)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-02-13 02:54:54 UTC (rev 13076)
+++ trunk/wp-admin/edit-tags.php        2010-02-13 03:08:16 UTC (rev 13077)
</span><span class="lines">@@ -150,13 +150,15 @@
</span><span class="cx">
</span><span class="cx"> require_once ('admin-header.php');
</span><span class="cx">
</span><del>-$messages[1] = __('Tag added.');
-$messages[2] = __('Tag deleted.');
-$messages[3] = __('Tag updated.');
-$messages[4] = __('Tag not added.');
-$messages[5] = __('Tag not updated.');
-$messages[6] = __('Tags deleted.'); ?>
</del><ins>+$messages[1] = __('Item added.');
+$messages[2] = __('Item deleted.');
+$messages[3] = __('Item updated.');
+$messages[4] = __('Item not added.');
+$messages[5] = __('Item not updated.');
+$messages[6] = __('Items deleted.');
</ins><span class="cx">
</span><ins>+?>
+
</ins><span class="cx"> <div class="wrap nosubsub">
</span><span class="cx"> <?php screen_icon(); ?>
</span><span class="cx"> <h2><?php echo esc_html( $title );
</span><span class="lines">@@ -174,9 +176,9 @@
</span><span class="cx"> <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
</span><span class="cx"> <input type="hidden" name="post_type" value="<?php echo esc_attr($post_type); ?>" />
</span><span class="cx"> <p class="search-box">
</span><del>-        <label class="screen-reader-text" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label>
</del><ins>+        <label class="screen-reader-text" for="tag-search-input"><?php printf(_x('Search %s', '%s: plural taxonomy name'), $tax->label); ?>:</label>
</ins><span class="cx">         <input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />
</span><del>-        <input type="submit" value="<?php esc_attr_e( 'Search Tags' ); ?>" class="button" />
</del><ins>+        <input type="submit" value="<?php echo esc_attr( sprintf(_x('Search %s', '%s: plural taxonomy name'), $tax->label) ); ?>" class="button" />
</ins><span class="cx"> </p>
</span><span class="cx"> </form>
</span><span class="cx"> <br class="clear" />
</span><span class="lines">@@ -234,17 +236,17 @@
</span><span class="cx"> </div>
</span><span class="cx">
</span><span class="cx"> <div class="clear"></div>
</span><del>-
</del><ins>+<?php $table_type = ('category' == $taxonomy ? 'categories' : 'edit-tags'); ?>
</ins><span class="cx"> <table class="widefat tag fixed" cellspacing="0">
</span><span class="cx">         <thead>
</span><span class="cx">         <tr>
</span><del>-<?php print_column_headers('edit-tags'); ?>
</del><ins>+<?php print_column_headers($table_type); ?>
</ins><span class="cx">         </tr>
</span><span class="cx">         </thead>
</span><span class="cx">
</span><span class="cx">         <tfoot>
</span><span class="cx">         <tr>
</span><del>-<?php print_column_headers('edit-tags', false); ?>
</del><ins>+<?php print_column_headers($table_type, false); ?>
</ins><span class="cx">         </tr>
</span><span class="cx">         </tfoot>
</span><span class="cx">
</span><span class="lines">@@ -272,6 +274,15 @@
</span><span class="cx">
</span><span class="cx"> <br class="clear" />
</span><span class="cx"> </form>
</span><ins>+
+<?php if ( 'category' == $taxonomy ) : ?>
+<div class="form-wrap">
+<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>
+<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>
+</div>
+<?php endif; ?>
+
+
</ins><span class="cx"> </div>
</span><span class="cx"> </div><!-- /col-right -->
</span><span class="cx">
</span><span class="lines">@@ -279,7 +290,7 @@
</span><span class="cx"> <div class="col-wrap">
</span><span class="cx">
</span><span class="cx"> <div class="tagcloud">
</span><del>-<h3><?php _e('Popular Tags'); ?></h3>
</del><ins>+<h3><?php printf(_x('Popular %s', '%s: plural taxonomy name'), $tax->label); ?></h3>
</ins><span class="cx"> <?php
</span><span class="cx"> if ( current_user_can($tax->edit_cap) )
</span><span class="cx">         wp_tag_cloud(array('taxonomy' => $taxonomy, 'link' => 'edit'));
</span><span class="lines">@@ -288,7 +299,8 @@
</span><span class="cx"> ?>
</span><span class="cx"> </div>
</span><span class="cx">
</span><del>-<?php if ( current_user_can($tax->edit_cap) ) {
</del><ins>+<?php
+if ( current_user_can($tax->edit_cap) ) {
</ins><span class="cx">         if ( 'category' == $taxonomy )
</span><span class="cx">                 do_action('add_category_form_pre', (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_pre_add_form
</span><span class="cx">         else
</span><span class="lines">@@ -297,33 +309,35 @@
</span><span class="cx"> ?>
</span><span class="cx">
</span><span class="cx"> <div class="form-wrap">
</span><del>-<h3><?php _e('Add a New Tag'); ?></h3>
</del><ins>+<h3><?php printf(_x('Add a New %s', '%s: singular taxonomy name'), $tax->singular_label); ?></h3>
</ins><span class="cx"> <form id="addtag" method="post" action="edit-tags.php" class="validate">
</span><span class="cx"> <input type="hidden" name="action" value="add-tag" />
</span><span class="cx"> <input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
</span><span class="cx"> <?php wp_nonce_field('add-tag'); ?>
</span><span class="cx">
</span><span class="cx"> <div class="form-field form-required">
</span><del>-        <label for="tag-name"><?php _e('Tag name') ?></label>
</del><ins>+        <label for="tag-name"><?php echo _x('Name', 'Taxonomy Name'); ?></label>
</ins><span class="cx">         <input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
</span><del>-        <p><?php _e('The name is how the tag appears on your site.'); ?></p>
</del><ins>+        <p><?php _e('The name is how it appears on your site.'); ?></p>
</ins><span class="cx"> </div>
</span><del>-<?php if ( !is_multisite() ) { ?>
</del><ins>+<?php if ( !is_multisite() ) : ?>
</ins><span class="cx"> <div class="form-field">
</span><del>-        <label for="slug"><?php _e('Tag slug') ?></label>
</del><ins>+        <label for="slug"><?php echo _x('Slug', 'Taxonomy Slug'); ?></label>
</ins><span class="cx">         <input name="slug" id="slug" type="text" value="" size="40" />
</span><span class="cx">         <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>
</span><span class="cx"> </div>
</span><del>-<?php } ?>
-<?php if ( is_taxonomy_hierarchical($taxonomy) ) { ?>
</del><ins>+<?php endif; // is_multisite() ?>
+<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
</ins><span class="cx"> <div class="form-field">
</span><del>-        <label for="category_parent"><?php _e('Category Parent') ?></label>
</del><ins>+        <label for="parent"><?php echo _x('Parent', 'Taxonomy Parent'); ?></label>
</ins><span class="cx">         <?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'taxonomy' => $taxonomy, 'name' => 'parent', 'orderby' => 'name', 'hierarchical' => true, 'show_option_none' => __('None'))); ?>
</span><del>-        <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>
</del><ins>+        <?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?>
+                <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>
+        <?php endif; ?>
</ins><span class="cx"> </div>
</span><del>-<?php } ?>
</del><ins>+<?php endif; // is_taxonomy_hierarchical() ?>
</ins><span class="cx"> <div class="form-field">
</span><del>-        <label for="description"><?php _e('Description') ?></label>
</del><ins>+        <label for="description"><?php echo _x('Description', 'Taxonomy Description'); ?></label>
</ins><span class="cx">         <textarea name="description" id="description" rows="5" cols="40"></textarea>
</span><span class="cx">         <p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
</span><span class="cx"> </div>
</span><span class="lines">@@ -333,8 +347,7 @@
</span><span class="cx">         do_action('add_tag_form_fields', $taxonomy);
</span><span class="cx"> do_action($taxonomy . '_add_form_fields', $taxonomy);
</span><span class="cx"> ?>
</span><del>-
-<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
</del><ins>+<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>
</ins><span class="cx"> <?php
</span><span class="cx"> if ( 'category' == $taxonomy )
</span><span class="cx">         do_action('edit_category_form',        (object)array('parent' => 0) ); // Back compat hook. Deprecated in preference to $taxonomy_add_form
</span><span class="lines">@@ -359,4 +372,4 @@
</span><span class="cx">
</span><span class="cx"> include('admin-footer.php');
</span><span class="cx">
</span><del>-?>
</del><ins>+?>
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>
</body>
</html>