sprig icon indicating copy to clipboard operation
sprig copied to clipboard

Add localization functions

Open technosophos opened this issue 8 years ago • 1 comments

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.

technosophos avatar Jun 21 '16 19:06 technosophos

Hey! I have added simple implementation of such function, please check the code, if you have any comments, im ready to improve it

dmitrijivanenko avatar Sep 17 '17 18:09 dmitrijivanenko