You are here

function price_configurable_language_insert in Price 3.x

Same name and namespace in other branches
  1. 8 price.module \price_configurable_language_insert()
  2. 2.0.x price.module \price_configurable_language_insert()
  3. 2.x price.module \price_configurable_language_insert()
  4. 3.0.x price.module \price_configurable_language_insert()

Implements hook_ENTITY_TYPE_insert() for 'configurable_language'.

File

./price.module, line 28
Defines the Currency entity and the Price field.

Code

function price_configurable_language_insert(ConfigurableLanguage $language) {
  if (!\Drupal::isConfigSyncing()) {

    // Import currency translations for the new language.
    $importer = \Drupal::service('price.currency_importer');
    $importer
      ->importTranslations([
      $language
        ->getId(),
    ]);
  }
}