Skip to content

Commit 9397b88

Browse files
authored
Merge pull request #2 from ErnestStaug/locale_support
Some document have non-standard locale code
2 parents 445844c + a0e5745 commit 9397b88

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PhpWord/Style/Language.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ public function getBidirectional()
228228
*/
229229
private function validateLocale($locale)
230230
{
231+
$locale = str_replace('_', '-', $locale);
232+
231233
if (strlen($locale) === 2) {
232234
return strtolower($locale) . '-' . strtoupper($locale);
233235
}

0 commit comments

Comments
 (0)