Hello,

On a multilingual site I see that the local tabs menu fragment link looks like authcache.php?a=&r=frag/menu-local-tabs&o[q]=node/552&v=yz4h13 and that makes the menu to be always served in the same language.
Since the cache granularity is Per user, Per page I was expecting the link to be something like authcache.php?a=&r=frag/menu-local-tabs&o[q]=[current-node-language]/node/552&v=yz4h13

Am I doing something wrong or this is the default behavior?

Thanks!

Comments

gge created an issue. See original summary.

znerol’s picture

What mechanism do you use to determine the users language?

gge’s picture

StatusFileSize
new154.26 KB

Sorry for the late reply

I'm using entity translation and the screenshot attached show the "Detection and selection" settings. The local tabs always show English language.

Thanks!

znerol’s picture

Category: Feature request » Bug report

I am able to reproduce. This looks a bit like a regression since I remember that this was working at some point: #1967694: ajax block in multilingual site.

znerol’s picture

Status: Active » Needs review
StatusFileSize
new1.04 KB

I did assume that $_GET is left unchanged, and thus it is possible to collect the original request parameters from there. Regrettably that it is not the case. E.g., the language prefix is stripped from $_GET['q'] in locale_language_from_url. Therefore it is necessary to add back that prefix when generating URLs for fragments.

@gge: Would you mind testing the attached patch and report back whether it resolves your particular problem?

gge’s picture

Tested it and problem solved.

Now the local tab language switches according to the node language and the cached fragment url does contain the language (authcache.php?a=&r=frag/menu-local-tabs&o[q]=[current-node-language]/node/...)

In my opinion the patch should be committed. Thank you very much for your help!

znerol’s picture

Status: Needs review » Reviewed & tested by the community

  • znerol committed a26ffa6 on 7.x-2.x
    Issue #2754707 by znerol, gge: Add language prefix to menu local tabs...
znerol’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.