MakeTranslator generates a translator from the key
(key string)
| 239 | |
| 240 | // MakeTranslator generates a translator from the key |
| 241 | func MakeTranslator(key string) Translator { |
| 242 | t := func(ctx *GinContext) string { |
| 243 | return Translate(ctx, key) |
| 244 | } |
| 245 | return Translator{Fn: t} |
| 246 | } |
| 247 | |
| 248 | // Translate translates the key to the current language of the context |
| 249 | func (t Translator) Translate(ctx *GinContext) string { |