Skip to content

Commit

Permalink
Merge pull request #71 from dereuromark/patch-1
Browse files Browse the repository at this point in the history
Fix up code example
  • Loading branch information
ADmad authored Nov 16, 2024
2 parents 039e52b + b85284d commit c991a01
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $middlware->add(new \ADmad\I18n\Middleware\I18nMiddleware([
// in URLs. Based on the language the locale will be also set.
'languages' => [
'en' => ['locale' => 'en_US'],
'fr' => ['locale' => 'fr_FR']
'fr' => ['locale' => 'fr_FR'],
],
]));
```
Expand Down Expand Up @@ -144,12 +144,10 @@ Add code similar to what's shown below in your app's `config/bootstrap.php`:
// Configure I18n to use DbMessagesLoader for default domain. You need to do
// this for each domain separately.
\Cake\I18n\I18n::config('default', function ($domain, $locale) {
$loader = new \ADmad\I18n\I18n\DbMessagesLoader(
return new \ADmad\I18n\I18n\DbMessagesLoader(
$domain,
$locale
);

return $loader();
});
```

Expand All @@ -175,8 +173,8 @@ public function initialize(): void
{
$this->loadHelper('Form', [
'widgets' => [
'timezone' => ['ADmad/I18n.Timezone']
]
'timezone' => ['ADmad/I18n.Timezone'],
],
]);
}
```
Expand All @@ -192,8 +190,8 @@ $this->Form->control('fieldname', [
'type' => 'timezone',
'options' => [
'Asia' => DateTimeZone::ASIA,
'Europe' => DateTimeZone::EUROPE
]
'Europe' => DateTimeZone::EUROPE,
],
]);
```

Expand Down

0 comments on commit c991a01

Please sign in to comment.