Skip to content

Commit db34f12

Browse files
fix code block
1 parent e08b579 commit db34f12

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

docs/en/orm/behaviors/translate.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,15 @@ finds, there may be times you wish to retrieve translated content without
372372
modifying the application's state. For these scenarios use the behavior's
373373
`setLocale()` method:
374374

375-
I18n::setLocale('en'); // reset for illustration
375+
```php
376+
I18n::setLocale('en'); // reset for illustration
376377

377-
// specific locale.
378-
$this->Articles->getBehavior('Translate')->setLocale('es');
378+
// specific locale.
379+
$this->Articles->getBehavior('Translate')->setLocale('es');
379380

380-
$article = $this->Articles->get(12);
381-
echo $article->title; // Echoes 'Un Artículo', yay piece of cake!
381+
$article = $this->Articles->get(12);
382+
echo $article->title; // Echo 'Un Artículo', yay piece of cake!
383+
```
382384

383385
Note that this only changes the locale of the Articles table, it would not
384386
affect the language of associated data. To affect associated data it's necessary

0 commit comments

Comments
 (0)