Refactoring api to use translations (chunk 2)
- Add spanish translations - Does not include tests - Add func to get the translations for a user locale
Этот коммит содержится в:
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user