Just wondering if this module works correctly with Entity Translation?

Cross-posting a question from @rolfo85 at #1954036: [D7] Neutral Paths:

Hi,

I have a problem. I work with Entity Translation and neutral_paths.
For default setting i have checked the language fallback.
I have a new contents for default language in italian and the alias work correctly because are the same of italian language (also in the other languages, english for example).

Example:

"Chi siamo" (new contents created in italian language and not translated in other languages)
alias: "chi-siamo" (the alias is the same in all languages) Perfect !

The problem

If i translate the node "Chi siamo" in english for example, the result will be "About us" and the alias will be "about-us" good ! BUT.... if i switch to the italian languages, the node "Chi siamo" will have the alias "about-us" not "chi-siamo" .

Every translation of node that will be editing, will have the same alias shared in 2 languages. This things is correctly only if i don't have translations.

Can you help me ?

Comments

dddave’s picture

Version: » 7.x-1.x-dev
Category: Support request » Bug report

Not sure if bug or works as designed. Correcting metadata.

ao2’s picture

It is not clear to me if the original author of the question was referring specifically to neutral_paths or if his problem was more general.

Either way the D8 version of neutral_paths does work with entity translations.
Can I close this issue?

Thanks,
Antonio

ao2’s picture

I am starting to understand the problem with neutral_paths and entity translations.

When using the old content translations two different translations would have different internal node ids, and so drupal is able to differentiate between them by the node/[nid] path, even if the alias is language neutral.

For example:

  • (/node/1, /chi-siamo, LANGUAGE_NONE)
  • (/node/2, /about-us, LANGUAGE_NONE)


Given the alias, it's possible to differentiate the nodes.

Conversely, when using entity translations all the different aliases for the different translations would all point to the same entity path node/[nid], and if the alias is language neutral then drupal has no way to identify to what translation the alias refers.

For example:

  • (/node/1, /chi-siamo, LANGUAGE_NONE)
  • (/node/1, /about-us, LANGUAGE_NONE)


The alias alone is not enough to figure out what translation it refers to, the alias language is necessary too.

So I am starting to think that language neutral aliases does not make sense in drupal 8, while it's true that making an alias language neutral allows to access it regardless of the current interface language, it's ambiguous what translation that alias refers to.

Does the reasoning above makes sense?

Maybe a solution to allow the selection of and entity translation by using the alias from any interface language could work at the routing level implementing content language negotiation by inspecting the alias language.

I'll look into that.

ao2’s picture

Some more thoughts.

A drupal 8 version of Neutral paths could still have sense in the original use case: a site with content in a single language with user languages different from the site language, to allow users to still use the aliases.

It just could not work for multi language sites to because it breaks the translation selection mechanism when using entity translations.

ao2’s picture

Version: 7.x-1.x-dev » 8.x-1.x-dev
Status: Active » Closed (won't fix)

Closing as won't fix for Drupal 8.

Solution to this problem are provided by the Language Neutral Aliases and Alias Language Negotiation modules.