diff options
Diffstat (limited to 'MLEB/Translate/webservices/GoogleTranslateWebService.php')
-rw-r--r-- | MLEB/Translate/webservices/GoogleTranslateWebService.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/MLEB/Translate/webservices/GoogleTranslateWebService.php b/MLEB/Translate/webservices/GoogleTranslateWebService.php index abb435ea..4b51c9c6 100644 --- a/MLEB/Translate/webservices/GoogleTranslateWebService.php +++ b/MLEB/Translate/webservices/GoogleTranslateWebService.php @@ -23,10 +23,16 @@ class GoogleTranslateWebService extends TranslationWebService { /** @inheritDoc */ protected function mapCode( $code ) { - if ( $code === 'be-tarask' ) { - $code = 'be'; - } - return $code; + /** @phpcs-require-sorted-array */ + $map = [ + 'be-tarask' => 'be', + 'zh-cn' => 'zh-CN', + 'zh-hans' => 'zh-CN', + 'zh-hant' => 'zh-TW', + 'zh-tw' => 'zh-TW', + ]; + + return $map[$code] ?? $code; } /** @inheritDoc */ |