Odd interaction with Discourse and Google Translate

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/
  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

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.

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.

2 Likes