summaryrefslogtreecommitdiffci
path: root/internal/router/handlers/lang-user.go
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'internal/router/handlers/lang-user.go')
-rw-r--r--internal/router/handlers/lang-user.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/router/handlers/lang-user.go b/internal/router/handlers/lang-user.go
index 085a9aa..eae1685 100644
--- a/internal/router/handlers/lang-user.go
+++ b/internal/router/handlers/lang-user.go
@@ -6,7 +6,6 @@ import (
"github.com/SayaAndy/saya-today-web/internal/mailer"
"github.com/SayaAndy/saya-today-web/internal/router"
- "github.com/SayaAndy/saya-today-web/l10n"
"github.com/gofiber/fiber/v2"
)
@@ -41,22 +40,22 @@ func (r *UserHandler) ToValidateLang() router.LangSetting {
func (r *UserHandler) AddMeta(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (meta []router.MetaField, err error) {
return []router.MetaField{
{Name: "robots", Content: "noindex,nofollow"},
- {Property: "og:title", Content: l10n.T.GetPath(lang, "UserProfile", "Header").(string)},
- {Property: "og:description", Content: l10n.T.GetPath(lang, "UserProfile", "Description").(string)},
+ {Property: "og:title", Content: supplements.Localization[lang].UserProfile.Header},
+ {Property: "og:description", Content: supplements.Localization[lang].UserProfile.Description},
{Property: "og:url", Content: fmt.Sprintf("%s/%s/user", templateMap["CanonicalEndpoint"], lang)},
{Property: "og:type", Content: "website"},
}, nil
}
func (r *UserHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
- templateMap["Title"] = l10n.T.GetPath(lang, "UserProfile", "Header").(string)
+ templateMap["Title"] = supplements.Localization[lang].UserProfile.Header
email, _, err := supplements.Mailer.GetInfo(supplements.Mailer.GetHash(c.IP()))
if err != nil {
slog.Error("get info from mailer about a client", slog.String("error", err.Error()))
}
- tagsArray, err := getTags(supplements.BlogClient, lang)
+ tagsArray, err := getTags(supplements.B2Client, lang)
if err != nil {
return fiber.ErrInternalServerError.Code, fmt.Errorf("failed to get the available tags")
}
@@ -84,6 +83,6 @@ func (r *UserHandler) RenderBody(c *fiber.Ctx, supplements *router.Supplements,
}
func (r *UserHandler) RenderHeader(c *fiber.Ctx, supplements *router.Supplements, lang string, templateMap fiber.Map) (statusCode int, err error) {
- templateMap["Title"] = l10n.T.GetPath(lang, "UserProfile", "Header").(string)
+ templateMap["Title"] = supplements.Localization[lang].UserProfile.Header
return fiber.StatusOK, nil
}