Make WordPress Core

Changeset 26376


Ignore:
Timestamp:
11/26/2013 01:53:17 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Allow Open Sans to be disabled per language. props dimadin. fixes #26063.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r26254 r26376  
    560560    $styles->add_data( 'ie', 'conditional', 'lte IE 7' );
    561561
    562     $subsets = 'latin,latin-ext';
    563 
    564     /* translators: To add an additional Open Sans character subset specific to your language,
    565      * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     562    $open_sans_font_url = '';
     563
     564    /* translators: If there are characters in your language that are not supported
     565     * by Open Sans, translate this to 'off'. Do not translate into your own language.
    566566     */
    567     $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );
    568 
    569     if ( 'cyrillic' == $subset )
    570         $subsets .= ',cyrillic,cyrillic-ext';
    571     elseif ( 'greek' == $subset )
    572         $subsets .= ',greek,greek-ext';
    573     elseif ( 'vietnamese' == $subset )
    574         $subsets .= ',vietnamese';
    575 
    576     // Hotlink Open Sans, for now
    577     $styles->add( 'open-sans', "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets" );
     567    if ( 'off' !== _x( 'on', 'Open Sans font: on or off' ) ) {
     568        $subsets = 'latin,latin-ext';
     569
     570        /* translators: To add an additional Open Sans character subset specific to your language,
     571         * translate this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language.
     572         */
     573        $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)' );
     574
     575        if ( 'cyrillic' == $subset ) {
     576            $subsets .= ',cyrillic,cyrillic-ext';
     577        } elseif ( 'greek' == $subset ) {
     578            $subsets .= ',greek,greek-ext';
     579        } elseif ( 'vietnamese' == $subset ) {
     580            $subsets .= ',vietnamese';
     581        }
     582
     583        $query_args = array(
     584            'family' => 'Open+Sans:300italic,400italic,600italic,300,400,600',
     585            'subset' => $subsets,
     586        );
     587        // Hotlink Open Sans, for now
     588        $open_sans_font_url = add_query_arg( $query_args, '//fonts.googleapis.com/css' );
     589    }
     590
     591    $styles->add( 'open-sans', $open_sans_font_url );
    578592
    579593    // Dashicons
Note: See TracChangeset for help on using the changeset viewer.