PLT-1800 Load server side locale from the config.json (#3135)

* PLT-1800 Load server side locale from the config.json

* Add support for locales with country specifics

* Fix localization on served locale file as plain/text

* Remove github.com/cloudfoundry/jibber_jabber as vendor dependency
This commit is contained in:
enahum
2016-06-01 08:56:13 -04:00
committed by Christopher Speller
parent 7be2a05cf5
commit b00a60ab71
38 changed files with 375 additions and 893 deletions
-1
View File
@@ -10,7 +10,6 @@ import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
_ "github.com/cloudfoundry/jibber_jabber"
_ "github.com/nicksnyder/go-i18n/i18n"
)
+2 -2
View File
@@ -30,7 +30,7 @@ type TestHelper struct {
func SetupEnterprise() *TestHelper {
if Srv == nil {
utils.LoadConfig("config.json")
utils.InitTranslations()
utils.InitTranslations(utils.Cfg.LocalizationSettings)
utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
utils.DisableDebugLogForTest()
utils.License.Features.SetDefaults()
@@ -50,7 +50,7 @@ func SetupEnterprise() *TestHelper {
func Setup() *TestHelper {
if Srv == nil {
utils.LoadConfig("config.json")
utils.InitTranslations()
utils.InitTranslations(utils.Cfg.LocalizationSettings)
utils.Cfg.TeamSettings.MaxUsersPerTeam = 50
utils.DisableDebugLogForTest()
NewServer()
+1
View File
@@ -239,6 +239,7 @@ func CreateUser(user *model.User) (*model.User, *model.AppError) {
}
user.MakeNonNil()
user.Locale = *utils.Cfg.LocalizationSettings.DefaultClientLocale
if result := <-Srv.Store.User().Save(user); result.Err != nil {
l4g.Error(utils.T("api.user.create_user.save.error"), result.Err)