diff --git a/README.md b/README.md index e0adef3..59700e8 100644 --- a/README.md +++ b/README.md @@ -86,15 +86,19 @@ You can get a flattened array, containing only specific locale info. These array ``` php $locales = $browser->getLocales('locale'); -//=> Result: ['en-US', 'en', 'nl-BE', 'nl'] +//=> 'en-US,en;q=0.8,nl-NL;q=0.6' +//=> Result: ['en-US', 'en', 'nl-BE'] $languages = $browser->getLocales('language'); +//=> 'en-US,en;q=0.8,nl-NL;q=0.6' //=> Result: ['en', 'nl'] $countries = $browser->getLocales('country'); +//=> 'en-US,en;q=0.8,nl-NL;q=0.6,nl;q=0.4' //=> Result: ['US', 'BE'] $weights = $browser->getLocales('weight'); +//=> 'en-US,en;q=0.8,nl-NL;q=0.6,nl;q=0.4' //=> Result: [1.0, 0.8, 0.6, 0.4] ``` diff --git a/tests/BrowserLocaleTest.php b/tests/BrowserLocaleTest.php index ceca926..0945531 100644 --- a/tests/BrowserLocaleTest.php +++ b/tests/BrowserLocaleTest.php @@ -61,17 +61,17 @@ public function it_returns_an_array_of_all_preferred_locales() /** @test */ public function it_returns_a_simple_array_of_locale_locales() { - $browser = new BrowserLocale('en-US,en;q=0.8,nl-NL;q=0.6,nl;q=0.4'); + $browser = new BrowserLocale('en-US,en;q=0.8,nl-NL;q=0.6'); $locales = $browser->getLocales('locale'); - $this->assertEquals(['en-US', 'en', 'nl-NL', 'nl'], $locales); + $this->assertEquals(['en-US', 'en', 'nl-NL'], $locales); } /** @test */ public function it_returns_a_simple_array_of_language_codes() { - $browser = new BrowserLocale('en-US,en;q=0.8,nl-NL;q=0.6,nl;q=0.4'); + $browser = new BrowserLocale('en-US,en;q=0.8,nl-NL;q=0.6'); $locales = $browser->getLocales('language');