Home›Support›English Support›[Resolved] How to abbreviate languages in menu switcher and keep translated options
[Resolved] How to abbreviate languages in menu switcher and keep translated options
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.
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.
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?
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.