For the complete documentation index, see llms.txt. This page is also available as Markdown.

weglot_language_code_replace

Replace Weglot's default language code with a custom one (e.g. twzh-HK). See the dedicated use case for the full example.

add_filter( 'weglot_language_code_replace', 'custom_weglot_language_code_replace' );
function custom_weglot_language_code_replace( $replacements ) {
    $replacements['tw'] = 'zh-HK';
    return $replacements;
}