diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index 5d15351ead..8703cf655a 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -235,8 +235,13 @@ function twentyfourteen_scripts() { if ( is_active_sidebar( 'sidebar-3' ) ) wp_enqueue_script( 'jquery-masonry' ); - if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) - wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131028', true ); + if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) { + wp_enqueue_script( 'twentyfourteen-slider', get_template_directory_uri() . '/js/slider.js', array( 'jquery' ), '20131109', true ); + wp_localize_script( 'twentyfourteen-slider', 'featuredSliderDefaults', array( + 'prevText' => __( 'Previous', 'twentyfourteen' ), + 'nextText' => __( 'Next', 'twentyfourteen' ) + ) ); + } wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131102', true ); } diff --git a/wp-content/themes/twentyfourteen/js/slider.js b/wp-content/themes/twentyfourteen/js/slider.js index 9d000dd275..8133223795 100644 --- a/wp-content/themes/twentyfourteen/js/slider.js +++ b/wp-content/themes/twentyfourteen/js/slider.js @@ -546,9 +546,9 @@ animationSpeed: 600, // Integer: Set the speed of animations, in milliseconds. controlsContainer: '', // jQuery Object/Selector: container navigation to append elements. - // Text labels: @todo allow translation - prevText: 'Previous', // String: Set the text for the "previous" directionNav item. - nextText: 'Next' // String: Set the text for the "next" directionNav item. + // Text labels. + prevText: featuredSliderDefaults.prevText, // String: Set the text for the "previous" directionNav item. + nextText: featuredSliderDefaults.nextText // String: Set the text for the "next" directionNav item. }; // FeaturedSlider: plugin function.