Some document have non-standard locale code

This commit is contained in:
Ernestas Staugaitis 2020-02-16 22:12:34 +02:00
parent 733f845f8f
commit a0e57459dc
1 changed files with 2 additions and 0 deletions

View File

@ -228,6 +228,8 @@ final class Language extends AbstractStyle
*/ */
private function validateLocale($locale) private function validateLocale($locale)
{ {
$locale = str_replace('_', '-', $locale);
if (strlen($locale) === 2) { if (strlen($locale) === 2) {
return strtolower($locale) . '-' . strtoupper($locale); return strtolower($locale) . '-' . strtoupper($locale);
} }