Refactoring api to use translations (chunk 2)

- Add spanish translations
- Does not include tests
- Add func to get the translations for a user locale
Этот коммит содержится в:
Elias Nahum
2016-01-22 01:37:11 -03:00
родитель c8d22ed1fb
Коммит 6fd328ddaa
14 изменённых файлов: 2537 добавлений и 652 удалений

Просмотреть файл

@@ -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