Can't translate content anymore

Created on 17 January 2025, about 1 month ago

Problem/Motivation

When the module is installed and countries with languages are added, the front-end functionality works correctly. However, if I attempt to translate a node, clicking "Edit" redirects me to the source language version of the node instead of staying in the desired translation context. This seems to occur because there is no language prefix applied on admin pages.

Steps to reproduce

  • Install the Language Country Negotiation module.
  • Add countries and assign languages.
  • Set up a translatable content type.
  • Attempt to edit a node in a language other than the source language.

Expected Behavior

The edit page should respect the current language context when translating nodes and allow editing in the selected language.

Actual Behavior

The edit page defaults to the source language version of the node, ignoring the language context.

Possible cause

This issue likely occurs because there is no language prefix applied to admin pages, which causes the language negotiation to default to the source language.

πŸ› Bug report
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡³πŸ‡±Netherlands interactivex

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @interactivex
  • πŸ‡ΊπŸ‡¦Ukraine Anna D

    Thank you, @interactivex, for reporting this issue.

    I have investigated the problem, and it seems that you have enabled the fallback mechanism under Configuration > Region and Language > Languages > Language-Country Fallbacks. This setting allows pages to be displayed with a fallback translation.

    For example:

    • Suppose Canada is set up with English and French as available languages.
    • Node A has only an English translation.
    • Accessing /en-ca/node-a will display the English translation with an English interface.
    • Accessing /fr-ca/node-a will display the fallback English translation with a French interface.

    On the /fr-ca/node-a we will see the edit link (/fr/node/x/edit). Edit page displays the source translation with a French interface instead of allowing the creation of a new French translation. However, this is a Drupal behavior and not a bug in the module.

    We can disable the module and check that:

    /fr/node/x/edit displaying the French translation if it exists.
    /fr/node/x/edit displaying the source translation if the French translation does not exist.

    Please let me know if you need further clarification.

  • πŸ‡ΊπŸ‡¦Ukraine Anna D
Production build 0.71.5 2024