lang = $lang; switch ($adapter) { case 'array': $this->adapter=new TranslatorAdapterArray($path, $lang); break; case 'gettext': $this->adapter=new TranslatorAdapterGetText($path, $lang); break; default: throw new TranslatorInvalidAdapterException("Adapter ".$adapter." is not implemented yet!"); } } /** * Translates the given string. * @param string message * @param int plural count * @return string */ public function translate($message, $count = NULL) { return $this->_($message, $count); } /** * Translates the given string and replace searched keywords. * @param string message * @param int plural count * @param array replacement * @return string */ public function _($message, $count = NULL, $replacement = NULL) { return $this->adapter->_($message, $count, $replacement); } } ?>