forked from revel/revel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.go
24 lines (19 loc) · 904 Bytes
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package controllers
import "github.com/revel/revel"
type Application struct {
*revel.Controller
}
func (c Application) Index() revel.Result {
// Localization information
c.RenderArgs["acceptLanguageHeader"] = c.Request.Header.Get("Accept-Language")
c.RenderArgs["acceptLanguageHeaderParsed"] = c.Request.AcceptLanguages.String()
c.RenderArgs["acceptLanguageHeaderMostQualified"] = c.Request.AcceptLanguages[0]
c.RenderArgs["controllerCurrentLocale"] = c.Request.Locale
// Controller-resolves messages
c.RenderArgs["controllerGreeting"] = c.Message("greeting")
c.RenderArgs["controllerGreetingName"] = c.Message("greeting.name")
c.RenderArgs["controllerGreetingSuffix"] = c.Message("greeting.suffix")
c.RenderArgs["controllerGreetingFull"] = c.Message("greeting.full")
c.RenderArgs["controllerGreetingWithArgument"] = c.Message("greeting.full.name", "Steve Buscemi")
return c.Render()
}