Reputation:
I have seen those Google Translate options appear at many websites I visit, allowing to select the language and then the pages are automatically translated to that language. [Screenshot]
Question in short:
How can I disable or choose languages from browser's in-built Google Tanslation tool?
Detailed Problem:
The Google Translate option selection dialog on mobile phones, it blocks some portion of my content from viewing to end user, . I have a web app (Next.js) project and I have some important buttons fixed at bottom of the screen. But whenever by site is visited, those button are getting covered with Google Translate leaving no clue that some content lies beneath it.
It's cool to allow selecting languages, but what if, instead of showing the Google Translate dialog box overlaying my content, I can add those language option on the navbar or somewhere in my web app itself, which can let users select the preferred language and translate my entire site accordingly?
I'm wondering if this is possible, via accessing any browser API or something? For example, my site is mainly based in India, so I need to have only 3 main languages as Marathi, Hindi and English. I can prompt users to select the language and then continue with same language on the entire website by telling the browser programmatically to select that language and translate all the pages, just like how Google Translate works but implicitly.
What I have looked for:
I have seen many questions on stackoverflow like these , which were asked almost 8 - 9 years ago, where in that period of time, there was a official tool provided by Google itself to translate sites. But, now it's discontinued because Google says:
We encourage users looking to translate webpages to use browsers that support translation natively.
But no additional information if a browser has Google Translation, we could access the translation tools via Browsers API or other methods.
Upvotes: 1
Views: 789
Reputation: 191
you can add to your HTML code to disable that the browser translates automatically your application content:
If you want to suggest to your users different languages translation using buttons on your web app, then you can consider using google API Cloud Translation which will be triggered by a Cloud Function embedded with every button on your UI.
Upvotes: 1