Merge pull request #1824 from ErnestStaug/locale_support
Some document have non-standard locale code
This commit is contained in:
commit
5080139511
|
|
@ -228,6 +228,10 @@ final class Language extends AbstractStyle
|
||||||
*/
|
*/
|
||||||
private function validateLocale($locale)
|
private function validateLocale($locale)
|
||||||
{
|
{
|
||||||
|
if ($locale !== null) {
|
||||||
|
$locale = str_replace('_', '-', $locale);
|
||||||
|
}
|
||||||
|
|
||||||
if (strlen($locale) === 2) {
|
if (strlen($locale) === 2) {
|
||||||
return strtolower($locale) . '-' . strtoupper($locale);
|
return strtolower($locale) . '-' . strtoupper($locale);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue