Lay Theme Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Add different language option to the web

    General Discussion
    2
    4
    116
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mauellano last edited by

      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?

      1 Reply Last reply Reply Quote 0
      • Richard
        Richard Global Moderator last edited by

        Dear @mauellano

        Commonly one would use a language translate plugin to do this,
        Recommended and used by Lay Theme users are:

        Polylang:
        https://polylang.pro/

        And Q-translate XT:
        https://github.com/qtranslate/qtranslate-xt

        Here on the Lay Theme Website we have some documentation on this:
        https://laytheme.com/documentation.html#multilanguage

        Hope this helps and best wishes! :)

        Richard

        1 Reply Last reply Reply Quote 0
        • M
          mauellano last edited by

          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

          1 Reply Last reply Reply Quote 0
          • Richard
            Richard Global Moderator last edited by

            Dear @mauellano

            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 :

            example.com/pageabout

            However a language plugin will create a duplicate of each page and assign a language code to the permalink, so:

            example.com/nl/pageabout

            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:

            https://stackoverflow.com/questions/1458724/how-do-i-set-unset-a-cookie-with-jquery

            https://stackoverflow.com/questions/20475504/onclick-change-url-using-jquery

            https://wordpress.stackexchange.com/questions/89382/creating-custom-permalink-structure-for-languages

            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

            nl.example.com

            ( 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:

            https://premium.wpmudev.org/blog/multilingual-wordpress-site-multisite/

            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 :)

            Sincerely
            Richard

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Try this to fix issues before you post:

            Use the Search Feature. Maybe there is already a solution to your issue.

            1. Update Lay Theme and all Lay Theme Addons
            2. Disable all Plugins
            3. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code ", click "Save Changes"
            4. Now see if your problem solved itself
            5. Go here, see if your problem is listed here:
            Troubleshooting

            When you post:
            1. Post a link to where the problem is
            2. If the problem is difficult to explain, post screenshots / link to a video to explain it

            Thanks!

            Online Users

            M
            I
            M
            L
            G

            Recent Topics

            • text underline

            • open all links in a thumbnail grid in a new tab

            • lazy loading affects project thumbnail mouseover images

            laytheme.com