Tell us what you are trying to do?
How can I customize the translation switcher in WPML plugin to display as a button and dynamically show the available languages based on the current language of the page content? For instance, if the page content is in English, the switcher should display the option to switch to the second languauge and it should show secondery launguage also
Is there a similar example that we can see? hidden link
check out launguage switcher of the website
Thank you for contacting WPML Support. I checked the language switcher style on example site and you should be able to achieve it by following the below steps:
1. Go to WPML >> Languages > Menu Language Switcher.
2. Edit the language switcher by clicking on the pencil icon and set the options according to your needs as you can see in the attached screenshot.
3. After that you can use the language switcher CSS selector “wpml-ls-item” and add the button CSS to it. Here an example code:
Yes Language Switcher Button: The language switcher should be a button or link that indicates the language it will switch to. Here's how it should work:
When the current language is English, the switcher should display "العربية" (Arabic).
When the current language is Arabic, the switcher should display "English".
Additionally, when the user clicks the switcher button, the page's language should immediately change to the selected language.
Thanks for the additional details. I visited your site and it seems you have added the CSS to the language switcher to make it look like a button.
1. To remove the flag from Menu Language Switcher, Please go to the WPML >> Languages > Menu Language Switcher and edit the language switcher by clicking on the pencil icon and setting the options as you can see in the attached screenshot.
2. To display the secondary language by clicking on the language switcher button, it is necessary to translate that page into that language first. So, please make sure you have translated your site pages into a secondary language so that it will switch the language when you click on that button.
I’ve tried the same steps on my test site and it seems to be working correctly as you can see in the attached screenshots.
Please let me know if you have any questions
Thank you
The topic ‘[Closed] i need help with launguage switcher button’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.