protected function translate($key, $arguments = null, $mode = self::MODE_TRANSLATE)
    {
        $encoding = $this->getEncoding();

        if (false === $this->hasNamespace()) {
            throw new Doozr_I18n_Service_Exception(
                'Translation without namespace is not possible. Please set a namespace via setNamespace(...) '.
                'or addNamespace(...) first.'
            );
        }

        // Translate
        $translation = self::$translatorInterfaces[$encoding]->lookup(
            $key,
            $this->getTranslationTableUid(),
            $arguments
        );

        // encode result? => check runtimeEnvironment
        switch ($mode) {
            case self::MODE_TRANSLATE_ENCODE:
                $translation = htmlspecialchars($translation, ENT_QUOTES & ENT_DISALLOWED & ENT_HTML5, 'UTF-8');
                break;

            case self::MODE_TRANSLATE_ENCODE_PLUS:
                $translation = htmlentities($translation, ENT_QUOTES & ENT_DISALLOWED & ENT_HTML5, 'UTF-8', false);
                break;
        }

        return $translation;
    }