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?
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,
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,