▲ 2 ▼ textsbox - manage translations (with cache)
Simple and easy lib. to manage translations and texts, with cache, in Go project. by pagedegeek
Register to comment or vote on this story
Simple and easy lib. to manage translations and texts, with cache, in Go project. by pagedegeek
Would it make sense just to load all the translations into memory? Seems weird that some are kept in memory in a cache, and others not. Also, that cache needs mutex protection as it'll be called from several goroutines.
I think what would be really useful here is to add a helperfunc for standard go templates, that the user can use to translate strings in their templates - that's likely to the be biggest use of this, and you're not going to want to put in calls to your handlers for every string in a template that might be translated, nor is there really any need.
I've edited the title a little as it was very long.