Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/21/2018 01:01:35 AM (8 years ago)
Author:
djpaul
Message:

Templates, Nouveau: string improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/src/bp-templates/bp-nouveau/includes/template-tags.php

    r12082 r12105  
    22422242
    22432243        foreach ( $fields as $name => $attributes ) {
    2244                 $classes = '';
    2245 
    22462244                list( $label, $required, $value, $attribute_type, $type, $class ) = array_values( $attributes );
    2247 
    2248                 if ( $required ) {
    2249                         $required = ' ' . _x( '(required)', 'signup required field', 'buddypress' );
    2250                 }
    22512245
    22522246                // Text fields are using strings, radios are using their inputs
    22532247                $label_output = '<label for="%1$s">%2$s</label>';
    22542248                $id           = $name;
     2249                $classes      = '';
     2250
     2251                if ( $required ) {
     2252                        /* translators: Do not translate placeholders. 2 = form field name, 3 = "(required)". */
     2253                        $label_output = __( '<label for="%1$s">%2$s %3$s</label>', 'buddypress' );
     2254                }
    22552255
    22562256                // Output the label for regular fields
    22572257                if ( 'radio' !== $type ) {
    2258                         printf( $label_output, esc_attr( $name ), esc_html( sprintf( $label, $required ) ) );
     2258                        if ( $required ) {
     2259                                printf( $label_output, esc_attr( $name ), esc_html( $label ), __( '(required)', 'buddypress' ) );
     2260                        } else {
     2261                                printf( $label_output, esc_attr( $name ), esc_html( $label ) );
     2262                        }
    22592263
    22602264                        if ( ! empty( $value ) && is_callable( $value ) ) {
Note: See TracChangeset for help on using the changeset viewer.