Problem/Motivation

#2851029: Disallow removing a language when there is content or config related to that language lists lots of data that is left around on the site when a language is removed as of this writing. Also node data is partially updated but is left in an unrecoverable state when the language is removed currently. Language may be at many places, some configuration may exist in the language, entity translations may exist, etc. There is not one good way to resolve that when removing a language so ideally the user is stopped from removing a language when there is still content in the language. That is discussed in #2851029: Disallow removing a language when there is content or config related to that language.

However there should be a way to hide languages from frontend users if the language should not be advertised from the site anymore, until the site admin figures out how to remove the data properly.

Steps to reproduce

Proposed resolution

Add the concept of disabled languages. There is https://www.drupal.org/project/disable_language already for this, so can be used as insipiration.

As disabled languages may be used to "stage" new languages for the site, we should not hide this language from the backend, but the frontend should not see that this language is there.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

gábor hojtsy created an issue. See original summary.

catch’s picture

I've never used the disabled languages module, but the functionality described in the issue summary looks about right to me. Not sure about the redirect, we might want to issue a 404 instead.

gábor hojtsy’s picture

gábor hojtsy’s picture

Also #1314250: Allow filtering/configuration of which languages apply to what (UI, nodes, files, etc) proposes different contexts of language where some contexts may have a different language list. I think that would overcomplicate things personally. Even having a disabled / enabled state would allow frontend contexts to hide the language and admin contexts to still get rid of the language.