Refactoring api to use translations (chunk 2)

- Add spanish translations
- Does not include tests
- Add func to get the translations for a user locale
This commit is contained in:
Elias Nahum
2016-01-22 01:37:11 -03:00
parent c8d22ed1fb
commit 6fd328ddaa
14 changed files with 2537 additions and 652 deletions

View File

@@ -57,6 +57,15 @@ func GetTranslationsBySystemLocale() i18n.TranslateFunc {
return translations
}
func GetUserTranslations(locale string) i18n.TranslateFunc {
if _, ok := locales[locale]; !ok {
locale = model.DEFAULT_LOCALE
}
translations, _ := i18n.Tfunc(locale)
return translations
}
func SetTranslations(locale string) i18n.TranslateFunc {
translations, _ := i18n.Tfunc(locale)
return translations