Browse Source

Fix i18n string

Dashie der otter 9 months ago
parent
commit
78f58622d4
Signed by: Dashie <dashie@sigpipe.me> GPG Key ID: C2D57B325840B755
1 changed files with 19 additions and 19 deletions
  1. 19
    19
      context/context.go

+ 19
- 19
context/context.go View File

@@ -1,22 +1,22 @@
1 1
 package context
2 2
 
3 3
 import (
4
-	"gopkg.in/macaron.v1"
4
+	"dev.sigpipe.me/dashie/git.txt/models"
5
+	"dev.sigpipe.me/dashie/git.txt/setting"
6
+	"dev.sigpipe.me/dashie/git.txt/stuff/auth"
7
+	"dev.sigpipe.me/dashie/git.txt/stuff/form"
8
+	"fmt"
9
+	"github.com/go-macaron/cache"
5 10
 	"github.com/go-macaron/csrf"
11
+	"github.com/go-macaron/i18n"
6 12
 	"github.com/go-macaron/session"
7
-	"github.com/go-macaron/cache"
8 13
 	log "gopkg.in/clog.v1"
9
-	"net/http"
10
-	"dev.sigpipe.me/dashie/git.txt/setting"
11
-	"fmt"
14
+	"gopkg.in/macaron.v1"
15
+	"html/template"
12 16
 	"io"
13
-	"time"
17
+	"net/http"
14 18
 	"strings"
15
-	"github.com/go-macaron/i18n"
16
-	"html/template"
17
-	"dev.sigpipe.me/dashie/git.txt/models"
18
-	"dev.sigpipe.me/dashie/git.txt/stuff/form"
19
-	"dev.sigpipe.me/dashie/git.txt/stuff/auth"
19
+	"time"
20 20
 )
21 21
 
22 22
 // Context represents context of a request.
@@ -27,13 +27,13 @@ type Context struct {
27 27
 	Flash   *session.Flash
28 28
 	Session session.Store
29 29
 
30
-	User	*models.User	// logged in user
31
-	Gitxt   *Gitxt
30
+	User  *models.User // logged in user
31
+	Gitxt *Gitxt
32 32
 
33
-	RepoOwnerUsername  string
33
+	RepoOwnerUsername string
34 34
 
35
-	IsLogged	bool
36
-	IsBasicAuth	bool
35
+	IsLogged    bool
36
+	IsBasicAuth bool
37 37
 }
38 38
 
39 39
 // Title sets "Title" field in template data.
@@ -89,7 +89,7 @@ func (c *Context) Handle(status int, title string, err error) {
89 89
 	case http.StatusNotFound:
90 90
 		c.Data["Title"] = c.Tr("error.page_not_found")
91 91
 	case http.StatusInternalServerError:
92
-		c.Data["Title"] = c.Tr("internal_server_error")
92
+		c.Data["Title"] = c.Tr("error.internal_server_error")
93 93
 		log.Error(2, "%s: %v", title, err)
94 94
 	}
95 95
 	c.HTML(status, fmt.Sprintf("status/%d", status))
@@ -172,7 +172,7 @@ func Contexter() macaron.Handler {
172 172
 			csrf:    x,
173 173
 			Flash:   f,
174 174
 			Session: sess,
175
-			Gitxt: &Gitxt{},
175
+			Gitxt:   &Gitxt{},
176 176
 		}
177 177
 
178 178
 		if len(setting.HTTP.AccessControlAllowOrigin) > 0 {
@@ -211,4 +211,4 @@ func Contexter() macaron.Handler {
211 211
 
212 212
 		c.Map(ctx)
213 213
 	}
214
-}
214
+}

Loading…
Cancel
Save