Skip to content

Commit 076af66

Browse files
aelliott-atlasProgi1984
authored andcommitted
when language code is 'und' default to 'en-EN'
1 parent 34276d3 commit 076af66

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PhpWord/Style/Language.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ private function validateLocale($locale)
256256
if ($locale !== null && strlen($locale) === 2) {
257257
return strtolower($locale) . '-' . strtoupper($locale);
258258
}
259-
259+
if ($locale === 'und') {
260+
return 'en-EN';
261+
}
260262
if ($locale !== null && $locale !== 'zxx' && strstr($locale, '-') === false) {
261263
throw new InvalidArgumentException($locale . ' is not a valid language code');
262264
}

0 commit comments

Comments
 (0)