Skip to content

Commit b9a8b73

Browse files
authored
Merge pull request #6 from donseba/hotfix
re-add removed methods
2 parents 6314bcc + 4d5fd33 commit b9a8b73

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

get.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,28 @@ func (t *Translator) ctn(loc Localizer, ctx, singular, plural string, n int, arg
105105
translated := translator.GetNC(singular, plural, n, ctx, args...)
106106
return t.removePrefix(translated)
107107
}
108+
109+
// Tl translates a string based on the given language tag and key.
110+
func (t *Translator) Tl(loc Localizer, key string, args ...any) string {
111+
return t.tl(loc, key, args...)
112+
}
113+
114+
// Tn method for handling plurals
115+
func (t *Translator) Tn(loc Localizer, singular, plural string, n int) string {
116+
return t.tn(loc, singular, plural, n)
117+
}
118+
119+
// Ctl method for handling string translation with context
120+
func (t *Translator) Ctl(loc Localizer, ctx, key string, args ...any) string {
121+
return t.ctl(loc, ctx, key, args...)
122+
}
123+
124+
// Ctn method for handling plurals with context
125+
func (t *Translator) Ctn(loc Localizer, ctx, singular, plural string, n int) string {
126+
return t.ctn(loc, ctx, singular, plural, n)
127+
}
128+
129+
// Details return the header of the language file
130+
func (t *Translator) Details(loc Localizer) map[string][]string {
131+
return t.languages[loc.GetLocale()].Headers
132+
}

0 commit comments

Comments
 (0)