We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84842ed commit 49e64ffCopy full SHA for 49e64ff
i18n/i18n.go
@@ -15,15 +15,11 @@
15
16
package i18n
17
18
-var initialized = false
19
-
20
// Init initializes the i18n module, setting the locale according to this order of preference:
21
// 1. Locale specified via the function call
22
// 2. OS Locale
23
// 3. en (default)
24
func Init(configLocale ...string) {
25
- defer func() { initialized = true }()
26
27
initRiceBox()
28
locales := supportedLocales()
29
if len(configLocale) > 1 {
@@ -50,8 +46,5 @@ func Init(configLocale ...string) {
50
46
// Tr returns msg translated to the selected locale
51
47
// the msg argument must be a literal string
52
48
func Tr(msg string, args ...interface{}) string {
53
- if !initialized {
54
- panic("i18n.Tr called before i18n.Init()")
55
- }
56
49
return po.Get(msg, args...)
57
}
0 commit comments