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
This commit is contained in:
Dominik Schilling 2016-03-02 16:10:28 +00:00
parent b757de7da9
commit 56d28131dc
2 changed files with 10 additions and 3 deletions

View File

@ -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(

View File

@ -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.