Can't translate content anymore

Created on 17 January 2025, 2 months 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.

  • πŸ‡³πŸ‡±Netherlands interactivex

    Hi Anna D,

    I tried your solution above to disable the fallback language, but unfortunately, it didn’t work. I’ve added a screen recording so you can see the issue. The problem is that when I enter the backend to edit a translation, the system doesn’t recognize the language. For example, in the admin environment, the /en-nl or /nl-nl prefix is missing from the URL.

    I think it has to do with the option "Exclude admin pages" is enabled and I can't disable it (see screenshot). Although there is a remark below that says "Not used, yet."

  • πŸ‡ΊπŸ‡¦Ukraine Anna D

    Hello Jessica Denkelaar,

    Thank you for providing the screen recording.

    Language-Country negotiation does not work on admin pages. I suggest enabling and configuring "URL (Path prefix)" and placing it after Language-Country negotiation so that LCN has higher priority. If the problem persists, try disabling "Account Administration Language" to see if the issue still occurs.

    Please keep us posted.

  • πŸ‡©πŸ‡ͺGermany simonbaese Berlin

    @interactivex, we added a new release to resolve ✨ Allow configuration option to include admin pages in negotiation Active . Please update the module and check whether this helps.

    As Anna mentioned, your language negotiation configuration is rather unusual. Please note that the order of the negotiation plugins is essential. So judging by the screen recording, the "Selected language" negotiation plugin will always fire before the "Language-country URL" plugin. Note that the "Selected language" plugin is usually used as a fallback and placed at the end of the negotiation chain.

    Further, when the "Exclude admin pages" configuration option is enabled in the language-country negotiation configuration, one needs a subsequent negotiation plugin to perform proper path processing.

    Do not hesitate to follow up on this issue.

  • πŸ‡©πŸ‡ͺGermany simonbaese Berlin
Production build 0.71.5 2024