Make WordPress Core

Changeset 22049


Ignore:
Timestamp:
09/27/2012 07:30:27 AM (12 years ago)
Author:
nacin
Message:

Simplify the Open Sans translator voodoo. see #21751.

Location:
trunk/wp-content/themes/twentytwelve
Files:
2 edited

Legend:

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

    r22020 r22049  
    9999     * Adds JavaScript for handling the navigation menu hide-and-show behavior.
    100100     */
    101     wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120920', true );
     101    wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
    102102
    103103    /*
     
    113113     * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
    114114     */
    115     /* translators: If there are characters in your language that are not supported by Open Sans,
    116        enter 'disable-open-sans'. Otherwise enter 'enable-open-sans'. Do not translate into your own language. */
    117     if ( false === strpos( _x( 'enable-open-sans', 'Open Sans font: enable or disable', 'twentytwelve' ), 'disable' ) ) {
     115
     116    /* translators: If there are characters in your language that are not supported
     117       by Open Sans, translate this to 'off'. Do not translate into your own language. */
     118    if ( 'off' == _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
     119
    118120        $subsets = 'latin,latin-ext';
    119         /* translators: To add an additional Open Sans character subset specific to your language enter 'greek', 'cyrillic' or 'vietnamese'.
    120            Otherwise enter 'open-sans-subset'. Do not translate into your own language. */
    121         $add_subset = _x( 'open-sans-subset', 'Additional Open Sans font subset: greek, cyrillic or vietnamese', 'twentytwelve' );
    122 
    123         if ( in_array( $add_subset, array( 'greek', 'cyrillic', 'vietnamese' ) ) ) {
    124             $character_sets = array(
    125                 'greek'      => 'greek,greek-ext',
    126                 'cyrillic'   => 'cyrillic,cyrillic-ext',
    127                 'vietnamese' => 'vietnamese'
    128             );
    129             $subsets = implode( ',', array( $subsets, $character_sets[ $add_subset ] ) );
    130         }
     121
     122        /* translators: To add an additional Open Sans character subset specific to your language, translate
     123           this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
     124
     125        $subset = _x( '', 'Open Sans font: add new subset (greek, cyrllic, vietnamese)', 'twentytwelve' );
     126
     127        if ( $subset == 'cyrillic' )
     128            $subsets .= ',cyrillic,cyrillic-ext';
     129        elseif ( $subset == 'greek' )
     130            $subsets .= ',greek,greek-ext';
     131        elseif ( $subsets == 'vietnamese' )
     132            $subsets .= ',vietnamese';
    131133
    132134        $protocol = is_ssl() ? 'https' : 'http';
    133135        $query_args = array(
    134136            'family' => 'Open+Sans:400italic,700italic,400,700',
    135             'subset' => $subsets
     137            'subset' => $subsets,
    136138        );
    137139        wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
     
    142144     */
    143145    wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
    144 
    145     /*
    146      * Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions.
    147      * Ideally, should load after main CSS file.
    148      * See html5.js link in header.php.
    149      *
    150      * @todo depends on IE dependency being in core for JS enqueuing
    151      * before we can move here properly: see http://core.trac.wordpress.org/ticket/16024
    152      */
    153146}
    154147add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
  • trunk/wp-content/themes/twentytwelve/header.php

    r22014 r22049  
    2222<link rel="profile" href="http://gmpg.org/xfn/11" />
    2323<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
     24<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
    2425<!--[if lt IE 9]>
    2526<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
Note: See TracChangeset for help on using the changeset viewer.