Skip to content

Commit 5080139

Browse files
authored
Merge pull request #1824 from ErnestStaug/locale_support
Some document have non-standard locale code
2 parents d592b8e + 37c15e6 commit 5080139

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PhpWord/Style/Language.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ public function getBidirectional()
228228
*/
229229
private function validateLocale($locale)
230230
{
231+
if ($locale !== null) {
232+
$locale = str_replace('_', '-', $locale);
233+
}
234+
231235
if (strlen($locale) === 2) {
232236
return strtolower($locale) . '-' . strtoupper($locale);
233237
}

0 commit comments

Comments
 (0)