public function FacetapiEmptyBehavior::translate in Facet API 7
Same name and namespace in other branches
- 6.3 plugins/facetapi/empty_behavior.inc \FacetapiEmptyBehavior::translate()
- 7.2 plugins/facetapi/empty_behavior.inc \FacetapiEmptyBehavior::translate()
Helper function for translating strings.
Parameters
string $key: The array key of the form element under $form['widget']['empty'] in the facetapi_translate_string() form containing the setting being translated.
string $string: The string being translated.
Return value
string The translated string.
See also
1 call to FacetapiEmptyBehavior::translate()
- FacetapiEmptyBehaviorText::execute in plugins/
facetapi/ empty_behavior_text.inc - Implements FacetapiEmptyBehavior::execute().
File
- plugins/
facetapi/ empty_behavior.inc, line 93 - Base empty behavior plugin class and default implementation.
Class
- FacetapiEmptyBehavior
- Abstract class extended by empty behavior plugins.
Code
public function translate($key, $string) {
$config_name = preg_replace('@[^a-zA-Z0-9]@', '_', $this->configName);
$name = 'facetapi:' . $config_name . ':empty_text:' . $key;
return facetapi_translate_string($name, $string);
}