addLoader('array', new Translation\Loader\ArrayLoader()); parent::__construct($locale, $formatter, $cacheDir, $debug); } /** * Reset messages of a locale (all locale if no locale passed). * Remove custom messages and reload initial messages from matching * file in Lang directory. * * @param string|null $locale * * @return bool */ public function resetMessages($locale = null) { if ($locale === null) { static::$messages = array(); return true; } if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) { static::$messages[$locale] = require $filename; $this->addResource('array', static::$messages[$locale], $locale); return true; } return false; } /** * Init messages language from matching file in Lang directory. * * @param string $locale * * @return bool */ protected function loadMessagesFromFile($locale) { if (isset(static::$messages[$locale])) { return true; } return $this->resetMessages($locale); } /** * Set messages of a locale and take file first if present. * * @param string $locale * @param array $messages * * @return $this */ public function setMessages($locale, $messages) { $this->loadMessagesFromFile($locale); $this->addResource('array', $messages, $locale); static::$messages[$locale] = array_merge( isset(static::$messages[$locale]) ? static::$messages[$locale] : array(), $messages ); return $this; } /** * Get messages of a locale, if none given, return all the * languages. * * @param string|null $locale * * @return array */ public function getMessages($locale = null) { return $locale === null ? static::$messages : static::$messages[$locale]; } /** * Set the current translator locale and indicate if the source locale file exists * * @param string $locale locale ex. en * * @return bool */ public function setLocale($locale) { $locale = preg_replace_callback('/[-_]([a-z]{2,})/', function ($matches) { // _2-letters is a region, _3+-letters is a variant return '_'.call_user_func(strlen($matches[1]) > 2 ? 'ucfirst' : 'strtoupper', $matches[1]); }, strtolower($locale)); if ($this->loadMessagesFromFile($locale)) { parent::setLocale($locale); return true; } return false; } } __halt_compiler();----SIGNATURE:----ZtlmPljVzJnvFcdFb9Xq47AFOaR7NedOF34ZWtm6ruw8gypVmrSTvxw4buvpvvVx1oGl6fu52CTtCfHGPQU7cXJ5HuSUcg3RmngL88OoUOIBZfZe70GUr5PYBNY/oal8QMvdz5vfXmDvrDrwEMJuO0lrLhPIpi/KKKYQAEggbk7ujydj0QvoRs2Yrip75enAs1UUzesLllVUaYwjBZjRir61cIBjbqkJuiPukWRd70XT9EslLd4dTsgNoHoy1EPBT9XVfPC2RreJ2U+kyAJJkMURqkYZs93NT7kUocWk4hYeCpnAlNb7bMsSNK8ih9erazJ9KThp4VOZtAaRXoytL3e1OQpwuZ21E+g2jxp7Y7I2NLhqnNb3irmOL/irJTqvGqbVrV2nTKYn8fTwz1Srk7Tp5GMXkr2r+RCdFAbNS0BMlBXCJ1a5ofUTj7DdGW4yCoJwSSrdtGG70TMtgKsAuiz42aFXpdxScaVJheg2g/woUSqsqWIcisVmX+fhTVbbU6S+xpOl+fLAYN3hBNBOVTwtP8sRHNuMog0F+PhHfcxtlxEbd72sWj3EOOhUu0YIDsAcsHVYAhaRzTrDO8FE/hwh3INBDE06C/+ZiP5VLffbEd/Kdczt+UqFsO9eUkUqjqNovlFfpXuTWy/IZcAKUIQYZNRXygNFBObFpF3k1po=----ATTACHMENT:----NTU5MTQ1MjcwMTcyMjQwNSA5NzQzODc1NDI1MDQwMDMxIDkzMzQxNzU2NDQ4NTg1Njg=