When switching the language using the built-in language switcher block of Drupal on a Views page, the language prefix in the URL 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" - as configured in Views).

If this could be of any importance: I'm using the Fixed translation mode for my menu's ("Fixed Language. Menu items will have a global language and they will only show up for pages in that language." - admin/structure/menu/manage/main-menu/edit).

What could cause this kind of behaviour, and how can it be fixed?

(This issue originates form a Language switcher dropdown issue).

Comments

knalstaaf’s picture

Issue summary: View changes

bold

knalstaaf’s picture

Issue summary: View changes

multilingual options menu

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)
but the path given through Views doesn't.

So some of the url's of the fields aren't updated? Can you name which ones?

knalstaaf’s picture

The paths in the Page Settings of the View aren't updated. As you can see in the attached screenshots: the path of the English page should be "/faq", and the Serbian version "/pitanja". So it's not the fields I'm after, they're working fine afaik. My apologies if this wasn't clear.

When switching the language on such a page, the language prefix changes, but the path given through the View's Page settings doesn't.

dawehner’s picture

What you actually want is another url alias for the other language. Internal urls of drupal arent' translatable. For example you will always have node/123

knalstaaf’s picture

Correct, but it's not the internal url-system I'd like to translate.

E.g.: the website has a basic page (not created by Views) in two languages:

The language switch (upper right) handles these standard pages (nodes) perfectly. But when going to a page that's been created with Views, it doesn't seem to switch the translated path.

E.g.:

If a visitor uses the language switch to go from the Serbian FAQ to the English FAQ, the path changes from "/sr/pitanja" to "/en/pitanja", while the latter should be "/en/faq". This causes the title of the page being untranslated to English as well.

dawehner’s picture

Status: Postponed (maintainer needs more info) » Fixed

What you actually probably need is the i18n_path module which allows you to translate paths.
The node example just works because you have different aliases for different paths.

knalstaaf’s picture

The i18n_path module is enabled indeed.

I solved it by conducting the following actions:

  1. (I removed the Serbian Page display I made with Views, since I'm approaching it in another way now. Thus I'm left with just one -English- page display in the View.)
  2. I followed these instructions (instructions below editted to match my case):
    • (Create a Page in Views - already did this, see above: English page display)
    • Navigate to your newly created view, so Drupal adds the strings to the translation table.
    • Then go to Admin > Configuration > URL aliases (admin/config/search/path) and click Add alias
    • In Existing system path, enter the URL you just created for the English page display (eg "faq"; this will look like this: en/faq).
    • In Path alias, enter the URL you want in the other language (eg "pitanja" - Serbian translation for "questions"; this will look like this: sr/pitanja).
    • Make sure you set the language to the adjoining language (eg Serbian) and press Create new alias.
    • (Repeat the last three steps for every language)
  3. After this I went to the separate Serbian menu I made before (admin/structure/menu) and clicked list links.
  4. Added the menu item with the Serbian faq page manually (Add link) with the following settings:
    • Menu link title: Često postavljana pitanja
    • Path: faq (not "pitanja"!)
    • Saved it
  5. Eventually I translated the title through "Translate Interface" (admin/config/regional/translate/translate), by filling out the English title (Frequently asked questions <- case sensitive!) in the search box and filling out the Serbian translation in the proper field.

This seems to be doing the job in my case (separate menu for each language). Not as easy as I expected after all.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

so every language has its own menu