-
Notifications
You must be signed in to change notification settings - Fork 5
/
gettext.go
37 lines (29 loc) · 1.17 KB
/
gettext.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package t
// D return a new Translations with domain
func D(domain string) *Translations { return global.D(domain) }
// L return a new Translations with locale
func L(locale string) *Translations { return global.L(locale) }
// T is a short name of gettext
func T(msgID string, args ...interface{}) string {
return global.X("", msgID, args...)
}
// N is a short name of ngettext
func N(msgID, msgIDPlural string, n int, args ...interface{}) string {
return global.XN64("", msgID, msgIDPlural, int64(n), args...)
}
// N64 is a short name of ngettext
func N64(msgID, msgIDPlural string, n int64, args ...interface{}) string {
return global.XN64("", msgID, msgIDPlural, n, args...)
}
// X is a short name of pgettext
func X(msgCtxt, msgID string, args ...interface{}) string {
return global.X(msgCtxt, msgID, args...)
}
// XN is a short name of npgettext
func XN(msgCtxt, msgID, msgIDPlural string, n int, args ...interface{}) string {
return global.XN64(msgCtxt, msgID, msgIDPlural, int64(n), args...)
}
// XN64 is a short name of npgettext
func XN64(msgCtxt, msgID, msgIDPlural string, n int64, args ...interface{}) string {
return global.XN64(msgCtxt, msgID, msgIDPlural, n, args...)
}