You are here

function i18n_string_translation_search in Internationalization 7

Preload all strings for this textroup/context.

This is a performance optimization to load all needed strings with a single query.

Examples of valid string name to search are:

  • 'taxonomy:term:*:title' This will find all titles for taxonomy terms
  • array('taxonomy', 'term', array(1,2), '*') This will find all properties for taxonomy terms 1 and 2

Parameters

$name: Specially crafted string name, it may take '*' and array parameters for each element.

$langcode: Language code to search translations. Defaults to current language.

Return value

array() String objects indexed by context.

1 call to i18n_string_translation_search()
i18n_taxonomy_localize_terms in i18n_taxonomy/i18n_taxonomy.module
Localize taxonomy terms for localizable vocabularies.
1 string reference to 'i18n_string_translation_search'
i18n_test_menu in tests/i18n_test.module
Implements hook_menu().

File

i18n_string/i18n_string.module, line 948
Internationalization (i18n) package - translatable strings.

Code

function i18n_string_translation_search($name, $langcode = NULL) {
  $langcode = isset($langcode) ? $langcode : i18n_langcode();
  list($textgroup, $context) = i18n_string_context($name);
  return i18n_string_textgroup($textgroup)
    ->multiple_translation_search($context, $langcode);
}