You are here

function lingotek_get_translation_set in Lingotek Translation 7.7

Retrieves a translation set for menu links

1 call to lingotek_get_translation_set()
lingotek_process_entity_xml in ./lingotek.remote.inc

File

./lingotek.util.inc, line 3122
Utility functions.

Code

function lingotek_get_translation_set($mlid, $menu_name) {
  $source_menu_link = menu_link_load($mlid);
  $source_tsid = $source_menu_link['i18n_tsid'];

  // Create new translation set
  if ($source_tsid == 0) {
    $translation_set = i18n_translation_set_build('menu_link');
    $translations = array(
      $source_menu_link->language => $source_menu_link,
    );
    $translation_set
      ->add_translations($translations);
  }
  else {
    $translation_set = i18n_translation_set_load($source_tsid, 'menu_link');
  }
  return $translation_set;
}