Change record status: 
Project: 
Introduced in branch: 
10.3.x
Introduced in version: 
10.3.0
Description: 

Until now, the presence or absence of langcode: … for config objects or config entities has been entirely optional. Shipped configuration (i.e. default or optional configuration, in config/install/*.yml or config/optional/*.yml) has typically had no langcode key-value pair.

Sites that installed the locale module on the other hand had langcode: <default langcode> added automatically to all shipped configuration that was ever installed (thanks to \Drupal\locale\LocaleConfigManager::updateDefaultConfigLangcodes()).

That has now changed to:

  1. All config (shipped or otherwise) MUST contain a langcode for any config object that contains >=1 translatable values.
  2. All config (shipped or otherwise) MUST NOT contain a langcode for any config object that contains 0 translatable values.
Impacts: 
Site builders, administrators, editors
Module developers
Site templates, recipes and distribution developers

Comments

donquixote’s picture

Is there a doc page about the "langcode:" setting in a config record? I find https://www.drupal.org/docs/develop/creating-modules/defining-and-using-... but not sure if that is up to date.

I assume the purpose of the "langcode:" setting is to set the "origin" language of any string as they appear in the config record. Typically this would be 'en'. As a consequence, we would then want to translate from 'en' to 'de', and the German translation would be stored in a separate place (config/sync/language).

If a config record has a different language, e.g. 'langcode: de', this would mean that we now need to translate from 'de' to 'en', and the English translation would be stored in config/sync/language.
But is this actually how this works?