📄 data.php
字号:
break; case 'currencyrounding': $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info', 'iso4217'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $key . '\']', 'rounding', $key); } break; case 'currencytoregion': $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166'); foreach ($_temp as $key => $keyvalue) { $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key); } break; case 'regiontocurrency': $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166'); foreach ($_temp as $key => $keyvalue) { $val = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key); if (!array_key_exists($val[$key], $temp)) { $temp[$val[$key]] = $key; } else { $temp[$val[$key]] .= " " . $key; } } break; case 'regiontoterritory': $_temp = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key); } break; case 'territorytoregion': $_temp2 = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type'); $_temp = array(); foreach ($_temp2 as $key => $found) { $_temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key); } foreach($_temp as $key => $found) { $_temp3 = explode(" ", $found); foreach($_temp3 as $found3) { if (!array_key_exists($found3, $temp)) { $temp[$found3] = (string) $key; } else { $temp[$found3] .= " " . $key; } } } break; case 'scripttolanguage': $_temp = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key); if (empty($temp[$key])) { unset($temp[$key]); } } break; case 'languagetoscript': $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type'); $_temp = array(); foreach ($_temp2 as $key => $found) { $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key); } foreach($_temp as $key => $found) { $_temp3 = explode(" ", $found); foreach($_temp3 as $found3) { if (empty($found3)) { continue; } if (!array_key_exists($found3, $temp)) { $temp[$found3] = (string) $key; } else { $temp[$found3] .= " " . $key; } } } break; case 'territorytolanguage': $_temp = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key); if (empty($temp[$key])) { unset($temp[$key]); } } break; case 'languagetoterritory': $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type'); $_temp = array(); foreach ($_temp2 as $key => $found) { $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key); } foreach($_temp as $key => $found) { $_temp3 = explode(" ", $found); foreach($_temp3 as $found3) { if (empty($found3)) { continue; } if (!array_key_exists($found3, $temp)) { $temp[$found3] = (string) $key; } else { $temp[$found3] .= " " . $key; } } } break; case 'timezonetowindows': $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone', 'other'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone[@other=\'' . $key . '\']', 'type', $key); } break; case 'windowstotimezone': $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone', 'type'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/mapTimezones[@type=\'windows\']/mapZone[@type=\'' .$key . '\']', 'other', $key); } break; case 'territorytotimezone': $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem', 'type'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem[@type=\'' . $key . '\']', 'territory', $key); } break; case 'timezonetoterritory': $_temp = self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem', 'territory'); foreach ($_temp as $key => $found) { $temp += self::_getFile('supplementalData', '/supplementalData/timezoneData/zoneFormatting/zoneItem[@territory=\'' . $key . '\']', 'type', $key); } break; case 'citytotimezone': $_temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type'); foreach($_temp as $key => $found) { $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key); } break; case 'timezonetocity': $_temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type'); $temp = array(); foreach($_temp as $key => $found) { $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key); if (!empty($temp[$key])) { $temp[$temp[$key]] = $key; } unset($temp[$key]); } break; default : require_once 'Zend/Locale/Exception.php'; throw new Zend_Locale_Exception("Unknown list ($path) for parsing locale data."); break; } if (isset(self::$_cache)) { self::$_cache->save( serialize($temp), $id); } return $temp; } /** * Read the LDML file, get a single path defined value * * @param string $locale * @param string $path * @param string $value * @return string * @access public */ public static function getContent($locale, $path, $value = false) { $locale = self::_checkLocale($locale); if (isset(self::$_cache)) { $val = $value; if (is_array($value)) { $val = implode('_' , $value); } $val = urlencode($val); $id = strtr('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val, array('-' => '_', '%' => '_', '+' => '_')); if ($result = self::$_cache->load($id)) { return unserialize($result); } } switch(strtolower($path)) { case 'language': $temp = self::_getFile($locale, '/ldml/localeDisplayNames/languages/language[@type=\'' . $value . '\']', 'type'); break; case 'script': $temp = self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script[@type=\'' . $value . '\']', 'type'); break; case 'country': case 'territory': $temp = self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory[@type=\'' . $value . '\']', 'type'); break; case 'variant': $temp = self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant[@type=\'' . $value . '\']', 'type'); break; case 'key': $temp = self::_getFile($locale, '/ldml/localeDisplayNames/keys/key[@type=\'' . $value . '\']', 'type'); break; case 'datechars': $temp = self::_getFile($locale, '/ldml/dates/localizedPatternChars', '', 'chars'); break; case 'defaultcalendar': $temp = self::_getFile($locale, '/ldml/dates/calendars/default', 'choice', 'default'); break; case 'monthcontext': if (empty ($value)) { $value = "gregorian"; } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/default', 'choice', 'context'); break; case 'defaultmonth': if (empty ($value)) { $value = "gregorian"; } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/default', 'choice', 'default'); break; case 'month': if (!is_array($value)) { $temp = $value; $value = array("gregorian", "format", "wide", $temp); } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month[@type=\'' . $value[3] . '\']', 'type'); break; case 'daycontext': if (empty($value)) { $value = "gregorian"; } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/default', 'choice', 'context'); break; case 'defaultday': if (empty($value)) { $value = "gregorian"; } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/default', 'choice', 'default'); break; case 'day': if (!is_array($value)) { $temp = $value; $value = array("gregorian", "format", "wide", $temp); } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/days/dayContext[@type=\'' . $value[1] . '\']/dayWidth[@type=\'' . $value[2] . '\']/day[@type=\'' . $value[3] . '\']', 'type'); break; case 'quarter': if (!is_array($value)) { $temp = $value; $value = array("gregorian", "format", "wide", $temp); } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/quarters/quarterContext[@type=\'' . $value[1] . '\']/quarterWidth[@type=\'' . $value[2] . '\']/quarter[@type=\'' . $value[3] . '\']', 'type'); break; case 'am': if (empty($value)) { $value = "gregorian"; } $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/am', '', 'am'); break; case 'pm': if (empty($value)) { $value = "gregorian";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -