How to change language on demand

How to change language on demand

I have a toggle button on my site.

What i am trying to do is to be able to switch between languages with a simple toggle button.

The function works as expected but it does not do anything to the chat button. The language doesn't change. Do i need to refresh the button? Or what is needed to do to accomplish this

Here is the code

 function cambioIdioma() {
            var checkBox = document.getElementById("toggle-switch1");

            if (checkBox.checked == true) 
               { $zoho.salesiq.language("es");
            }
            else {
                $zoho.salesiq.language("en");
            }
        } 
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方