Skip to content

Commit

Permalink
Makong sure the cake domain always uses the default formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Aug 4, 2014
1 parent 4f18b97 commit 2e3ddb9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/I18n/I18n.php
Expand Up @@ -255,15 +255,13 @@ protected static function _fallbackTranslator($name, $locale) {
]);

// \Aura\Intl\Package by default uses formatter configured with key "basic".
if (static::$_defaultFormatter !== 'basic') {
$formatter = static::$_defaultFormatter;
$chain = function() use ($formatter, $chain) {
$package = $chain();
$package->setFormatter($formatter);
return $package;
};
}

// and we want to make sure the cake domain always uses the default formatter
$formatter = $name === 'cake' ? 'default' : static::$_defaultFormatter;
$chain = function() use ($formatter, $chain) {
$package = $chain();
$package->setFormatter($formatter);
return $package;
};
static::translator($name, $locale, $chain);
return static::translators()->get($name);
}
Expand Down

0 comments on commit 2e3ddb9

Please sign in to comment.