diff --git a/src/PhpWord/Style/Language.php b/src/PhpWord/Style/Language.php index 18ef88975f..7b2de51e07 100644 --- a/src/PhpWord/Style/Language.php +++ b/src/PhpWord/Style/Language.php @@ -228,6 +228,10 @@ public function getBidirectional() */ private function validateLocale($locale) { + if ($locale !== null) { + $locale = str_replace('_', '-', $locale); + } + if (strlen($locale) === 2) { return strtolower($locale) . '-' . strtoupper($locale); }