diff --git a/common/errors.go b/common/errors.go index 4475860a..568383ca 100644 --- a/common/errors.go +++ b/common/errors.go @@ -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 diff --git a/common/phrases.go b/common/phrases.go index 1bba07a3..09a1dbe8 100644 --- a/common/phrases.go +++ b/common/phrases.go @@ -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 { diff --git a/langs/english.json b/langs/english.json index 7452a9c1..85629b1e 100644 --- a/langs/english.json +++ b/langs/english.json @@ -70,6 +70,7 @@ }, "Errors": { + "not_found":"The requested page doesn't exist." }, "PageTitles": {