Use i18n.Reset to reload locales (#15073)

This commit is contained in:
6543 authored and GitHub committed 2021-03-21 16:11:36 +01:00
1 parent 17731e05ff
commit 24f7bd5899
5 files changed
+11 -12

No files matched your search

+5
View File
@@ -174,6 +174,11 @@ func SetMessageWithDesc(lang, langDesc string, localeFile interface{}, otherLoca
return err
}
// Reset resets locale store.
func Reset() {
locales = &localeStore{store: make(map[string]*locale)}
}
// SetMessage sets the message file for localization.
func SetMessage(lang string, localeFile interface{}, otherLocaleFiles ...interface{}) error {
return SetMessageWithDesc(lang, lang, localeFile, otherLocaleFiles...)