1. Set a custom error page node at /admin/config/system/site-information for English.
  2. Translate (with 'Content translation' in Core) this node to German.
  3. Set the translated node as the custom error page node for German (with the help of i18n multilingual variables at /admin/config/regional/i18n/variable)
  4. Now visit a 404 triggering page: works as expected, the wrong URL is active
  5. Now switch to the other language with the language switcher: the real error page node URL is active, not the 404 triggering page

Expected behaviour: keep the wrong URL active, when you visit a translated error page (but switch the language prefix, of course).

Example:
You try to visit /en/node/42, which is not existent → 404 error.
You switch to the German error page → it should have the URL /de/node/42, and not the path of the error page itself (/404 for example).

(that is the way the default error page works, if you set no custom error page)

Comments

naxoc’s picture

Project: Drupal core » Internationalization
Version: 7.x-dev » 7.x-1.x-dev
Component: locale.module » Miscellaneous

I verified that the bug exists, but it is not Drupal core that is responisble for the localized variables, so I'm moving this to i18n.

Jose Reyero’s picture

Category: bug » support
Status: Active » Closed (works as designed)

I don't think this is a bug, though it may be more of a philosophical discussion. But once you provide a link from a page it doesn't make sense it is also a 404 itself.

*It should be a valid page because it is a link you provided from your site*

If any, it is a Drupal core issue because it is Drupal core 'who' decides the language switcher link for a 'page not found' is the translation of the node you used in the first place. Having multilingual variables enabled doesn't really change that.

I would call a bug the fact that Drupal core blindly links en/wrongpath to es/wrongpath and even printing links on your page that lead to a 'page not found'.

Anyway if you want a workaround for your 'expected behavior', set different page not found paths that are not translations of each other or use some custom block to switch these links.

Jose Reyero’s picture

Issue summary: View changes

added clarification of the default error page behaviour