You are here

function facetapi_translate_string in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.module \facetapi_translate_string()
  2. 7.2 facetapi.module \facetapi_translate_string()

Translates a string via the translator module.

Parameters

string $name: The name of the string in "textgroup:object_type:object_key:property_name" format.

string $string: The string being translated.

string $langcode: The language code to translate to a language other than what is used to display the page. Defaults to NULL, which uses the current language.

Return value

string The translated string.

3 calls to facetapi_translate_string()
CurrentSearchItem::translate in contrib/current_search/plugins/current_search/item.inc
Helper function for translating strings.
FacetapiApiFunctions::testTranslateString in tests/facetapi.test
Tests the facetapi_translate_string() functionality.
FacetapiEmptyBehavior::translate in plugins/facetapi/empty_behavior.inc
Helper function for translating strings.

File

./facetapi.module, line 930
An abstracted facet API that can be used by various search backends.

Code

function facetapi_translate_string($name, $string, $langcode = NULL) {
  if ($module = variable_get('facetapi:translator_module', NULL)) {
    $function = $module . '_facetapi_translate_string';
    if (function_exists($function)) {
      $string = $function($name, $string, $langcode);
    }
  }
  return $string;
}