0

I created a website with Drupal 8 in 4 languages. When I access a node in the default (English) language, I get to a page with a path of e.g. localhost/contact, just as it should be. Now, when I switch to Japanese, I would expect it to be localhost/jp/contact, but it is localhost/jp/node/13 (the page does display though). Both nodes have the same path listed (/contact) when I inspect them in the administration area.

For the record, my language detection methods are set in this order, in case it matters:

  1. Account administration pages
  2. URL (note: URL path prefixes are configured)
  3. Session
  4. User
  5. Browser
  6. Selected language

How can I achieve the expected state I mentioned above? That is, having the same (relative) paths set for each language variant of a node, while the language part of the URL would ensure displaying the proper language version of the node and while the URL would be human-readable and not just the node ID?

2

You either need to make your aliases not language specific (you can only do that in the alias administration page right now, not in the node edit form) or you need to create one for each language.

If the alias shows up for all languages, make sure you made the path field translatable in the content translation settings, maybe something doesn't work correctly otherwise.

See https://www.drupal.org/node/2775275 for an issue to allow language-unspecific aliases. You could also use tokens to get the original language with pathauto to work around it.

  • I thought that if I would be able to do this, if the paths could stay the same regardless the language, all the links on the website could also be the same regardless the language. Pitty, that would make administration somewhat easier in our environment. I'll try to manually adjust the paths, since they are configured to be translatable. – Ondrej Aug 9 '16 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.