You are here

public function LingotekEntity::getSourceLocale in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getSourceLocale()
  2. 7.5 lib/Drupal/lingotek/LingotekEntity.php \LingotekEntity::getSourceLocale()

Overrides LingotekTranslatableEntity::getSourceLocale

File

lib/Drupal/lingotek/LingotekEntity.php, line 334
Defines LingotekEntity.

Class

LingotekEntity
A class wrapper for Lingotek-specific behavior on nodes.

Code

public function getSourceLocale() {
  if ($this->entity_type == 'taxonomy_term') {
    $vocabulary = taxonomy_vocabulary_machine_name_load($this->vocabulary_machine_name);

    // If vocab uses 'Localize', change language from undefined to English.
    if ($vocabulary->i18n_mode == LINGOTEK_TAXONOMY_LOCALIZE_VALUE) {
      return 'en_US';
    }
  }
  return Lingotek::convertDrupal2Lingotek($this->language);
}