WordPress.org

Make WordPress Core

Ticket #9112: i18n-gettext-contexts-1.diff

File i18n-gettext-contexts-1.diff, 12.9 KB (added by nbachiyski, 13 years ago)
  • wp-includes/js/tinymce/langs/wp-langs.php

     
    179179}}});
    180180
    181181tinyMCE.addI18n("' . $language . '.advanced",{
    182 style_select:"' . mce_escape( __('Styles') ) . '",
     182style_select:"' . mce_escape( /* translators: TinyMCE font styles */ _x('Styles', 'TinyMCE font styles') ) . '",
    183183font_size:"' . mce_escape( __('Font size') ) . '",
    184184fontdefault:"' . mce_escape( __('Font family') ) . '",
    185185block:"' . mce_escape( __('Format') ) . '",
  • wp-includes/comment.php

     
    252252function get_comment_statuses( ) {
    253253        $status = array(
    254254                'hold'          => __('Unapproved'),
    255                 'approve'       => _c('Approved|adjective'),
    256                 'spam'          => _c('Spam|adjective'),
     255                /* translators: comment status  */
     256                'approve'       => _x('Approved', 'adjective'),
     257                /* translators: comment status */
     258                'spam'          => _x('Spam', 'adjective'),
    257259        );
    258260
    259261        return $status;
  • wp-includes/l10n.php

     
    176176function _n($single, $plural, $number, $domain = 'default') {
    177177        $translations = &get_translations_for_domain( $domain );
    178178        $translation = $translations->translate_plural( $single, $plural, $number );
    179         return apply_filters( 'ngettext', $translation, $single, $plural, $number );
     179        return apply_filters( 'ngettext', $translation, $single, $plural, $number, $domain );
    180180}
    181181
    182182/**
     
    191191function _nx($single, $plural, $number, $context, $domain = 'default') {
    192192        $translations = &get_translations_for_domain( $domain );
    193193        $translation = $translations->translate_plural( $single, $plural, $number, $context );
    194         return apply_filters( 'ngettext_with_context ', $translation, $single, $plural, $number, $context );
     194        return apply_filters( 'ngettext_with_context ', $translation, $single, $plural, $number, $context, $domain );
    195195}
    196196
    197197/**
     
    340340        return isset($l10n[$domain])? $l10n[$domain] : $empty;
    341341}
    342342
     343/**
     344 * Translates role name. Since the role names are in the database and
     345 * not in the source there are dummy gettext calls to get them into the POT
     346 * file and this function properly translates them back.
     347 *
     348 * The before_last_bar() call is needed, because older installs keep the roles
     349 * using the old context format: 'Role name|User role' and just skipping the
     350 * content after the last bar is easier than fixing them in the DB. New installs
     351 * won't suffer from that problem.
     352 */
     353function translate_user_role( $name ) {
     354        return before_last_bar( translate_with_gettext_context( $name, 'User role' ) );
     355}
    343356?>
  • wp-includes/formatting.php

     
    22142214
    22152215        // Translate and filter the delimiter set (avoid ampersands and entities here)
    22162216        $l = apply_filters('wp_sprintf_l', array(
    2217                 'between'          => _c(', |between list items'),
    2218                 'between_last_two' => _c(', and |between last two list items'),
    2219                 'between_only_two' => _c(' and |between only two list items'),
     2217                /* translators: used between list items, there is a space after the coma */
     2218                'between'          => __(', '),
     2219                /* translators: used between list items, there is a space after the and */
     2220                'between_last_two' => __(', and '),
     2221                /* translators: used between only two list items, there is a space after the and */
     2222                'between_only_two' => __(' and '),
    22202223                ));
    22212224
    22222225        $args = (array) $args;
  • wp-content/themes/classic/comments.php

     
    2121        <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
    2222        <?php echo get_avatar( $comment, 32 ); ?>
    2323        <?php comment_text() ?>
    24         <p><cite><?php comment_type(_c('Comment|noun'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?></p>
     24        <p><cite><?php comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?></p>
    2525        </li>
    2626
    2727<?php endforeach; ?>
  • wp-content/themes/classic/comments-popup.php

     
    4949<?php foreach ($comments as $comment) { ?>
    5050        <li id="comment-<?php comment_ID() ?>">
    5151        <?php comment_text() ?>
    52         <p><cite><?php comment_type(_c('Comment|noun'), __('Trackback'), __('Pingback')); ?> <?php _e("by"); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
     52        <p><cite><?php comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback')); ?> <?php _e("by"); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
    5353        </li>
    5454
    5555<?php } // end for each comment ?>
  • wp-admin/users.php

     
    276276                $class = ' class="current"';
    277277        }
    278278
    279         $name = translate_with_context($name);
    280         $name = sprintf( _c('%1$s <span class="count">(%2$s)</span>|user role with count'), $name, $avail_roles[$this_role] );
     279        $name = translate_user_role( $name );
     280        /* translators: User role name with count */
     281        $name = sprintf( __('%1$s <span class="count">(%2$s)</span>'), $name, $avail_roles[$this_role] );
    281282        $role_links[] = "<li><a href='users.php?role=$this_role'$class>$name</a>";
    282283}
    283284echo implode( " |</li>\n", $role_links) . '</li>';
  • wp-admin/includes/post.php

     
    790790                                'publish' => array(__('Published'), __('Published posts'), _n_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>')),
    791791                                'future' => array(__('Scheduled'), __('Scheduled posts'), _n_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>')),
    792792                                'pending' => array(__('Pending Review'), __('Pending posts'), _n_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>')),
    793                                 'draft' => array(__('Draft'), _c('Drafts|manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
     793                                'draft' => array(__('Draft'), _x('Drafts', 'manage posts header'), _n_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>')),
    794794                                'private' => array(__('Private'), __('Private posts'), _n_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>')),
    795795                        );
    796796
  • wp-admin/includes/upgrade.php

     
    9494
    9595        // Default category
    9696        $cat_name = __('Uncategorized');
    97         $cat_slug = sanitize_title(_c('Uncategorized|Default category slug'));
     97        /* translators: Default category slug */
     98        $cat_slug = sanitize_title(_x('Uncategorized', 'Default category slug'));
    9899       
    99100        $wpdb->insert( $wpdb->terms, array('name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) );
    100101        $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => '1', 'taxonomy' => 'category', 'description' => '', 'parent' => 0, 'count' => 1));
    101102
    102103        // Default link category
    103104        $cat_name = __('Blogroll');
    104         $cat_slug = sanitize_title(_c('Blogroll|Default link category slug'));
     105        /* translators: Default link category slug */
     106        $cat_slug = sanitize_title(_x('Blogroll', 'Default link category slug'));
    105107       
    106108        $wpdb->insert( $wpdb->terms, array('name' => $cat_name, 'slug' => $cat_slug, 'term_group' => 0) );
    107109        $wpdb->insert( $wpdb->term_taxonomy, array('term_id' => '2', 'taxonomy' => 'link_category', 'description' => '', 'parent' => 0, 'count' => 7));
     
    168170                                                                'post_excerpt' => '',
    169171                                                                'post_title' => __('Hello world!'),
    170172                                                                'post_category' => 0,
    171                                                                 'post_name' => _c('hello-world|Default post slug'),
     173                                                                /* translators: Default post slug */
     174                                                                'post_name' => _x('hello-world', 'Default post slug'),
    172175                                                                'post_modified' => $now,
    173176                                                                'post_modified_gmt' => $now_gmt,
    174177                                                                'guid' => $first_post_guid,
     
    199202                                                                'post_excerpt' => '',
    200203                                                                'post_title' => __('About'),
    201204                                                                'post_category' => '',
    202                                                                 'post_name' => _c('about|Default page slug'),
     205                                                                /* translators: Default page slug */
     206                                                                'post_name' => _x('about', 'Default page slug'),
    203207                                                                'post_modified' => $now,
    204208                                                                'post_modified_gmt' => $now_gmt,
    205209                                                                'guid' => $first_post_guid,
  • wp-admin/includes/schema.php

     
    339339        // Add roles
    340340
    341341        // Dummy gettext calls to get strings in the catalog.
    342         _c('Administrator|User role');
    343         _c('Editor|User role');
    344         _c('Author|User role');
    345         _c('Contributor|User role');
    346         _c('Subscriber|User role');
     342        /* translators: user role */
     343        _x('Administrator', 'User role');
     344        /* translators: user role */
     345        _x('Editor''|User role');
     346        /* translators: user role */
     347        _x('Author', 'User role');
     348        /* translators: user role */
     349        _x('Contributor', 'User role');
     350        /* translators: user role */
     351        _x('Subscriber', 'User role');
    347352
    348         add_role('administrator', 'Administrator|User role');
    349         add_role('editor', 'Editor|User role');
    350         add_role('author', 'Author|User role');
    351         add_role('contributor', 'Contributor|User role');
    352         add_role('subscriber', 'Subscriber|User role');
     353        add_role('administrator', 'Administrator');
     354        add_role('editor', 'Editor');
     355        add_role('author', 'Author');
     356        add_role('contributor', 'Contributor');
     357        add_role('subscriber', 'Subscriber');
    353358
    354359        // Add caps for Administrator role
    355360        $role =& get_role('administrator');
  • wp-admin/includes/template.php

     
    763763        /* translators: column name */
    764764        $posts_columns['media'] = _x('File', 'column name');
    765765        $posts_columns['author'] = __('Author');
    766         //$posts_columns['tags'] = _c('Tags|media column header');
     766        //$posts_columns['tags'] = _x('Tags', 'column name');
    767767        /* translators: column name */
    768768        $posts_columns['parent'] = _x('Attached to', 'column name');
    769769        $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
     
    18921892        } else {
    18931893                $edit = '<strong>' . $user_object->user_login . '</strong>';
    18941894        }
    1895         $role_name = isset($wp_roles->role_names[$role]) ? translate_with_context($wp_roles->role_names[$role]) : __('None');
     1895        $role_name = isset($wp_roles->role_names[$role]) ? translate_user_role($wp_roles->role_names[$role] ) : __('None');
    18961896        $r = "<tr id='user-$user_object->ID'$style>";
    18971897        $columns = get_column_headers('users');
    18981898        $hidden = get_hidden_columns('users');
     
    26792679        $editable_roles = get_editable_roles();
    26802680
    26812681        foreach( $editable_roles as $role => $details ) {
    2682                 $name = translate_with_context($details['name']);
     2682                $name = translate_user_role($details['name'] );
    26832683                if ( $selected == $role ) // Make default first in list
    26842684                        $p = "\n\t<option selected='selected' value='$role'>$name</option>";
    26852685                else
  • wp-admin/theme-editor.php

     
    173173                <li><a href="theme-editor.php?file=<?php echo "$template_file"; ?>&amp;theme=<?php echo urlencode($theme) ?>"><?php echo $filedesc ?></a></li>
    174174<?php endwhile; ?>
    175175        </ul>
    176         <h4><?php echo _c('Styles|Theme stylesheets in theme editor'); ?></h4>
     176        <h4><?php /* translators: Theme stylesheets in theme editor */ echo _x('Styles', 'Theme stylesheets in theme editor'); ?></h4>
    177177        <ul>
    178178<?php
    179179        $template_mapping = array();