# Odd interaction with Discourse and Google Translate

**URL:** https://meta.discourse.org/t/odd-interaction-with-discourse-and-google-translate/315160
**Category:** Bug
**Created:** [July 5, 2024, 3:48pm UTC](https://meta.discourse.org/t/odd-interaction-with-discourse-and-google-translate/315160 "2024-07-05T15:48:26Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [July 5, 2024, 3:48pm UTC](https://meta.discourse.org/t/odd-interaction-with-discourse-and-google-translate/315160/1 "2024-07-05T15:48:26Z")

</div>

This was brought up by one of regular members that uses a Firefox add-on for page translation, but this seems to be independent of it and can be reproduced with any page in meta.

Steps:

1. go to [https://translate.google.com/](https://translate.google.com/)
2. paste a URL like `https://meta.discourse.org/t/using-discourse-index/308031`
3. hit the translate icon/button

You’ll likely land on a Discourse 404 page with a URL like this

> [https://meta-discourse-org.translate.goog/t/using-discourse-index/308031/t/using-discourse-index/308031?\_x\_tr\_sl=en&\_x\_tr\_tl=pt-PT&\_x\_tr\_hl=en&\_x\_tr\_pto=wapp&\_x\_tr\_hist=true](https://meta-discourse-org.translate.goog/t/using-discourse-index/308031/t/using-discourse-index/308031?_x_tr_sl=en&_x_tr_tl=pt-PT&_x_tr_hl=en&_x_tr_pto=wapp&_x_tr_hist=true)

Notice that the URL has the path `/t/using-discourse-index/308031` duplicated in it. Removing the duplicate fragment makes the translation work [as expected](https://meta-discourse-org.translate.goog/t/using-discourse-index/308031/?_x_tr_sl=en&_x_tr_tl=pt-PT&_x_tr_hl=en&_x_tr_pto=wapp&_x_tr_hist=true).

Normally this would be an issue with google translate, but it seems to only happen with Discourse (I’ve tried a few other websites) and after we updated to 3.2.

---

<div class="post-metadata">

### Author: ![mentalstring](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mentalstring/32/168934_2.png) [@mentalstring](https://meta.discourse.org/u/mentalstring)
#### Post date: [August 29, 2024, 4:30pm UTC](https://meta.discourse.org/t/odd-interaction-with-discourse-and-google-translate/315160/2 "2024-08-29T16:30:43Z")

</div>

Sorry for rehashing this, but I think I chose the wrong title (and angle) and it didn’t get the proper attention.

Right now, Discourse is **incompatible** with Google Translate which is likely the most used translation tool.

Any topic URL pasted into [Google Translate](https://translate.google.com/) always ends up with the 404 page being translated and not the actual topic. It works ok with the homepage and topic lists URLs – but not a topic.

Perhaps Google Translate is being fed some special crawler/print version that doesn’t work for this purpose?

I use Google Translate regularly and I only saw this behaviour with Discourse topics, so at least part of the issue appears to be in Discourse.

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [September 16, 2024, 4:15pm UTC](https://meta.discourse.org/t/odd-interaction-with-discourse-and-google-translate/315160/4 "2024-09-16T16:15:30Z")

</div>

It looks like this affects all Ember apps. For example, even Ember’s own [documentation app](https://guides.emberjs.com/release/services/)

 ![SCR-20240916-paie](https://global.discourse-cdn.com/meta/original/4X/c/2/6/c26426ef57218f1d2232222bc96a4696554ee662.png)

It looks like Google is proxying the site, injecting some Javascript, and injecting a `<base>` tag. We might be able to detect Google’s hacks and workaround the 404 issue… but I very much doubt any complex JS app like Discourse will work well through Google’s proxy.

A workaround is to use the translate functionality built in browsers (either native, or via an extension). Those do not have the same proxying/injecting behavior.
