Skip to content

Commit

Permalink
Rename default formatter key from "basic" to "default".
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad committed Jul 27, 2014
1 parent c200bc0 commit 1758249
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/I18n/I18n.php
Expand Up @@ -41,7 +41,7 @@ class I18n {
*
* @var string
*/
protected static $_defaultFormatter = 'basic';
protected static $_defaultFormatter = 'default';

/**
* Returns the translators collection instance. It can be used
Expand All @@ -61,7 +61,7 @@ public static function translators() {
'sprintf' => function() {
return new SprintfFormatter;
},
'basic' => function() {
'default' => function() {
return new IcuFormatter;
},
]),
Expand Down Expand Up @@ -167,7 +167,7 @@ public static function defaultLocale($locale = null) {

/**
* Sets the name of the default messages formatter to use for future
* translator instances. By default the `basic` and `sprintf` formatters
* translator instances. By default the `default` and `sprintf` formatters
* are available.
*
* If called with no arguments, it will return the currently configured value.
Expand Down Expand Up @@ -207,7 +207,7 @@ protected static function _fallbackTranslator($name, $locale) {
new MessagesFileLoader($name, $locale, 'po')
]);

if (static::$_defaultFormatter !== 'basic') {
if (static::$_defaultFormatter !== 'default') {
$formatter = static::$_defaultFormatter;
$chain = function() use ($formatter, $chain) {
$package = $chain();
Expand Down
2 changes: 1 addition & 1 deletion src/I18n/MessagesFileLoader.php
Expand Up @@ -103,7 +103,7 @@ public function __construct($name, $locale, $extension = 'po') {
* file extension.
*/
public function __invoke() {
$package = new Package;
$package = new Package('default');
$folder = $this->translationsFolder();
$ext = $this->_extension;

Expand Down
12 changes: 6 additions & 6 deletions tests/TestCase/I18n/I18nTest.php
Expand Up @@ -52,7 +52,7 @@ public function setUp() {
public function tearDown() {
parent::tearDown();
I18n::clear();
I18n::defaultFormatter('basic');
I18n::defaultFormatter('default');
I18n::defaultLocale($this->locale);
Plugin::unload();
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public function testPluralSelectionBasicFormatter() {
*/
public function testCreateCustomTranslationPackage() {
I18n::translator('custom', 'fr_FR', function() {
$package = new Package();
$package = new Package('default');
$package->setMessages([
'Cow' => 'Le moo'
]);
Expand Down Expand Up @@ -164,7 +164,7 @@ public function testDefaultLocale() {
*/
public function testGetTranslatorByDefaultLocale() {
I18n::translator('custom', 'fr_FR', function() {
$package = new Package();
$package = new Package('default');
$package->setMessages([
'Cow' => 'Le moo'
]);
Expand Down Expand Up @@ -208,7 +208,7 @@ public function testBasicTranslatePluralFunction() {
*/
public function testBasicDomainFunction() {
I18n::translator('custom', 'en_US', function() {
$package = new Package();
$package = new Package('default');
$package->setMessages([
'Cow' => 'Le moo',
'The {thing} is tasty' => 'The {thing} is delicious'
Expand All @@ -226,7 +226,7 @@ public function testBasicDomainFunction() {
*/
public function testBasicDomainPluralFunction() {
I18n::translator('custom', 'en_US', function() {
$package = new Package();
$package = new Package('default');
$package->setMessages([
'Cow' => 'Le Moo',
'Cows' => [
Expand All @@ -247,7 +247,7 @@ public function testBasicDomainPluralFunction() {
*/
public function testBasicContextFunction() {
I18n::translator('default', 'en_US', function() {
$package = new Package();
$package = new Package('default');
$package->setMessages([
'letter' => [
'_context' => [
Expand Down

0 comments on commit 1758249

Please sign in to comment.