From f88dfc9a991c961b17a9add229a768a5cc127071 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Thu, 5 Oct 2023 15:17:56 +0300 Subject: [PATCH] all: imp i18n, names --- client/src/__locales/en.json | 2 +- internal/home/auth.go | 4 ++-- internal/home/auth_test.go | 2 +- internal/home/controlinstall.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 9fb6995292b..4249fb3307e 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -659,7 +659,7 @@ "parental_control": "Parental Control", "safe_browsing": "Safe Browsing", "served_from_cache": "{{value}} (served from cache)", - "form_error_password_length": "Password must be at least {{min}} and at most {{max}} characters long", + "form_error_password_length": "Password must {{min}} to {{max}} characters long", "anonymizer_notification": "<0>Note: IP anonymization is enabled. You can disable it in <1>General settings.", "confirm_dns_cache_clear": "Are you sure you want to clear DNS cache?", "cache_cleared": "DNS cache successfully cleared", diff --git a/internal/home/auth.go b/internal/home/auth.go index 9954a8a8a73..1445201f7b5 100644 --- a/internal/home/auth.go +++ b/internal/home/auth.go @@ -644,8 +644,8 @@ func optionalAuthHandler(handler http.Handler) http.Handler { return &authHandler{handler} } -// UserAdd adds a new user with the given password. -func (a *Auth) UserAdd(u *webUser, password string) (err error) { +// Add adds a new user with the given password. +func (a *Auth) Add(u *webUser, password string) (err error) { if len(password) == 0 { return errors.Error("empty password") } diff --git a/internal/home/auth_test.go b/internal/home/auth_test.go index f468d4f9684..f9bab986c3a 100644 --- a/internal/home/auth_test.go +++ b/internal/home/auth_test.go @@ -47,7 +47,7 @@ func TestAuth(t *testing.T) { s := session{} user := webUser{Name: "name"} - err := a.UserAdd(&user, "password") + err := a.Add(&user, "password") require.NoError(t, err) assert.Equal(t, checkSessionNotFound, a.checkSession("notfound")) diff --git a/internal/home/controlinstall.go b/internal/home/controlinstall.go index db6504b090c..fdd818f2117 100644 --- a/internal/home/controlinstall.go +++ b/internal/home/controlinstall.go @@ -420,7 +420,7 @@ func (web *webAPI) handleInstallConfigure(w http.ResponseWriter, r *http.Request u := &webUser{ Name: req.Username, } - err = Context.auth.UserAdd(u, req.Password) + err = Context.auth.Add(u, req.Password) if err != nil { Context.firstRun = true copyInstallSettings(config, curConfig)