Problem/Motivation

When i create install profile for multilanguge site i need to provide default translated strings for different settings. In my case it is custom setting for custom search form block provided in custom module.
i put yml of the block into profile/config/install
my settingsis:
...
settings:
id: mymodule_search_block
label: 'My module search block'
provider: mymodule
label_display: '0'
form_type: global
text: ''
placeholder: 'Enter your search'

i also place translated string into profile/config/install/language/fr/ folder

settings:
label: 'My module search block'
placeholder: 'Saisir votre recherche'

also discribed schema yml file placed in mymodule/config/schema/ folder

block.settings.myblock:
type: block_settings
label: 'Search form block'
mapping:
placeholder:
type: label
label: 'Placeholder'

shema was checked with config_inspector module.
so placeholder is translatable setting of block config

but after install profile translated doesn't come into locale_target and then language config override disappear
after invoking http://cgit.drupalcode.org/drupal/tree/core/modules/locale/src/LocaleCon...
on the last install stage because it is translatable setting and because it is not present in locale.

So it looks like bug that it doesn't come to locale during installation.

Comments

denis_kv created an issue. See original summary.

denis_kv’s picture

Issue summary: View changes
denis_kv’s picture

Issue summary: View changes
andypost’s picture

Component: content_translation.module » config_translation.module
Issue tags: -translation configuration +D8MI, +language-config, +sprint
andypost’s picture

Confirm that core does not automatically import overrides
the fix is http://cgit.drupalcode.org/multilingual_demo/tree/multilingual_demo.prof...

andypost’s picture

Steps to reproduce
1) create install profile with some additional language (ru)
2) add language/ru dir with some translated config
3) use drush to install site (default en locale used)
4) config overrides from language/ru are not imported

This because $override is not new in http://cgit.drupalcode.org/drupal/tree/core/modules/locale/src/LocaleCon... so it deleted

Gábor Hojtsy’s picture

IMHO #2845437: Process translation config files for custom modules is a duplicate of this one, we need to decide which one to close.

Gábor Hojtsy’s picture

Status: Active » Closed (duplicate)
Issue tags: -sprint

Closing this one since the other one has more info on steps to reproduce, but will bring over #6 there.

Gábor Hojtsy’s picture

Issue tags: +SprintWeekend2017
andypost’s picture

wesleydv’s picture

We encountered this issue when developing a multilingual distribution.
We copied to code from .profile file in https://www.drupal.org/project/multilingual_demo to overcome it.

We also applied this patch https://www.drupal.org/files/issues/translate_entity_processor_field_agg... from this issue https://www.drupal.org/node/2650434

However we’ve noticed that field label translations kept loosing their translation after we did a locale-update

The only solution we could find is to also add the strings in a .po file that is imported.

I’m not sure if it is related to this issue, if not we can still create a separate issue.
But my colleagues and I spend way too much time on this, to not document it here ;-).

We plan to opensource this distribution, so I will add a new comment as soon as that is done (normally next week) so everybody can see exactly what we did.