ExtendingBridging language codes
Bridging language codes
It may happen that the language code used by WordPress and some translation provider is different.
For instance, Norwegian is represented as "nb"
by WordPress, and as "no"
by Google Translate.
If you come across any such case, to enable the translation provider to handle that language, you must adapt the language code accordingly.
Do this via hook gatompl:language_mapping_variables
, like this:
add_filter(
'gatompl:language_mapping_variables',
function (array $languageMappingVariables): array {
return [
'google_translate' => [
'nb' => 'no',
// provide your additional mappings
// ...
],
'deepl' => [
// provide your additional mappings
// ...
],
]
}
);