From 56d28131dc743900b73d270927674d6b13c81c51 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 2 Mar 2016 16:10:28 +0000 Subject: [PATCH] I18N: Don't use the locale for the HTML language attribute. Locales are codes to identify a language in WordPress which can be different from the specification for language tags, see https://www.w3.org/International/articles/language-tags/. An example is `de_DE_formal` or `nl_NL_formal` where the subtag `formal` isn't officially supported. To give translators the possibility to specify the language tag of their language introduce a string `html_lang_attribute` which can be translated into the language tag which conforms to the specification. Props SergeyBiryukov. Fixes #33511. Built from https://develop.svn.wordpress.org/trunk@36802 git-svn-id: http://core.svn.wordpress.org/trunk@36769 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 11 +++++++++-- wp-includes/version.php | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index ff2f0987f2..58273d9834 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -708,8 +708,15 @@ function get_bloginfo( $show = '', $filter = 'raw' ) { $output = $wp_version; break; case 'language': - $output = get_locale(); - $output = str_replace('_', '-', $output); + /* translators: Translate this to the correct language tag for your locale, + * see https://www.w3.org/International/articles/language-tags/ for reference. + * Do not translate into your own language. + */ + $output = __( 'html_lang_attribute' ); + if ( 'html_lang_attribute' === $output || preg_match( '/[^a-zA-Z0-9-]/', $output ) ) { + $output = get_locale(); + $output = str_replace( '_', '-', $output ); + } break; case 'text_direction': _deprecated_argument( __FUNCTION__, '2.2', sprintf( diff --git a/wp-includes/version.php b/wp-includes/version.php index 16201f347d..df40184201 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta1-36801'; +$wp_version = '4.5-beta1-36802'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.