ConfigNamesMapper::hasTranslation

public ConfigNamesMapper::hasTranslation(LanguageInterface $language)

Checks whether there is already a translation for this mapper.

Parameters

\Drupal\Core\Language\LanguageInterface $language: A language object.

Return value

bool TRUE if any of the configuration elements have a translation in the given language, FALSE otherwise.

Overrides ConfigMapperInterface::hasTranslation

File

core/modules/config_translation/src/ConfigNamesMapper.php, line 450

Class

ConfigNamesMapper
Configuration mapper base implementation.

Namespace

Drupal\config_translation

Code

public function hasTranslation(LanguageInterface $language) {
  foreach ($this->getConfigNames() as $name) {
    if ($this->localeConfigManager->hasTranslation($name, $language->getId())) {
      return TRUE;
    }
  }
  return FALSE;
}
doc_Drupal
2016-10-29 08:54:21
Comments
Leave a Comment

Please login to continue.