I want to have my web both in English and Spanish so I want to add in the top right corner a button to switch between Spanish or English.
I can’t find a way to do this. ¿Anyone can tell me a way to do this? ¿How to have the web in two languages and have the option to switch from one to other?
Commonly one would use a language translate plugin to do this,
Recommended and used by Lay Theme users are:
And Q-translate XT:
Here on the Lay Theme Website we have some documentation on this:
Hope this helps and best wishes! :)
I have the texts translated to two languages (english and spanish). But I just want to do have a switch button in the top right torner to switch from English to Spanish (for international clients) . So what you recommend me to do for having the web like this? I dont want a translator. Just a duplicate of the web in a second language in the top right corner
That a tricky one,
Its dependent on the Permalink structure of your pages, normally the way a language plugin works:
You set a 'home' language - it our case english so we reach a page with the permalink :
However a language plugin will create a duplicate of each page and assign a language code to the permalink, so:
The language switch button makes all links clicked to have this /nl/ ( dutch ) placed in front of the standard permalink redirecting it to the correct language.
So my thoughts are you first need all the pages of a particular language to have a 'language code'.
Then you need a piece of jQuery, JS code added that first knows that your language button has been selected - probably via a simple cookie setup
Then if the browser knows that the button is pressed, it makes a links that are clicked to have your language code place into the permalink - redirecting you.
Its a tricky one but here are some references if they help you:
There is possibly a simpler option which is literally having two different website with the same domain - ( one being a subdomain )
Your main website is standard, then you create a subdomain e.g
( you can create a subdomain with your domain/hosting provider )
And the link in the top corner just takes you to a clone of the website but with the different langauge:
This is how i would go about it, if you don't want a plugin - it is the simpler option.
If this seems to complicated a task, you may wish to seek the Aid of a developer as this is an interesting one - there is unfortunately a good reason so many of us rely upon language plugins instead of doing the work manually
I hope this helps & apologies that the answer isn't as simple as may have been hoped
Best wishes and let me know, Have a great day :)
I don't answer or check forum DMs, please just post on the forum.