Twenty Twelve: allow translators to load extra character subsets for Open Sans font, props obenland. See #21751.
git-svn-id: https://develop.svn.wordpress.org/trunk@22020 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e82d5080b8
commit
5453d7d84d
@ -115,8 +115,26 @@ function twentytwelve_scripts_styles() {
|
||||
/* 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 ] ) );
|
||||
}
|
||||
|
||||
$protocol = is_ssl() ? 'https' : 'http';
|
||||
wp_enqueue_style( 'twentytwelve-fonts', "$protocol://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700", array(), null );
|
||||
$query_args = array(
|
||||
'family' => 'Open+Sans:400italic,700italic,400,700',
|
||||
'subset' => $subsets
|
||||
);
|
||||
wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user