Problem/Motivation

As part of reviewing the schema file for the local.settings.yml I looked at the actual functionality and found it not clear and consistent.

This is how I see things (and it is possible that I am just not getting it)

yml configuration
The yml configuration uses two Boolean variables
overwrite_customized & overwrite_not_customized

Settings form
The settings form at admin/config/regional/translate/settings (locale.pages.in)
converts those two settings into three permutations
LOCALE_TRANSLATION_OVERWRITE_NONE => t("Don't overwrite existing translations."),
LOCALE_TRANSLATION_OVERWRITE_NON_CUSTOMIZED => t('Only overwrite imported translations, customized translations are kept.'),
LOCALE_TRANSLATION_OVERWRITE_ALL => t('Overwrite existing translations.'),

This looks incorrect to me see my comment for the issue [7160264-9]

The following code

<?php
  if ($config->get('translation.overwrite_not_customized') == FALSE) {
    $default = LOCALE_TRANSLATION_OVERWRITE_NONE;
  }
  elseif ($config->get('translation.overwrite_customized') == TRUE) {
    $default = LOCALE_TRANSLATION_OVERWRITE_ALL;
  }
  else {
    $default = LOCALE_TRANSLATION_OVERWRITE_NON_CUSTOMIZED;
  }
?>

suggests that overwrite_customized will have no impact if overwrite_not_customized is set to FALSE.
My understanding is that:
overwrite_not_customized == FALSE & overwrite_customized == TRUE
Is the same as:
don't override translations that come from community source (d.o) and do overwrite customize translations.

Configuration execution code
When searching for the code that actually uses the yml configuration I came across a function _locale_translation_default_update_options() that converts them into an array 'overwrite_options' that end up eventually in Gettext.php after being called from locale_translate_batch_import()
This is where I extracted my understanding of the significance of this settings.

Proposed resolution

  1. Review the settings form mapping of yml configuration logic

Disclaimer: I am new to most of this code and ran into this issue by accident so apologies if I am missing the point.

Comments

heyrocker’s picture

Status: Active » Closed (duplicate)
guy_schneerson’s picture

thanks @heyrocker d.o was playing up :)