Implements TranslatableInterface::getTranslationLanguages().
Overrides Entity::getTranslationLanguages
public function getTranslationLanguages($include_default = TRUE) {
$translations = array();
// Build an array with the translation langcodes set as keys.
foreach ($this
->getProperties() as $name => $property) {
if (isset($this->values[$name])) {
$translations += $this->values[$name];
}
$translations += $this->fields[$name];
}
unset($translations[LANGUAGE_DEFAULT]);
if ($include_default) {
$translations[$this
->language()->langcode] = TRUE;
}
// Now get languages based upon translation langcodes. Empty languages must
// be filtered out as they concern empty/unset properties.
$languages = array_intersect_key(language_list(LANGUAGE_ALL), array_filter($translations));
return $languages;
}