diff options
author | Corey Hulen <corey@hulen.com> | 2016-01-25 09:07:35 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2016-01-25 09:07:35 -0500 |
commit | 93a4e85c2d183a48f84a269c38ad4b91e9c31c14 (patch) | |
tree | 9f7cf34b9c70e76524642cf20a3b6ad3c6f3c753 /model/config.go | |
parent | 2a32bf20045a563c3656d89c9e70ab6d3c4505f0 (diff) | |
parent | f33cff21cf41ed060783e1eaad6c1c4838216ed2 (diff) | |
download | chat-93a4e85c2d183a48f84a269c38ad4b91e9c31c14.tar.gz chat-93a4e85c2d183a48f84a269c38ad4b91e9c31c14.tar.bz2 chat-93a4e85c2d183a48f84a269c38ad4b91e9c31c14.zip |
Merge pull request #1974 from ZBoxApp/PLT-7-models
PLT-7: Refactoring models to use translations (chunk 6)
Diffstat (limited to 'model/config.go')
-rw-r--r-- | model/config.go | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/model/config.go b/model/config.go index 640eb49e5..5c8604ff1 100644 --- a/model/config.go +++ b/model/config.go @@ -345,87 +345,87 @@ func (o *Config) SetDefaults() { func (o *Config) IsValid() *AppError { if o.ServiceSettings.MaximumLoginAttempts <= 0 { - return NewAppError("Config.IsValid", "Invalid maximum login attempts for service settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.login_attempts.app_error", nil, "") } if len(o.ServiceSettings.ListenAddress) == 0 { - return NewAppError("Config.IsValid", "Invalid listen address for service settings Must be set.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.listen_address.app_error", nil, "") } if o.TeamSettings.MaxUsersPerTeam <= 0 { - return NewAppError("Config.IsValid", "Invalid maximum users per team for team settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.max_users.app_error", nil, "") } if len(o.SqlSettings.AtRestEncryptKey) < 32 { - return NewAppError("Config.IsValid", "Invalid at rest encrypt key for SQL settings. Must be 32 chars or more.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.encrypt_sql.app_error", nil, "") } if !(o.SqlSettings.DriverName == DATABASE_DRIVER_MYSQL || o.SqlSettings.DriverName == DATABASE_DRIVER_POSTGRES) { - return NewAppError("Config.IsValid", "Invalid driver name for SQL settings. Must be 'mysql' or 'postgres'", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.sql_driver.app_error", nil, "") } if o.SqlSettings.MaxIdleConns <= 0 { - return NewAppError("Config.IsValid", "Invalid maximum idle connection for SQL settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.sql_idle.app_error", nil, "") } if len(o.SqlSettings.DataSource) == 0 { - return NewAppError("Config.IsValid", "Invalid data source for SQL settings. Must be set.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.sql_data_src.app_error", nil, "") } if o.SqlSettings.MaxOpenConns <= 0 { - return NewAppError("Config.IsValid", "Invalid maximum open connection for SQL settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.sql_max_conn.app_error", nil, "") } if !(o.FileSettings.DriverName == IMAGE_DRIVER_LOCAL || o.FileSettings.DriverName == IMAGE_DRIVER_S3) { - return NewAppError("Config.IsValid", "Invalid driver name for file settings. Must be 'local' or 'amazons3'", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_driver.app_error", nil, "") } if o.FileSettings.PreviewHeight < 0 { - return NewAppError("Config.IsValid", "Invalid preview height for file settings. Must be a zero or positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_preview_height.app_error", nil, "") } if o.FileSettings.PreviewWidth <= 0 { - return NewAppError("Config.IsValid", "Invalid preview width for file settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_preview_width.app_error", nil, "") } if o.FileSettings.ProfileHeight <= 0 { - return NewAppError("Config.IsValid", "Invalid profile height for file settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_profile_height.app_error", nil, "") } if o.FileSettings.ProfileWidth <= 0 { - return NewAppError("Config.IsValid", "Invalid profile width for file settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_profile_width.app_error", nil, "") } if o.FileSettings.ThumbnailHeight <= 0 { - return NewAppError("Config.IsValid", "Invalid thumbnail height for file settings. Must be a positive number.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_thumb_height.app_error", nil, "") } - if o.FileSettings.ThumbnailHeight <= 0 { - return NewAppError("Config.IsValid", "Invalid thumbnail width for file settings. Must be a positive number.", "") + if o.FileSettings.ThumbnailWidth <= 0 { + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_thumb_width.app_error", nil, "") } if len(o.FileSettings.PublicLinkSalt) < 32 { - return NewAppError("Config.IsValid", "Invalid public link salt for file settings. Must be 32 chars or more.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.file_salt.app_error", nil, "") } if !(o.EmailSettings.ConnectionSecurity == CONN_SECURITY_NONE || o.EmailSettings.ConnectionSecurity == CONN_SECURITY_TLS || o.EmailSettings.ConnectionSecurity == CONN_SECURITY_STARTTLS) { - return NewAppError("Config.IsValid", "Invalid connection security for email settings. Must be '', 'TLS', or 'STARTTLS'", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.email_security.app_error", nil, "") } if len(o.EmailSettings.InviteSalt) < 32 { - return NewAppError("Config.IsValid", "Invalid invite salt for email settings. Must be 32 chars or more.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.email_salt.app_error", nil, "") } if len(o.EmailSettings.PasswordResetSalt) < 32 { - return NewAppError("Config.IsValid", "Invalid password reset salt for email settings. Must be 32 chars or more.", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.email_reset_salt.app_error", nil, "") } if o.RateLimitSettings.MemoryStoreSize <= 0 { - return NewAppError("Config.IsValid", "Invalid memory store size for rate limit settings. Must be a positive number", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.rate_mem.app_error", nil, "") } if o.RateLimitSettings.PerSec <= 0 { - return NewAppError("Config.IsValid", "Invalid per sec for rate limit settings. Must be a positive number", "") + return NewLocAppError("Config.IsValid", "model.config.is_valid.rate_sec.app_error", nil, "") } return nil |