public function __construct(AdapterInterface $adapter = null) { if (null === $adapter) { $adapter = new StaticAdapter(); } $this->adapter = $adapter; // Translator $this->translator = new Translator(); $this->translator->setLocale('en'); $this->translator->setFallbackLocale('en'); $this->translator->addTranslationFilePattern('gettext', dirname(__DIR__) . '/language/', '%s.mo', $this->translatorTextDomain); }
/** * Constructor. */ public function __construct() { $this->continents = array('AF' => new Continent('AF', 'Africa'), 'AN' => new Continent('AN', 'Antarctica'), 'AS' => new Continent('AS', 'Asia'), 'EU' => new Continent('EU', 'Europe'), 'NA' => new Continent('NA', 'North america'), 'OC' => new Continent('OC', 'Oceania'), 'SA' => new Continent('SA', 'South america')); if (null !== $this->countryManager) { foreach ($this->continents as $continent) { if ($continent instanceof CountryManagerAwareInterface) { $country->setCountryManager($countryManager); } } } // Translator $this->translator = new Translator(); $this->translator->setLocale('en_US'); $this->translator->setFallbackLocale('en_US'); $this->translator->addTranslationFilePattern('gettext', dirname(__DIR__) . '/language/continent/', '%s.mo', $this->translatorTextDomain); }