Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Add different language option to the web

Add different language option to the web

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 530 Views
  • 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 Offline
    M Offline
    mauellano
    wrote on last edited by
    #1

    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
    0
    • RichardR Offline
      RichardR Offline
      Richard
      Global Moderator
      wrote on last edited by
      #2

      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
      0
      • M Offline
        M Offline
        mauellano
        wrote on last edited by
        #3

        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
        0
        • RichardR Offline
          RichardR Offline
          Richard
          Global Moderator
          wrote on last edited by
          #4

          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
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          I also code custom websites or custom Lay features.
          💿 Email me here: 💿
          info@laytheme.com

          Before you post:
          1. When using a WordPress Cache plugin, disable it or clear your cache.
          2. Update Lay Theme and all Lay Theme Addons
          3. Disable all Plugins
          4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

          This often solves issues you might run into

          When you post:
          1. Post a link to where the problem is
          2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
          3. If the problem is difficult to explain, post screenshots / link to a video to explain it
          Online Users
          B
          barrybianco
          E
          eduardocaballero
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search