WordPress.org

Make WordPress Core

Changeset 26071


Ignore:
Timestamp:
11/09/2013 11:27:28 PM (6 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: allow slider "Previous" and "Next" labels to be translated, props michahwave. Fixes #25897.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r26047 r26071  
    236236        wp_enqueue_script( 'jquery-masonry' );
    237237
    238     if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) )
    239         wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131028', true );
     238    if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) {
     239        wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131109', true );
     240        wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array(
     241            'prevText' => __( 'Previous', 'twentyfourteen' ),
     242            'nextText' => __( 'Next', 'twentyfourteen' )
     243        ) );
     244    }
    240245
    241246    wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131102', true );
  • trunk/src/wp-content/themes/twentyfourteen/js/slider.js

    r25995 r26071  
    547547        controlsContainer: '',    // jQuery Object/Selector: container navigation to append elements.
    548548
    549         // Text labels: @todo allow translation
    550         prevText: 'Previous',    // String: Set the text for the "previous" directionNav item.
    551         nextText: 'Next'          // String: Set the text for the "next" directionNav item.
     549        // Text labels.
     550        prevText: featuredSliderDefaults.prevText, // String: Set the text for the "previous" directionNav item.
     551        nextText: featuredSliderDefaults.nextText  // String: Set the text for the "next" directionNav item.
    552552    };
    553553
Note: See TracChangeset for help on using the changeset viewer.