l10n: Update wp_get_installed_translations() to support variants of a language.

* A variant of a language has its own locale, for example the locale of the formal variant of German is `de_DE_formal`.
* Update `remove_accents()` and some CSS rules to support `de_DE_formal`.
* Add tests for `get_bloginfo( 'language' )`.
* API changes will be deployed over the next few days.

see #28303.

git-svn-id: https://develop.svn.wordpress.org/trunk@33027 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2015-07-01 15:42:32 +00:00
parent b32cf591c2
commit caab22e5b2
4 changed files with 44 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
<?php
/**
* @group formatting
*/
class Tests_Formatting_BlogInfo extends WP_UnitTestCase {
/**
* @dataProvider locales
* @ticket 28303
*/
function test_get_bloginfo_language( $test_locale, $expected ) {
global $locale;
$old_locale = $locale;
$locale = $test_locale;
$this->assertEquals( $expected, get_bloginfo( 'language' ) );
$locale = $old_locale;
}
function locales() {
return array(
// Locale Language code
array( 'en_US', 'en-US' ),
array( 'ar', 'ar' ),
array( 'de_DE', 'de-DE' ),
array( 'de_DE_formal', 'de-DE-formal' ),
array( 'oci', 'oci' ),
array( 'pt_PT_ao1990', 'pt-PT-ao1990' ),
);
}
}