/** * Get the translation for the specified key * * @param string $key Translation key * * @return string */ public function translate($key) { return $this->_languagePack->fetch($key, $this->_locale->getLanguage()); }
/** * Configure a Klarna object for a specific country * * @param KiTT_Locale $locale Country code * @param int $eid Merchant id * @param string $secret Merchant secret * * @throws InvalidArgumentException * * @return Klarna */ public static function configureKlarna(KiTT_Locale $locale, $eid, $secret) { $country = $locale->getCountryCode(); if ($country === null) { throw new InvalidArgumentException("country must be a valid Klarna country ({$country})"); } $country = strtoupper($country); self::configuration()->set("sales_countries/{$country}", array('eid' => $eid, 'secret' => $secret, 'country' => $locale->getCountry(), 'currency' => $locale->getCurrency(), 'language' => $locale->getLanguage())); }