WordPress.org

Making WordPress.org

Changeset 5721


Ignore:
Timestamp:
07/26/2017 05:35:05 PM (4 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Improve translatability of "Used By"/ "Uses" string.

  • Use placeholder instead of hardcoding 1 in string.
  • Use numbered placeholders, with comments for translators.
  • Update link anchor targets to #used-by/#uses, respectively.

Props SergeyBiryukov.
Fixes #2979.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference-archive.php

    r3820 r5721  
    2727    <div class="meta">
    2828        <?php printf(
    29             _n( 'Used by <a href="%s">1 function</a>', 'Used by <a href="%s">%d functions</a>', $used_by, 'wporg' ),
    30             esc_url( apply_filters( 'the_permalink', get_permalink() ) ) . '#usage',
     29            /* translators: 1: permalink, 2: number of functions */
     30            _n( 'Used by <a href="%1$s">%2$d function</a>', 'Used by <a href="%1$s">%2$d functions</a>', $used_by, 'wporg' ),
     31            esc_url( apply_filters( 'the_permalink', get_permalink() ) ) . '#used-by',
    3132            $used_by
    3233        ); ?>
    3334        |
    3435        <?php printf(
    35             _n( 'Uses <a href="%s">1 function</a>', 'Uses <a href="%s">%d functions</a>', $uses, 'wporg' ),
    36             esc_url( apply_filters( 'the_permalink', get_permalink() ) ) . '#usage',
     36            /* translators: 1: permalink, 2: number of functions */
     37            _n( 'Uses <a href="%1$s">%2$d function</a>', 'Uses <a href="%1$s">%2$d functions</a>', $uses, 'wporg' ),
     38            esc_url( apply_filters( 'the_permalink', get_permalink() ) ) . '#uses',
    3739            $uses
    3840        ); ?>
Note: See TracChangeset for help on using the changeset viewer.