Localised the not found error.
This commit is contained in:
parent
59497de8dc
commit
d8d5bc0573
|
@ -281,7 +281,7 @@ func SecurityError(w http.ResponseWriter, r *http.Request, user User) RouteError
|
|||
// ? - Add a JSQ and JS version of this?
|
||||
// ? - Add a user parameter?
|
||||
func NotFound(w http.ResponseWriter, r *http.Request, header *Header) RouteError {
|
||||
return CustomError("The requested page doesn't exist.", 404, "Not Found", w, r, header, GuestUser)
|
||||
return CustomError(GetErrorPhrase("not_found"), 404, "Not Found", w, r, header, GuestUser)
|
||||
}
|
||||
|
||||
// CustomError lets us make custom error types which aren't covered by the generic functions above
|
||||
|
|
|
@ -205,12 +205,12 @@ func GetHumanLangPhrase(name string) (string, bool) {
|
|||
}
|
||||
|
||||
// TODO: Does comma ok work with multi-dimensional maps?
|
||||
func GetErrorPhrase(name string) (string, bool) {
|
||||
func GetErrorPhrase(name string) string {
|
||||
res, ok := currentLangPack.Load().(*LanguagePack).Errors[name]
|
||||
if !ok {
|
||||
return getPhrasePlaceholder("error", name), false
|
||||
return getPhrasePlaceholder("error", name)
|
||||
}
|
||||
return res, true
|
||||
return res
|
||||
}
|
||||
|
||||
func GetNoticePhrase(name string) string {
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
},
|
||||
|
||||
"Errors": {
|
||||
"not_found":"The requested page doesn't exist."
|
||||
},
|
||||
|
||||
"PageTitles": {
|
||||
|
|
Loading…
Reference in New Issue