/** * @see \Components\I18n_Location::initialized() \Components\I18n_Location::initialized() * * @return \Components\I18n_Country */ protected function initialized() { if (null === $this->m_data) { $name = strtolower($this->m_name); if (false === ($this->m_data = Cache::get("i18n/country/{$name}"))) { $this->m_data['children'] = []; $path = Io::pathComponentsResource('i18n', 'resource', 'i18n', 'location', $name); if ($path->exists()) { foreach ($path as $pathRegion) { $pathRegionAsString = $pathRegion->getPath(); if (false === is_file($pathRegionAsString)) { continue; } $region = basename($pathRegionAsString); $region = strtolower(substr($region, 0, strrpos($region, '.'))); $this->m_data['children'][$region] = null; } } Cache::set("i18n/country/{$name}", $this->m_data); } } return $this; }
/** * @return \Components\Io_Path */ private static function pathTranslationCommon() { if (null === self::$m_pathTranslationCommon) { self::$m_pathTranslationCommon = Io::pathComponentsResource('i18n', 'resource', 'i18n', 'translation', 'common'); } return self::$m_pathTranslationCommon; }