Hello all.

Currently, my understanding is that language_hierarchy makes it possible to have a global tree of languages, defining how languages should fallback to their parents.

As discussed in the issue https://www.drupal.org/node/2552663 we should try to work together so language_fallback and language_hierarchy merge at some point, if possible.

As mentioned in the above thread:

There is one situation where I believe language_hierarchy does not provide what language_fallback can do:
Here is my setup: I have 3 languages (en, fr, nl) and here is the behavior we're looking for:

  • When the site is displayed in EN: should fallback to FR, then NL
  • When the site is displayed in FR: should fallback to EN, then NL
  • When the site is displayed in NL: should fallback to FR, then EN

Because of the hierarchical nature of how language_hierarchy works, I don't believe the set-up above can be achieved with language_hierarchy. It works great for entities with language_fallback v2.x-dev.

James.williams summed it up quite well when he said that:

"essentially, that's about defining a different fallback structure, as in your case, each language actually has a different fallback based on the originally-requested language"

To me, looks like all functions language_hierarchy_get_*() would need to be rewritten for handling such a functionality.
The global gist being that $language->parent would potentially return a different value depending on the current language.

Any thoughts on this?

Comments

pacproduct created an issue. See original summary.

james.williams’s picture

Project: Language Hierarchy » Language fallback

Hi pacproduct, thanks for raising this. I had misunderstood that you were requesting this feature for D7, I'm very sorry! It's only for D8 and beyond that D8 is the single place for development on these features. For D7, the LH and Language Fallback projects are already divergent, so feature requests can be considered by either project.

Since language hierarchy has always been based around a single hierarchy, I don't think we'll ever have the time to implement this feature, as it effectively means defining a different hierarchy per-language, whereas that may be more suited to the existing approach of Language Fallback, as you had originally suggested.

So, I'm sorry to ping you around -- I'm going to move this request to the Language Fallback project, to see whether their maintainers would be more interested?

On the other hand, patches are always welcome if someone else has time to implement this, perhaps as a sub-module for either project!

pacproduct’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

Okay, well in this case there is nothing more to do here, as language_fallback does that already in its version 2.
The issue I faced is with menus, but I already raised a separate ticket for this: https://www.drupal.org/node/2856978

So I guess we can close this thread?

james.williams’s picture

Status: Active » Closed (works as designed)

Done :-)