Simplify the Open Sans translator voodoo. see #21751.

git-svn-id: https://develop.svn.wordpress.org/trunk@22049 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-09-27 07:30:27 +00:00
parent 34d41e32ba
commit 30816ade4e
2 changed files with 20 additions and 26 deletions

View File

@ -98,7 +98,7 @@ function twentytwelve_scripts_styles() {
/*
* Adds JavaScript for handling the navigation menu hide-and-show behavior.
*/
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120920', true );
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
/*
* Loads our special font CSS file.
@ -112,27 +112,29 @@ function twentytwelve_scripts_styles() {
* }
* add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
*/
/* translators: If there are characters in your language that are not supported by Open Sans,
enter 'disable-open-sans'. Otherwise enter 'enable-open-sans'. Do not translate into your own language. */
if ( false === strpos( _x( 'enable-open-sans', 'Open Sans font: enable or disable', 'twentytwelve' ), 'disable' ) ) {
$subsets = 'latin,latin-ext';
/* translators: To add an additional Open Sans character subset specific to your language enter 'greek', 'cyrillic' or 'vietnamese'.
Otherwise enter 'open-sans-subset'. Do not translate into your own language. */
$add_subset = _x( 'open-sans-subset', 'Additional Open Sans font subset: greek, cyrillic or vietnamese', 'twentytwelve' );
if ( in_array( $add_subset, array( 'greek', 'cyrillic', 'vietnamese' ) ) ) {
$character_sets = array(
'greek' => 'greek,greek-ext',
'cyrillic' => 'cyrillic,cyrillic-ext',
'vietnamese' => 'vietnamese'
);
$subsets = implode( ',', array( $subsets, $character_sets[ $add_subset ] ) );
}
/* translators: If there are characters in your language that are not supported
by Open Sans, translate this to 'off'. Do not translate into your own language. */
if ( 'off' == _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
$subsets = 'latin,latin-ext';
/* translators: To add an additional Open Sans character subset specific to your language, translate
this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
$subset = _x( '', 'Open Sans font: add new subset (greek, cyrllic, vietnamese)', 'twentytwelve' );
if ( $subset == 'cyrillic' )
$subsets .= ',cyrillic,cyrillic-ext';
elseif ( $subset == 'greek' )
$subsets .= ',greek,greek-ext';
elseif ( $subsets == 'vietnamese' )
$subsets .= ',vietnamese';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => 'Open+Sans:400italic,700italic,400,700',
'subset' => $subsets
'subset' => $subsets,
);
wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
}
@ -141,15 +143,6 @@ function twentytwelve_scripts_styles() {
* Loads our main stylesheet.
*/
wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
/*
* Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions.
* Ideally, should load after main CSS file.
* See html5.js link in header.php.
*
* @todo depends on IE dependency being in core for JS enqueuing
* before we can move here properly: see http://core.trac.wordpress.org/ticket/16024
*/
}
add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );

View File

@ -21,6 +21,7 @@
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->