findLocale example


        return $this->_locale;
    }

    /** * Sets the locale to use * * @param string|Zend_Locale $locale */
    public function setLocale($locale = null)
    {
        $this->_locale = Zend_Locale::findLocale($locale);
        return $this;
    }

    /** * Defined by Zend_Validate_Interface * * Returns true if and only if $value is a floating-point value * * @param string $value * @return boolean */
    
if ($this->_seg !== null) {
            $this->_content .= "<".$name;
            foreach($attrib as $key => $value) {
                $this->_content .= " $key=\"$value\"";
            }
            $this->_content .= ">";
        } else {
            switch(strtolower($name)) {
                case 'header':
                    if (empty($this->_useId) && isset($attrib['srclang'])) {
                        if (Zend_Locale::isLocale($attrib['srclang'])) {
                            $this->_srclang = Zend_Locale::findLocale($attrib['srclang']);
                        } else {
                            if (!$this->_options['disableNotices']) {
                                if ($this->_options['log']) {
                                    $this->_options['log']->notice("The language '{$attrib['srclang']}' can not be set because it does not exist.");
                                } else {
                                    trigger_error("The language '{$attrib['srclang']}' can not be set because it does not exist.", E_USER_NOTICE);
                                }
                            }

                            $this->_srclang = $attrib['srclang'];
                        }
                    }
/** * Sets the locale to use * * @param string|Zend_Locale $locale * @throws Zend_Validate_Exception On unrecognised region * @throws Zend_Validate_Exception On not detected format * @return Zend_Validate_PostCode Provides fluid interface */
    public function setLocale($locale = null)
    {
        $this->_locale = Zend_Locale::findLocale($locale);
        $locale        = new Zend_Locale($this->_locale);
        $region        = $locale->getRegion();
        if (empty($region)) {
            throw new Zend_Validate_Exception("Unable to detect a region for the locale '$locale'");
        }

        $format = Zend_Locale::getTranslation(
            $locale->getRegion(),
            'postaltoterritory',
            $this->_locale
        );

        

                    break;

                case 'fix_date' :
                    if (($value !== true) && ($value !== false)) {
                        throw new Zend_Locale_Exception("Enabling correction of dates must be either true or false"
                            . "(fix_date='$value').");
                    }
                    break;

                case 'locale' :
                    $options['locale'] = Zend_Locale::findLocale($value);
                    break;

                case 'cache' :
                    if ($value instanceof Zend_Cache_Core) {
                        Zend_Locale_Data::setCache($value);
                    }
                    break;

                case 'disablecache' :
                    Zend_Locale_Data::disableCache($value);
                    break;

                

        return $this->_locale;
    }

    /** * Sets the locale to use * * @param string|Zend_Locale $locale */
    public function setLocale($locale = null)
    {
        $this->_locale = Zend_Locale::findLocale($locale);
        return $this;
    }

    /** * Defined by Zend_Validate_Interface * * Returns true if and only if $value is a valid integer * * @param string|integer $value * @return boolean */
    

    public function setLocale($locale = null)
    {
        try {
            $this->_locale = Zend_Locale::findLocale($locale);
        } catch (Zend_Locale_Exception $e) {
            throw new Zend_Date_Exception($e->getMessage(), 0, $e);
        }

        return $this;
    }

    /** * Returns the actual set locale * * @return string */


    /** * Sets the locale option * * @param string|Zend_Locale $locale * @return Zend_Validate_Date provides a fluent interface */
    public function setLocale($locale = null)
    {
        if ($locale !== false) {
            $locale = Zend_Locale::findLocale($locale);
            if (strlen($locale) < 4) {
                throw new Zend_Validate_Exception('Region must be given for IBAN validation');
            }
        }

        $this->_locale = $locale;
        return $this;
    }

    /** * Defined by Zend_Validate_Interface * * Returns true if $value is a valid IBAN * * @param string $value * @return boolean */
if ((array_key_exists('log', $options)) && !($options['log'] instanceof Zend_Log)) {
            throw new Zend_Translate_Exception('Instance of Zend_Log expected for option log');
        }

        try {
            if (!($options['content'] instanceof Zend_Translate) && !($options['content'] instanceof Zend_Translate_Adapter)) {
                if (empty($options['locale'])) {
                    $options['locale'] = null;
                }

                $options['locale'] = Zend_Locale::findLocale($options['locale']);
            }
        } catch (Zend_Locale_Exception $e) {
            throw new Zend_Translate_Exception("The given Language '{$options['locale']}' does not exist", 0, $e);
        }

        $options  = $options + $this->_options;
        if (is_string($options['content']) and is_dir($options['content'])) {
            $options['content'] = realpath($options['content']);
            $prev = '';
            $iterator = new RecursiveIteratorIterator(
                new RecursiveRegexIterator(
                    

    public function setLocale($locale = null)
    {
        try {
            $locale = Zend_Locale::findLocale($locale);
            if (strlen($locale) > 4) {
                $this->_options['locale'] = $locale;
            } else {
                throw new Zend_Currency_Exception("No region found within the locale '" . (string) $locale . "'");
            }
        } catch (Zend_Locale_Exception $e) {
            throw new Zend_Currency_Exception($e->getMessage());
        }

        // Get currency details         $this->_options['currency'] = $this->getShortName(null, $this->_options['locale']);
        
return $this->_locale;
    }

    /** * Sets the locale option * * @param string|Zend_Locale $locale * @return Zend_Validate_Date provides a fluent interface */
    public function setLocale($locale = null)
    {
        $this->_locale = Zend_Locale::findLocale($locale);
        return $this;
    }

    /** * Returns the locale option * * @return string|null */
    public function getFormat()
    {
        return $this->_format;
    }

    public static function getTranslationList($path = null, $locale = null, $value = null)
    {
        $locale = self::findLocale($locale);
        $result = Zend_Locale_Data::getList($locale$path$value);
        if (empty($result) === true) {
            return false;
        }

        return $result;
    }

    /** * Returns an array with the name of all languages translated to the given language * * @param string|Zend_Locale $locale (Optional) Locale for language translation * @return array * @deprecated */
Home | Imprint | This part of the site doesn't use cookies.