mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user