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.

Tagged: 

This topic contains 13 replies, has 2 voices.

Last updated by Mihai Apetrei 1 year, 10 months ago.

Assisted by: Mihai Apetrei.

Author Posts
August 24, 2023 at 10:48 pm #14288365

nasrullahA-2

Tell us what you are trying to do? We are using WPML for multilanguage, we are using English and Spanish for main website, but for specific page we need to add more language, these language should not display in all website, but a person visit the specific page or menu will display,

Is there any documentation that you are following? I follow WPML documentation and Google didn't find anything specific.

Is there a similar example that we can see? I am not sure,

What is the link to your site? test.hesperian.org --> there will be two language (English and Spanish)

hidden link (But when you come here show many language as needed, English, Spanish, Arabic, Urdo...)

August 26, 2023 at 11:08 am #14294577

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

In the language switcher, you will only see the languages that have existing translated content for the specific page that you are on.

If the page you are on doesn't have an existing translation for Spanish for example, the Spanish flag won't show up in the language switcher.

I hope that you will find that information helpful 🙂

Mihai Apetrei

August 26, 2023 at 6:33 pm #14295203

nasrullahA-2

Hello Mihai Apetrei,
Thank you from your reply, still it is not clear, let me clarified the issue more,
we have a website (test.hesperian.org), when I am in the home page, in menu bar it should show only two language (English, Spanish) but when I come to APPS menu in same website, it list more language like Spanish, English, Arabic, Urdu, ... but if you come back to home page it show only Spanish and English, the APPS is not a page, it is a menu, so we cannot translate the menu, and inside the APPS menu there is a lot of other pages,

let me know if it is not clear.

best regards
Nasrullah Amirzai

August 28, 2023 at 6:13 pm #14302707

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there, Nasrullah.

Please check the site while logged out and NOT logged in.

I don't see anything else on both the homepage and the APPS page except the English and Spanish flags in the language switcher. There are no other languages showing up.

Mihai

August 28, 2023 at 6:20 pm #14302741

nasrullahA-2

Hello Mihai,

Yes, I have removed the german language, when I add the germen Language it appear in all website, where we want only in APPS menu,

I have added the German Language back, see now it appear in all menu and pages, where we want to display the Germen language only in APPS menu, example

when you are in test.hesperian.org it show Spanish and English

but when you are in test.hesperian.org/APPS it show Spanish, English and German

Best Regards
Nasrullah Amirzai

August 29, 2023 at 9:40 pm #14309303

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Nasrullah.

Currently, I see German in both versions, the home page, and the APPS page.

Attaching screenshots below.

Mihai

Screenshot 2023-08-30 at 00.39.24.png
Screenshot 2023-08-30 at 00.39.16.png
August 30, 2023 at 4:47 pm #14315199

nasrullahA-2

Hello Mihai,

Yes, I also see German language in boht Menu (Home and APPS) but we want to see the German Language only in APPS menu, not in home menu,

like, when you click on Home, there should be two language (Spanish and English)

But when you click on APPS menu, there should be three language (Spanish, English and German).

I hope it is clear now

Best Regards
Nasrullah Amirzai

September 1, 2023 at 8:40 pm #14329025

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there, Nasrullah.

The fact that German shows on the other pages where you wouldn't want it to show is probably because there's an existing translation in German for that specific page.

If you want to hide the German flag in specific pages (and if there are existing German translations for those pages), you would need to use custom CSS to hide it on each specific page by targeting the page IDs.

Here's a CSS example for hiding the German language flag on the homepage:


.page-id-25058 .menu-item-wpml-ls-186-de {

display: none !important;

}

This code can be added in Appearance > Customizer > Custom CSS area > add the code then save.

Mihai

September 1, 2023 at 11:31 pm #14329169

nasrullahA-2

Hello Mihai,
Thank you so much, it work, could you please give me CSS code if we want to display the German language only in specific page, and hide in all other pages.

I put that code, it hide from home page, but when I click on other pages like TOPICS, it show me, we want to display that language only in APPS,

Thanks

September 3, 2023 at 8:04 pm #14332795

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

This is just an example that you can use for further customization.

This type of request requires custom work (coding) and it falls out of the purpose of our Support Policy.

My recommendation is to hire a WPML contractor (https://wpml.org/contractors/) or a front-end developer if you need further help with the code.

Mihai

September 6, 2023 at 5:50 pm #14354487

nasrullahA-2

Hello Mihai,
Thank you so much, could you please list all id for the languages that are supported in WMPL, like for German language it is 186-de, what are for the reset of languages, like Arabic, Urdo, Pashto ... all languages that are listed in language tab of WPML.

E.g German: .menu-item-wpml-ls-186-de
Arabic?
Italian?
Portguese:?
Japanese: ?
and all others,

September 6, 2023 at 6:21 pm #14354585

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi there.

The ids and classes are dynamically generated by WordPress so there's no website that uses the same exact ids or classes for each language.

That's why I recommended a front-end developer, because here we are talking about unique ids and classes that someone who knows what they are doing has to go on your site and find all of that.

There's no list that we can share because it is impossible as the ids and classes are uniquely generated for each site.

Hope that this explains things a bit better.

Mihai

September 6, 2023 at 6:27 pm #14354619

nasrullahA-2

Thank you Mihai, I am talking the below code, this is from WPML which is unique code and cannot change, how you find 186 for German Language, can you please tell me how to find the code for Arabic language.

Thanks
Nasrullah Amirzai

code .png
September 7, 2023 at 6:46 pm #14362241

Mihai Apetrei
WPML Supporter since 03/2018

Languages: English (English )

Timezone: Europe/Bucharest (GMT+03:00)

Hi Nasrullah.

I was able to find the CSS class that I mentioned in the code I shared with you below by right-clicking on the German flag and selecting "inspect element".

Please take a look at some useful results below:
hidden link

Also, you can find the class of each page (this one for example: ".page-id-25058") in the "body" HTML tag.

This might sound like a different language for you because you probably never worked with front-end code. That's why I recommended hiring someone because this falls out of the purpose of our Support Policy.

This is the best I could do for this situation.

I hope that you will find all this information helpful. 🙂

Have a lovely rest of the day.

Mihai