sprig
sprig copied to clipboard
Add localization functions
It would be nice to add localization functions. Not sure how it would all be composed, but something like:
t "FR" "cheese"
-> "fromage"
would be nice.
It would be particularly nice to be able to set a "global" language and translation strings facility and then be able to just call t "cheese"
. This is how Drupal does it.
The backend would need something like:
type Translator interface {
T(string) string
}
An easy map-based backend could satisfy that interface.
Hey! I have added simple implementation of such function, please check the code, if you have any comments, im ready to improve it