Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295813

If you don't want to translate your URL alias, the original URL alias won't work with your translations

$
0
0

Problem/Motivation

If you don't want to translate your URL alias, the original URL alias won't work with your translations.

Steps to reproduce:

  1. Install with standard
  2. Enable Language and Content Translation modules.
  3. Add a language (e.g. Spanish)
    • /admin/config/regional/language
  4. Edit Article content type, Language settings > Enable translation
    • /admin/structure/types/manage/article
  5. Go to content translation settings and check Content. Within Article, uncheck the URL alias field.
    • /admin/config/regional/content-language
  6. Create an Article, assign an URL alias in the form (e.g. /my-alias)
  7. Translate the node. The URL alias is prepopulated with your source alias (e.g. /my-alias).
  8. Submit the form.

Current outcome:
In the alias list (/admin/config/search/path), you have (/my-alias, EN).
Going to /es/my-alias gives a 404.

Expected outcome:
In the alias list, you should have (/my-alias, UND).
Going to /es/my-alias gives a 200 and displays the Spanish translation.

Proposed resolution

  • If the entity OR the path field are not translatable, save the path alias with the langcode 'und'.
  • If the entity AND the path field are translatable, save the path alias with the langcode of the entity (or translation).

Remaining tasks

  • Agree on proposed resolution
  • Review

User interface changes

None.

API changes

None.

Data model changes

None.


Viewing all articles
Browse latest Browse all 295813

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>