Language switcher dropdown uses the same default path for all languages unlike the default switcher (Language switcher (User interface text)).

For example, let's say we have two nodes:

node/1, English
node/2, Spanish

The user is currently viewing node/2 (Spanish node). When using the default switcher, the English link points to node/1 and the Spanish link points to node/2. Clicking on English correctly switches the language and loads node/1.

However when using Language switcher dropdown in the same scenario, the English option correctly switches the languages, but reloads node/2.

(Fixed for nodes using the Language switcher dropdown [patch]. Issue remains for View pages, see #6)

CommentFileSizeAuthor
#3 href_fix.patch502 bytesjohnhanley

Comments

johnhanley’s picture

Title: All paths point to same default node » javacript error; doesn't preserve context

After some further investigating, I can confirm the same path is used for all language options.

johnhanley’s picture

Title: javacript error; doesn't preserve context » All paths point to same default node
johnhanley’s picture

Title: javacript error; doesn't preserve context » All paths point to same default node
Status: Active » Needs review
StatusFileSize
new502 bytes

The attached patch correctly defines the path for each corresponding translated node when switching from one language to another. If the href attribute doesn't exist for a particular language, the current path is used.

wranvaud’s picture

I confirm this happens but haven't tried the patch, I'm just going to disable the module, not so important to me at this point.
PS: I like your user name :)

psykasso’s picture

I tried the patch and i can confirm that it solved the problem in my case.

Thanx!

jdvisagie’s picture

Hey guys,
Applied patch and it worked for all my page nodes. However, when viewing a Views Page, the issue remains.
Does not re-load required translated url.

Simple fix out there?
Thanks!

knalstaaf’s picture

Title: All paths point to same default node » All paths point to same node and view path when switching (only language prefix changes)
Priority: Normal » Major
Status: Needs review » Active

Confirming the issue as mentionned in #6: this is still an issue for Views pages.

When switching the language using the language dropdown on a Views page, the language prefix changes, but the path given through Views doesn't.

E.g.: switching the language from english ( /en/all-titles ) to french, results in "/fr/all-titles" (instead of the supposed "/fr/tous-les-titres").

knalstaaf’s picture

Title: All paths point to same node and view path when switching (only language prefix changes) » All paths point to same view path when switching the language (only prefix changes)
Project: Language Switcher Dropdown » Views (for Drupal 7)
Version: 7.x-1.x-dev » 7.x-3.x-dev

When testing this with the built-in language switcher block of Drupal (which shows the same behaviour), it occurs to me that this must be a Views issue.

But do correct me if I'm wrong, since this is a mere guess.

knalstaaf’s picture

Project: Views (for Drupal 7) » Language Switcher Dropdown
Issue summary: View changes

Updated description of the bug.

knalstaaf’s picture

Issue summary: View changes

Skip fixed issues

knalstaaf’s picture

Issue summary: View changes

move to #7

knalstaaf’s picture

Issue summary: View changes

#6 actually

knalstaaf’s picture

Issue summary: View changes

patch link

knalstaaf’s picture

Version: 7.x-3.x-dev » 7.x-1.x-dev
Priority: Major » Normal
Status: Active » Needs review

Moved this back to its original module, and filed a new issue for Views to avoid confusion.

mohammed j. razem’s picture

Status: Needs review » Fixed

Should be fixed in new 7.x-1.0 release.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

mentionning original module