public function FacetapiEmptyBehavior::translate in Facet API 6.3
Same name and namespace in other branches
- 7.2 plugins/facetapi/empty_behavior.inc \FacetapiEmptyBehavior::translate()
- 7 plugins/facetapi/empty_behavior.inc \FacetapiEmptyBehavior::translate()
Helper function for translating strings.
Parameters
string $key: The array key of the element being translated.
string $string: The string being translated.
Return value
The translated string.
See also
1 call to FacetapiEmptyBehavior::translate()
- FacetapiEmptyBehaviorText::execute in plugins/
facetapi/ empty_behavior_text.inc - Returns an empty array.
File
- plugins/
facetapi/ empty_behavior.inc, line 71 - Base class for empty behaviors.
Class
- FacetapiEmptyBehavior
- Abstract class implemented by all 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);
}