Passed
Push — v3.0.0 ( e47893...368635 )
by Serhii
01:19
created

localeset/localeset.go   A

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 17
dl 0
loc 22
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A localeset.New 0 3 1
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