github.com/gocaveman/caveman@v0.0.0-20191211162744-0ddf99dbdf6e/i18n/handler-requestinfo.go (about) 1 package i18n 2 3 // hm, struct or interface... maybe struct but T or whatever else can be interface - but again, hm, 4 // the concept of "give me the locales for this page" really should be an interface... 5 // type RequestInfo struct { 6 // Locales() []string 7 // Translator() Translator 8 // LocaleTranslator() LocaleTranslator 9 // Processor Processor 10 // } 11 12 // probaby a T call right on here and the template rendering stuff too, although rendering should also 13 // be avail separatey for Go code 14 15 // Group(g string) 16 17 // T 18 // TProc 19 20 // T2 21 // T2Proc 22 23 // we also should have a call that splits by colon into group and key - for cases where a string field is 24 // coming in from something that doesn't support translations or isn't aware of the locale and we need to 25 // be able to express group:key as one string 26 // TODO: make sure this makes it into the documentation article. 27 28 // func NewRequestInfoHandler(tr Translator) webutil.HandlerChain { 29 30 // } 31 32 // type RequestInfoHandler struct { 33 // Translator Translator 34 // }