Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

Commit

Permalink
Add docs for antl.switchLocale in view (#231)
Browse files Browse the repository at this point in the history
* feat(config): add docs for Config.set (#227)

* feat(config): add docs for Config.set (#227)

* feat(view): add docs for antl.switchLocale in view (#230)

* feat(view): add docs for antl.switchLocale in view (#230)
  • Loading branch information
ntvsx193 authored and thetutlage committed Jan 7, 2018
1 parent e43674f commit 66fc85c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 08-cookbooks/08-internationalization.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,16 @@ Route.get('/', ({ antl }) => {
})
----

For example, you can switch locale for renderer view as:

[source, js]
----
Route.get('/', ({ antl, view }) => {
antl.switchLocale('fr')
return view.render('some-view')
}
----

== View global
Also the xref:_context_instance[Context instance] is shared with all the views. So you can access all the available methods inside your view templates.

Expand Down

0 comments on commit 66fc85c

Please sign in to comment.