Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Noman 7 hours, 19 minutes ago.

Assisted by: Noman.

Author Posts
November 7, 2024 at 1:08 pm #16377281

walterS-22

Background of the issue:
I am trying to configure the language switcher in the nav bar of my site hidden link. I want the switcher to show the name of the other language instead of the active language. The website is built using Gutenberg-blocks.

Symptoms:
The language switcher currently shows only two letters representing the active language (German), but I want it to display the name of the other language (French).

Questions:
How can I configure the language switcher-block to show the name of the other language instead of the active one?

November 7, 2024 at 2:18 pm #16378075

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. Currently it’s not possible to hide the current language using the Language Switcher block. This feature request is already submitted to our developers and I’ll add your ticket link there to up vote it.

As a solution, you may try any of the below methods:

Method 1: hide the current language using CSS
1. Edit the Language Switcher block.
2. Set the “Layout” to list as you can see in the attached screenshot.
3. Add the below CSS in the custom CSS section of the theme:

.wpml-language-switcher-block li[data-wpml="current-language-item"] {
    display: none !important;
}

Method 2: Add language switcher using shortcode
1. Go to the WPML >> Languages page.
2. Enable the Custom Language Switcher as you can see in the attached screenshot.
3. Replace the language switcher block with short code block and use the below short code:

[wpml_language_selector_widget]

Here is a doc for more details:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/adding-language-switchers-using-php-and-shortcodes/#language-switcher-shortcodes

Please let me know if this resolves the issue or if you need further assistance with this issue.
Thank you

Block settings.png
enable custom language swithcer.png