You are here

function i18nstrings_get_translation in Internationalization 6

Get translation from the database. Full object with input format.

This one doesn't return anything if we don't have the full i18n strings data there to prevent missing data resulting in missing input formats

1 call to i18nstrings_get_translation()
i18nstrings_text in i18nstrings/i18nstrings.module
Get filtered translation.

File

i18nstrings/i18nstrings.module, line 579
Internationalization (i18n) package - translatable strings.

Code

function i18nstrings_get_translation($context, $langcode) {
  $context = i18nstrings_context($context);
  list($where, $args) = i18nstrings_context_query($context);
  $where[] = "t.language = '%s'";
  $args[] = $langcode;
  return db_fetch_object(db_query("SELECT s.lid, t.translation, i.format FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid INNER JOIN {i18n_strings} i ON s.lid = i.lid WHERE " . implode(' AND ', $where), $args));
}