Undefined-language pages need search and link differences when accessed via a foreign-language URL

Created on 8 August 2014, over 10 years ago
Updated 25 March 2025, 9 days ago

Currently, a page in an undefined language doesn't have any special code when viewed using a foreign-language URL, e.g., /node/2 viewed as /es/node/2 instead. This causes a number of issues:

1. Google and other search engines that happen upon the page index the page with the wrong URL.
2. Humans coming across the foreign URL may link to the foreign URL without realizing it.
3. Problems 1 and 2 multiply and feed upon each other as the site grows.
4. If subsequently the admin adds translations to site template elements, suddenly English-readers (or native readers for a site in a different native language) see pages that previously appeared to them to be in English suddenly sprout elements in other languages but with English body content. They are also then at a loss to get to a "normal" English version of the page since they don't usually examine the URL.

I suggest that:
1. If D8 displays an English or undefined/unspecified page using a foreign-language URL, that it add a robots noindex metatag.
2. If D8 displays such a page, that it add a link English which goes to the English version of the URL.
3. Optionally, if D8 displays such a page to anyone whose role allows them to edit the site, that they instead be automatically redirected to the English version of the URL; this will reduce staff errors when/if they copy the URL for linking purposes.
4. That once this is part of D8, that it be backported to D7, where it is also an issue.

Steps:
1. Create site
2. Go to /admin/modules
3. Check add Content Translation
4. Check Language
5. Click save
6. Go to /admin/config/regional/language
7. Add language Spanish
8. Save
9. Go to /admin/structure/types/manage/page
10. Check Show language selector on create and edit pages
11. Check Enable translation
12. Save
13. Go to /node/add/page
14. Set language to --Not Specified--
15. Enter page content
Title page 1
Body This page will not be translated.
16. Save and publish
17. Log out
18. Go to /es/node/1

Actual: No link to /node/1
Expected: Link to /node/1
(For this issue I don't expect the reverse. That is /node/1 would not link to /es/node/1.)

19. View source:

Actual: No robots noindex metatag
Expected: Robots noindex metatag
(/node/1 would not have this metatag unless something outside the scope of this issue were to cause it, e.g., the metatag is added to all nodes of the content type that /node/1 has as its content type)

20. Log in
21. Go to /es/node/1

Two options:

Option 1: Same as for non-editing users.
Option 2:

Actual: No redirect to /node/1
Expected: Redirect to /node/1
(Perhaps this would be an admin setting, to allow for the possibility of a site where some staff would legitimately be navigating the site using foreign-language URLs.)

✨ Feature request
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

language.module

Created by

πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for sharing your idea for improving Drupal.

    We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

    This has not been implemented. In 11.1-dev, the steps still produce the result that I documented.

    That said, this is no longer an issue for us as we no longer give editors the ability to set a page language, and we automatically set all new pages to English.

  • πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US
Production build 0.71.5 2024