Skip to content

Commit 21cd858

Browse files
committed
fallback if ctx is empty
1 parent 0f7d68a commit 21cd858

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

get.go

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ func (t *Translator) ctl(loc Localizer, ctx, key string, args ...interface{}) st
3434
return fmt.Sprintf(DefaultNoTranslationCTL, ctx, key)
3535
}
3636

37+
if ctx == "" {
38+
return t.tl(loc, key, args...)
39+
}
40+
3741
if !translator.IsTranslatedC(key, ctx) {
3842
if t.uniqueKeysCtx[ctx] == nil {
3943
t.uniqueKeysCtx[ctx] = make(map[string]uniqueKey)

0 commit comments

Comments
 (0)