diff --git a/src/PhpWord/Style/Language.php b/src/PhpWord/Style/Language.php index 18ef8897..2ccc44c7 100644 --- a/src/PhpWord/Style/Language.php +++ b/src/PhpWord/Style/Language.php @@ -228,6 +228,8 @@ final class Language extends AbstractStyle */ private function validateLocale($locale) { + $locale = str_replace('_', '-', $locale); + if (strlen($locale) === 2) { return strtolower($locale) . '-' . strtoupper($locale); }