DEV Community

Discussion on: How to use a custom language switcher with Transposh to build a multi-language Wordpress website

Collapse
 
ceciljchen profile image
ceciljchen

Hey there. Thanks for the great tutorial on adding transposh languages to the menu. I'm so glad to have found a comprehensive resource that details how to do this with maximum ease. I was wondering if, in your implementation, the language buttons in the menu reload the home page in the selected language or whether they reload the current page in the selected language? For example, if the user is on example.com/after-hello and clicks on the ES language button in the menu, will the browser load example.com/es/after-hello or will it load example.com/es/ ?
Thanks and have a great day.

Collapse
 
codingfix1 profile image
codingfix

As I had promised I have updated the article adding what you need to do to reload current page with the new language.
Hope this help :)

Collapse
 
ceciljchen profile image
ceciljchen

Hi again. I really appreciate your follow-up and update, because as you guessed I had indeed attempted it. But it was inelegant and buggy so I continued my search after a while and actually came across the updated post on your website. I just want you to know that I have since implemented your script in my site and it has worked flawlessly. Thanks so much for for taking the time to provide all the information and help.

Thread Thread
 
codingfix1 profile image
codingfix

Glad to help you 😀

Collapse
 
codingfix1 profile image
codingfix

Hi ceciljchen, thank you for your kind words. I'm so glad you have found this article useful!
About your question, the buttons reload the home page in the selected language. To reload the current page, we should remove the link in the menu and add additional javascript code to our small script in order to build the correct url. Probably you can easily do it by yourself without waiting for my update to the article. :)