class LocaleDefaultOptions

Same name and namespace in other branches
  1. 11.x core/modules/locale/src/LocaleDefaultOptions.php \Drupal\locale\LocaleDefaultOptions

Provides the locale default update options.

@internal

Hierarchy

Expanded class hierarchy of LocaleDefaultOptions

13 files declare their use of LocaleDefaultOptions
ImportForm.php in core/modules/locale/src/Form/ImportForm.php
install.core.inc in core/includes/install.core.inc
API functions for installing Drupal.
locale.compare.inc in core/modules/locale/locale.compare.inc
locale.install in core/modules/locale/locale.install
Install, update, and uninstall functions for the Locale module.
locale.module in core/modules/locale/locale.module

... See full list

File

core/modules/locale/src/LocaleDefaultOptions.php, line 12

Namespace

Drupal\locale
View source
class LocaleDefaultOptions {
  
  /**
   * Flag for locally not customized interface translation.
   *
   * Such translations are imported from .po files downloaded from
   * localize.drupal.org for example.
   */
  public const NOT_CUSTOMIZED = 0;
  
  /**
   * Flag for locally customized interface translation.
   *
   * Such translations are edited from their imported originals on the user
   * interface or are imported as customized.
   */
  public const CUSTOMIZED = 1;
  
  /**
   * Returns default import options for translation update.
   *
   * @return array
   *   Array of translation import options.
   */
  public static function updateOptions() : array {
    $config = \Drupal::config('locale.settings');
    return [
      'customized' => LocaleDefaultOptions::NOT_CUSTOMIZED,
      'overwrite_options' => [
        'not_customized' => $config->get('translation.overwrite_not_customized'),
        'customized' => $config->get('translation.overwrite_customized'),
      ],
      'finish_feedback' => TRUE,
      'use_remote' => $config->get('translation.use_source') == TranslationUpdateMode::RemoteAndLocal->value,
    ];
  }

}

Members

Title Sort descending Modifiers Object type Summary
LocaleDefaultOptions::CUSTOMIZED public constant Flag for locally customized interface translation.
LocaleDefaultOptions::NOT_CUSTOMIZED public constant Flag for locally not customized interface translation.
LocaleDefaultOptions::updateOptions public static function Returns default import options for translation update.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.