You are here

function i18n_path_get_translations in Internationalization 7

Get translations for path

1 call to i18n_path_get_translations()
i18n_path_i18n_translate_path in i18n_path/i18n_path.module
Implements hook_i18n_translate_path()

File

i18n_path/i18n_path.module, line 74
Internationalization (i18n) module - Path translation

Code

function i18n_path_get_translations($path) {
  static $translations;
  if (!isset($translations)) {
    $translations = drupal_static(__FUNCTION__, array());
  }
  if (!isset($translations[$path])) {
    $translations[$path] = db_query('SELECT p.language, p.path FROM {i18n_path} p INNER JOIN {i18n_path} ps ON p.tsid = ps.tsid WHERE ps.path = :path', array(
      ':path' => $path,
    ))
      ->fetchAllKeyed();
  }
  return $translations[$path];
}