Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package localeset |
||
2 | |||
3 | import "github.com/SerhiiCho/timeago/v3/ctx" |
||
4 | |||
5 | type LocaleForms map[string]string |
||
6 | |||
7 | type LocaleSet struct { |
||
8 | Ago string `json:"ago"` |
||
9 | Online string `json:"online"` |
||
10 | JustNow string `json:"justnow"` |
||
11 | Second LocaleForms `json:"second"` |
||
12 | Minute LocaleForms `json:"minute"` |
||
13 | Hour LocaleForms `json:"hour"` |
||
14 | Day LocaleForms `json:"day"` |
||
15 | Week LocaleForms `json:"week"` |
||
16 | Month LocaleForms `json:"month"` |
||
17 | Year LocaleForms `json:"year"` |
||
18 | } |
||
19 | |||
20 | func New(c *ctx.Ctx) *LocaleSet { |
||
21 | lang := c.Config().Language |
||
22 | return parseJsonIntoTrans("langs/" + lang + ".json") |
||
23 | } |
||
24 |