aboutsummaryrefslogtreecommitdiff
path: root/kcore/template.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2025-12-30 22:27:21 +0100
committerMartin Kagamino Lehoux <martin@lehoux.net>2025-12-30 22:27:21 +0100
commit94bffc434fe2efdae94628a6107cc581bd2dc071 (patch)
treec2b77534543685f26962b57407edc148ce4bd1e6 /kcore/template.go
parent43efffb01ca78a8165f63d427de6cffa480a40a0 (diff)
Remove old Tr from kcore
Diffstat (limited to 'kcore/template.go')
-rw-r--r--kcore/template.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/kcore/template.go b/kcore/template.go
deleted file mode 100644
index 33b2f5a..0000000
--- a/kcore/template.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package kcore
-
-import (
- "github.com/kataras/i18n"
-)
-
-type Tr = func(format string, args ...any) string
-
-type WithLanguage interface {
- Language() string
-}
-
-func GetTr(wl WithLanguage) Tr {
- lang := "en-GB"
- if wl != nil {
- lang = wl.Language()
- }
- return func(format string, args ...any) string { return i18n.Tr(lang, format, args...) }
-}
-
-type Login[U any] struct {
- Ok bool
- User U
- Tr Tr
-}
-
-func LoginFromUser[U WithLanguage](user U, ok bool) Login[U] {
- return Login[U]{
- Ok: ok,
- User: user,
- Tr: GetTr(user),
- }
-}