Il parametro ?tl si comporta in modo strano

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 Mi Piace