Skip Navigation

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

Problem:
The client wants to set languages in the main header and footer menus using only two letters (RU / ET) and desires a dropdown menu where languages are written in full, but the parent item displays only two capital letters, similar to a website they referenced.
Solution:
We recommend the following steps to customize the language names on your language switcher:
- Go to WPML >> Languages >> Edit Languages.
- Add RU, ET in the Translation text boxes.
- Press the Save button.
This setting will apply to all language switchers on your site.
However, displaying the parent language switcher item with a short name and dropdown items with full names using the built-in feature of WPML is not possible. To achieve this, you may need to build a custom language switcher using some custom code with the help of the wpml_active_languages hook. You can find more details here.
Note that this is considered custom coding, which is outside the scope of our standard support.

If this solution does not fully address your issue or if it becomes irrelevant due to updates or different circumstances, we highly recommend checking related known issues here, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket here.

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.

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Noman 11 months, 3 weeks ago.

Assisted by: Noman.

Author Posts
May 9, 2024 at 9:18 am #15609608

dmitriS-6

I want to set languages in my main header menu as well as in the footer with 2 letters only RU / ET
Would be great to make language switcher like on this website: hidden link
as a drop-down menu where languages are written in full, but the parent item has only 2 capital letters.

I looked through the articles on your site and has not found one.

Is there a similar example that we can see? Yes, here hidden link

What is the link to your site? eva.promo4u.ee

May 9, 2024 at 11:10 am #15610099

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. You can customize the language names on language switcher by following the below steps:

- Please Go to WPML >> Languages >> Edit Languages.
- Add RU, ET in Translation text boxes as you can see in the attached screenshot.
- Press the Save button.

This settings will apply to all languages switchers to your site.

Please note that it’s not possible to display the parent language switcher item with short name and dropdown items with full names using the built-in feature of WPML. To achieve it, you may build a custom language switcher through some custom code with the help of wpml_active_languages hook and customize it according to your needs. You can see more details here: https://wpml.org/wpml-hook/wpml_active_languages/

This is considered custom coding so it's outside the scope of our support. this doesn't mean we won't be able to help you but we can't create code for you and we're restricted on how we can help you regarding this.

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

Edit_Languages_link.png
Translation_text_boxes1.png
May 9, 2024 at 2:07 pm #15610930

dmitriS-6

Hello Noman.
Thank you for your help!
I edited the languages accordingly.

Now I have again the same problem that we already discussed with you earlier: I set the colour of the active (current) language as light - green, as it is seen in settings (see the screenshot). But in reality on the site in the footer (footer area#6) the active language is still grey somehow.
The same goes for mobile devices (footer area #4) - see another screenshot.

How can i fix it?

Screenshot 2024-05-09 at 17.06.15.png
IMG_4C7F546EED08-1.jpeg
Screenshot 2024-05-09 at 17.01.44.png
May 9, 2024 at 3:43 pm #15611428

Noman
WPML Supporter since 06/2016

Languages: English (English )

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

I’ve examined the source of the page and it seems the theme CSS overrides the WPML plugin CSS that’s why CSS is not being applied properly as you can see in the attached screenshots.

Can you please try to add the below CSS:

.wpml-ls-current-language > a span {
    color: #9ed60a !important;
}

In the custom CSS section of your theme and see if this resolves the issue.

Thank you

color override.png
theme CSS overrides the wpml css.png