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

Built from https://develop.svn.wordpress.org/trunk@26071


git-svn-id: http://core.svn.wordpress.org/trunk@25991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-11-09 23:28:09 +00:00
parent 5bb8d78e07
commit 8e0733a6c7
2 changed files with 10 additions and 5 deletions

View File

@ -235,8 +235,13 @@ function twentyfourteen_scripts() {
if ( is_active_sidebar( 'sidebar-3' ) ) if ( is_active_sidebar( 'sidebar-3' ) )
wp_enqueue_script( 'jquery-masonry' ); wp_enqueue_script( 'jquery-masonry' );
if ( is_front_page() && 'slider' == get_theme_mod( 'featured_content_layout' ) ) 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 ); 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 ); wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20131102', true );
} }

View File

@ -546,9 +546,9 @@
animationSpeed: 600, // Integer: Set the speed of animations, in milliseconds. animationSpeed: 600, // Integer: Set the speed of animations, in milliseconds.
controlsContainer: '', // jQuery Object/Selector: container navigation to append elements. controlsContainer: '', // jQuery Object/Selector: container navigation to append elements.
// Text labels: @todo allow translation // Text labels.
prevText: 'Previous', // String: Set the text for the "previous" directionNav item. prevText: featuredSliderDefaults.prevText, // String: Set the text for the "previous" directionNav item.
nextText: 'Next' // String: Set the text for the "next" directionNav item. nextText: featuredSliderDefaults.nextText // String: Set the text for the "next" directionNav item.
}; };
// FeaturedSlider: plugin function. // FeaturedSlider: plugin function.