*/ WBClass::load('patI18n'); /** * patTemplate modifier Gettext * * Lookup translation * * Parameter: * - domain: use default domain or other * * Make sure you use neither "php" nor "auto" as attibute: modifiertype * * @package patTemplate * @package Modifiers * @author gERD Schaufelberger */ class patTemplate_Modifier_Gettext extends patTemplate_Modifier { /** * modify the value * * @param string value * @param array list of parameter * @return string modified value */ public function modify($value, $params = array()) { $params = array_merge(array( 'domain' => '', ), $params); // translate with domain if (!empty($params['domain'])) { return patI18n::dgettext($params['domain'], $value); } return patI18n::gettext($value); } }