?tl parameter behaving oddly

So I noticed something odd. As you might know, sometimes it produces better search results when you use Google to search Meta . So I went to Google, entered my query, found my topic, and suddenly noticed that the topic title in the browser tab (not in the topic itself!) and the name of the category, and that category alone, were translated into Dutch.

Oddly, this disappeared when I clicked to another page on Meta.

After some confusion I found that this was caused by the fact that the topic had ?tl=nl attached to the URL, and that this was added by Google.

So I’m logged in, and the tl parameter was only supposed to work for anonymous users. But apparently it does affect some elements if you’re logged in.

Now let’s try this while logged out and see what happens. That should work, right?

Well. Not really.

So back to why this parameter ended up in a search engine.

As a matter of fact, the topic appears twice in Google, once with ?tl=nl and once without. Funny detail is that the title and snippet of the one with the parameter are not in Dutch, it’s in English just like the other one.

To make things more interesting, the canonical URL in the source does not have the parameter, so why Google indexed it with the parameter is unclear to me.

<link rel="canonical" href="https://meta.discourse.org/t/how-to-have-multiple-copies-of-default-theme/359789">

So we have:

  • the tl parameter is only supposed to work for anonymous users (per the description of Set locale from param setting) but for logged in users it does affect the <title> and category.

  • it somehow ends up in Google (although I wouldn’t know how to prevent this since Google apparently ignores canonical ?)

  • for anonymous users the tl parameter works only partially and it does not persist. It is not passed between requests and it does not seem to be setting a cookie (at least, not on Meta)

    • set ?tl
    • everything is Chinese :tada:
    • navigate to a topic
    • see how only the categories are in Chinese :sob:
    • navigate “back”
    • see how the welcome banner, categories are still in Chinese but the topics are English :thinking:

4 Likes

Hey, thanks for helping us try out translated search results (albeit incidentally) and reporting your findings. Much appreciated.

I can address a few of the items here but will also need you to answer some questions

  • What language is your browser set to when you searched on Google?
  • What search term are you using?

Somehow it appears your browser settings might be Dutch (which explains “Meer om te vragen”) but your search term is in English.


The topic you’ve referred to (How to have multiple copies of Default theme?) unfortunately is showing up as such because

  • the topic title is translated :check_mark:
  • none of the posts are translated :cross_mark:

That is why we see all posts in English (at this point of time) but the title is in Dutch.


The tl parameter setting was added long before we introduced crawler indexing for translations…

Technically speaking, the locale param should only be considered for anonymous users. Can you confirm what your user profile language is?


The typical user flow that this is generally built for is like this:

  • Diego has browser language settings to Spanish
  • He searches for problem in Spanish
  • He sees a result leading to meta (it ends with tl=es)
  • He goes into meta, reads the result in Spanish
  • He continues surfing the site in meta (because his browser language is set to Spanish)

There are a few things at play here which could throw things off course, like if the topic’s posts have not been translated yet as above, which is likely (can’t say for sure) the reason why you saw two results in Google since we’re presenting English as Dutch. One of the things we internally decided to do was believe in eventual consistency, though I would have to check why those quite-new posts have not yet been translated since April.