summaryrefslogtreecommitdiff
path: root/core/template.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:38:40 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2023-10-24 08:38:40 +0200
commita9927763f43d59c418b264790ccee59defe8ca29 (patch)
tree5dfc4f1f1f29d1ef1cbca3406bf57d1667b93f76 /core/template.go
parented23d402fec268e163ec895748f43e3254ba3dfd (diff)
refactor: Rename packages for clarityv0.3.0
Diffstat (limited to 'core/template.go')
-rw-r--r--core/template.go33
1 files changed, 0 insertions, 33 deletions
diff --git a/core/template.go b/core/template.go
deleted file mode 100644
index a0d0668..0000000
--- a/core/template.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package core
-
-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),
- }
-}