Some document have non-standard locale code

This commit is contained in:
Ernestas Staugaitis 2020-02-17 11:44:27 +02:00
parent a0e57459dc
commit 37c15e66cd
1 changed files with 3 additions and 1 deletions

View File

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