Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client wants to customize the language switcher in the main header menu to display shorter language codes (like EN) instead of the full language names, without modifying the full language naming list used elsewhere on the site.

Solution:
1. We recommend going to WPML > Languages > Site Languages > Edit languages and adding the custom language code for each language. For detailed instructions, please refer to our documentation: Editing WPML's Languages Table.

2. If you want to use a custom language switcher with different labels for each language, you can configure this by creating a custom language switcher and choosing which labels to display. For more information, please see our documentation: Custom Language Switcher.

3. To display a second language in the switcher only when a translation for a post/page is available, set the translation preference to "Translatable - only show translated items" in WPML > Settings > Post Types Translation.

If this solution doesn't look relevant, please open a new support ticket in our support forum.

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.

This topic contains 4 replies, has 2 voices.

Last updated by bradC-7 1 year, 1 month ago.

Assisted by: Long Nguyen.

Author Posts
November 2, 2023 at 6:22 pm #14720461

bradC-7

Good afternoon,

I am looking at adding translations to our website in Canadian French and am wondering what other options there are for the language switcher that is in the main header menu.

The default menu switcher shows the full language name ("English" in my case) and what I am looking for is the option to have it appear differently (something shorter like EN). I don't want to necessarily lose my full languages listed in their native languages.

Is there a way to customize how it appears in the menu without modifying the full language naming list?

For what it's worth, I did try searching for this in the forums.

Thank you in advance,

November 3, 2023 at 7:11 am #14722803

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Brad,

Thank you for contacting WPML support, I'd be happy to help you with this issue.

You can go to WPML > Languages > Site Languages > Edit languages and add the translation for the language in other ones. Please check screenshot attached and refer to the documentation
https://wpml.org/documentation/getting-started-guide/language-setup/editing-wpmls-languages-table/#language-configuration-fields-defined

Look forward to your reply.
Thanks

Languages ‹ WPML Testing — WordPress 2023-11-03 14-05-07.png
Languages ‹ WPML Testing — WordPress 2023-11-03 14-03-14.png
November 3, 2023 at 1:29 pm #14726129

bradC-7

Thanks for the prompt response! Much appreciated

I did see that as an option that would accomplish this, although it would mean overwriting the functionality used elsewhere on posts that lets the user know that there are other versions available.

Are there any other options for mapping a menu item where I could assign labels. Any other plugin or service options would be appreciated as well.

Is there a way I can map these commands myself manually when customizing the header menu? For example, can I make a link that simply reloads the same page with the other language if a translation is available?

Otherwise I can go with this route.

Thanks again,
Brad

November 6, 2023 at 3:10 am #14734367

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I'm not sure if I understand your question fully. You can use a custom language switcher where the translation language label is displayed and remove the native language label.
Then in Footer or Menu language switcher, you can show the native language label and remove the translation language label. Refer documentation https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/

If you want to display a second language in the switcher when the translation post/page is available, please set the translation preference to "Translatable - only show translated items" in WPML > Settings > Post Types Translation.

Look forward to your reply.
Thanks

November 6, 2023 at 3:02 pm #14739163

bradC-7

No problem, I have seen those options and think what I am looking for is outside of the intended scope for WPML. Appreciate your time and effort here!

November 6, 2023 at 3:03 pm #14739225

bradC-7

Appreciate your time