After having read https://www.drupal.org/docs/8/api/translation-api/overview and in particular Translation for shipped configuration and configuration schemas I tried to use this ability to have translatable text inside a YML config file :

uuid: 81b1dc30-4163-4d40-a62f-5eb6cc3193a9
    type: string
    label: 'Default language'
status: true
    - field.storage.user.field_first_name
    - user
id: user.user.field_first_name
field_name: field_first_name
entity_type: user
bundle: user
    type: text
    label: 'First name'
description: ''
required: true
translatable: false
default_value: {  }
default_value_callback: ''
settings: {  }
field_type: string

I'd rather use this technique because otherwise as my site is used in several countries I would need to split each config file that includes a translation which makes the YML files maintenance more complex.

When I run drush cim I have the following error

The import failed due to the following reasons: Unexpected error during import with operation update for field.field.user.u ser.field_first_name: The configuration property langcode.type doesn't exist.

To be honnest I don't have enough Drupal expertise to understand the problem. Do you have any idea ?

put on hold as too broad by kiamlaluno Jul 20 at 1:33

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


Found why my test was incorrect : I was trying to modify the configuration file using the directives normally designed for the configuration schema (not the configuration file contents itself). Turned out my configuration value was already translated.

Not the answer you're looking for? Browse other questions tagged or ask your own question.