Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 7:00 – 15:00 -
- - - - - - -

Supporter timezone: Pacific/Easter (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Ilyes 9 months, 1 week ago.

Assisted by: Ilyes.

Author Posts
April 17, 2024 at 2:14 pm #15533001

Emily Noble

We are still seeing an error message regarding the mapping of Traditional Chinese to Simplified Chinese, even though we've already saved the mapping in the language settings. See the attached screenshot. Is it possible to map Traditional Chinese to Simplified Chinese?

April 17, 2024 at 3:10 pm #15533701

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Hello,

I have escalated yoru request to our 2nd tier,

I will let you know once I receive any updates on this,

Thank you for your patience,

Best,

April 19, 2024 at 3:25 pm #15544524

Ilyes
Supporter

Languages: French (Français )

Timezone: Pacific/Easter (GMT-05:00)

Hello again,

This turned out to be a known issue and we have a workaround that we can appy,

This function has to be replaced: the get_languages_supported_by_automatic_translations() function in \sitepress-multilingual-cms\classes\ATE\API\class-wpml-tm-ate-api.php with:

public function get_languages_supported_by_automatic_translations( $languageCodes, $sourceLanguage = null ) {
				$sourceLanguage = $sourceLanguage ?: Languages::getDefaultCode();
    
				$lang_case_mapping = [
					'zh-hant' => 'zh-Hant',
				];
				$languageCodes = array_map(function($code) use ($lang_case_mapping){
					return isset($lang_case_mapping[$code]) ? $lang_case_mapping[$code] : $code; 
				}, $languageCodes);
    
				$result = $this->requestWithLog(
					$this->endpoints->getLanguagesCheckPairs(),
					[
						'method' => 'POST',
						'body'   => [
							[
								'source_language'  => $sourceLanguage,
								'target_languages' => $languageCodes,
							]
						]
					]
				);
    
				$revert_lang_code = function($obj) use ($lang_case_mapping) {
					$lang_case_mapping = array_flip($lang_case_mapping);
					foreach ($obj as $key => $value) {
						if (isset($lang_case_mapping[$key])) {
							$obj->{$lang_case_mapping[$key]} = $value;
							unset($obj->$key);
						}
					}
    
					return $obj;
				};
    
				return Maybe::of( $result )
				            ->reject( 'is_wp_error' )
				            ->map( Obj::prop( 'results' ) )
				            ->map( Lst::find( Relation::propEq( 'source_language', $sourceLanguage ) ) )
				            ->map( Obj::prop( 'target_languages' ) )
				            ->map( $revert_lang_code );
			}

I could apply this change for you if you could share FTP access of your site,

There is a field below where you can share the access if you need our help with it,

Best,

The topic ‘[Closed] Deepl – mapping of Traditional Chinese to Simplified Chinese doesn't work’ is closed to new replies.