Skip to content

Commit

Permalink
Fixing some small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 26, 2014
1 parent f537fb3 commit b199b45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/I18n/I18n.php
Expand Up @@ -72,7 +72,7 @@ public static function translators() {

/**
* Returns an instance of a translator that was configured for the name and passed
* locale. If no locale is passed the it takes the value returned by the `defaultLocale()` method.
* locale. If no locale is passed then it takes the value returned by the `defaultLocale()` method.
*
* This method can be used to configure future translators, this is achieved by passing a callable
* as the last argument of this function.
Expand Down
5 changes: 3 additions & 2 deletions src/I18n/MessagesFileLoader.php
Expand Up @@ -18,6 +18,7 @@
use Cake\Core\App;
use Cake\Core\Plugin;
use Cake\Utility\Inflector;
use \Locale;

/**
* A generic translations package factory that will load translations files
Expand Down Expand Up @@ -91,7 +92,7 @@ public function __invoke() {
$class = App::classname($name, 'I18n\Parser', 'FileParser');

if (!$class) {
throw new \RuntimeException(sprintf('Could not find class %s'), "{$name}FileParser");
throw new \RuntimeException(sprintf('Could not find class %s', "{$name}FileParser"));
}

$messages = (new $class)->parse($folder . $this->_name . ".$ext");
Expand All @@ -107,7 +108,7 @@ public function __invoke() {
* if it does not exists.
*/
public function translationsFolder() {
$locale = locale_parse($this->_locale) + ['region' => null];
$locale = Locale::parseLocale($this->_locale) + ['region' => null];

$folders = [
implode('_', [$locale['language'], $locale['region']]),
Expand Down

0 comments on commit b199b45

Please sign in to comment.