StudioSoulistic Posted January 16, 2022 Posted January 16, 2022 Site URL: https://sepia-mouse-arn5.squarespace.com/ Hi all, I used some code I found on Google to translate my Dutch website to English (through a Google Translate widget). It works perfectly and it does translate my Dutch content to English. However, I wish to add an option in the list to switch back to the original language. Could somebody please help me with that? Password: soulistic123 Code I used: Javascript: <script> var GoogleLanguages = 'en' </script> <div id="google_translate_element"></div> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({pageLanguage: 'nl', includedLanguages: GoogleLanguages, layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, 'google_translate_element'); } </script> <script src="https://storage.googleapis.com/squarestylist/translate-style.js"></script>
paul2009 Posted January 16, 2022 Posted January 16, 2022 1 hour ago, StudioSoulistic said: However, I wish to add an option in the list to switch back to the original language. You can add any languages you like! Simply edit the first script that you posted to include other language codes, for example for English, Dutch and French: <script> var GoogleLanguages = 'en,nl,fr'; </script> Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
StudioSoulistic Posted January 16, 2022 Author Posted January 16, 2022 1 hour ago, paul2009 said: You can add any languages you like! Simply edit the first script that you posted to include other language codes, for example for English, Dutch and French: <script> var GoogleLanguages = 'en,nl,fr'; </script> Hi Paul, Thank you for your reply! I tried this too but when I switch from English back to Dutch, it doesn't show the "original Dutch content" but it actually translates the English content to incorrect Dutch. I also included some titles in English on my Dutch website, and those will also get translated to Dutch and I would like to keep them in English. So I'm trying to find a way to return from English to my own written, Dutch content. I hope that makes sense, haha. Unfortunately, I haven't found a solution yet!
paul2009 Posted January 16, 2022 Posted January 16, 2022 12 minutes ago, StudioSoulistic said: it actually translates the English content to incorrect Dutch LOL. That's not helpful! To be honest, I was posting from memory about the original Google implementation. I haven't seen the version you are using, but it looks like someone has tried to re-style the original Google version and in doing so they have hidden the Google translate bar. That bar normally contains the 'Show Original' link which removes the translation and puts everything back into the native language. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
StudioSoulistic Posted January 16, 2022 Author Posted January 16, 2022 (edited) 1 hour ago, paul2009 said: LOL. That's not helpful! To be honest, I was posting from memory about the original Google implementation. I haven't seen the version you are using, but it looks like someone has tried to re-style the original Google version and in doing so they have hidden the Google translate bar. That bar normally contains the 'Show Original' link which removes the translation and puts everything back into the native language. I think it's a re-styled version indeed! Do you perhaps know where I can find the original version?:) I'll give that a try! Edited January 16, 2022 by StudioSoulistic
StudioSoulistic Posted January 17, 2022 Author Posted January 17, 2022 Is there someone else who's able to help me?
paul2009 Posted January 17, 2022 Posted January 17, 2022 On 1/16/2022 at 6:26 PM, StudioSoulistic said: Do you perhaps know where I can find the original version? You may find older articles describing workarounds, but the Google Translate widget was discontinued by Google in 2019 for new sites. Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment