A simple lib to fetch translation files from Localise and save it in a go-i18n compatible format.
Checkout the V2 for multiple projects and automatic assets update.
package main
import (
"fmt"
loco "github.com/lucasmdrs/go-loco"
"github.com/nicksnyder/go-i18n/i18n"
)
func main() {
err := loco.FetchTranslations("MY_LOCALISE_KEY", "./", "pt-BR", "en-US")
if err != nil {
panic(err)
}
i18n.MustLoadTranslationFile("en-US.json")
i18n.MustLoadTranslationFile("pt-BR.json")
T, _ := i18n.Tfunc("pt-BR")
fmt.Println(T("hello"))
}