/** * Gets configuration names associated with strings. * * @param array $lids * Array with string identifiers. * * @return array * Array of configuration object names. */ public function getStringNames(array $lids) { $names = array(); $locations = $this->localeStorage->getLocations(array('sid' => $lids, 'type' => 'configuration')); foreach ($locations as $location) { $names[$location->name] = $location->name; } return $names; }
/** * Updates the translation strings of shipped configuration. * * @param \Drupal\language\Config\LanguageConfigOverrideCrudEvent $event * The language configuration event. * @param $callable * A callable to apply to each translatable string of the configuration. */ protected function updateTranslationStrings(LanguageConfigOverrideCrudEvent $event, $callable) { $translation_config = $event->getLanguageConfigOverride(); $name = $translation_config->getName(); // Only do anything if the configuration was shipped. if ($this->stringStorage->getLocations(['type' => 'configuration', 'name' => $name])) { $source_config = $this->configFactory->getEditable($name); $schema = $this->localeConfigManager->get($name)->getTypedConfig(); $this->traverseSchema($schema, $source_config, $translation_config, $callable); } }