summaryrefslogtreecommitdiffstats
path: root/model/post.go
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-01-25 10:22:12 -0300
committerElias Nahum <nahumhbl@gmail.com>2016-01-25 10:22:12 -0300
commitf33cff21cf41ed060783e1eaad6c1c4838216ed2 (patch)
treed69baef96371c2e23b65ecbbccb221161d8d2fb7 /model/post.go
parent7b3be6c77e622dedab0b8d8c1d5fd0e7aa76de46 (diff)
downloadchat-f33cff21cf41ed060783e1eaad6c1c4838216ed2.tar.gz
chat-f33cff21cf41ed060783e1eaad6c1c4838216ed2.tar.bz2
chat-f33cff21cf41ed060783e1eaad6c1c4838216ed2.zip
PLT-7: Refactoring models to use translations (chunk 6)
- Add spanish translations
Diffstat (limited to 'model/post.go')
-rw-r--r--model/post.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/model/post.go b/model/post.go
index 5c86ce70d..f9f5a4d1c 100644
--- a/model/post.go
+++ b/model/post.go
@@ -62,60 +62,60 @@ func (o *Post) Etag() string {
func (o *Post) IsValid() *AppError {
if len(o.Id) != 26 {
- return NewAppError("Post.IsValid", "Invalid Id", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.id.app_error", nil, "")
}
if o.CreateAt == 0 {
- return NewAppError("Post.IsValid", "Create at must be a valid time", "id="+o.Id)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.create_at.app_error", nil, "id="+o.Id)
}
if o.UpdateAt == 0 {
- return NewAppError("Post.IsValid", "Update at must be a valid time", "id="+o.Id)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.update_at.app_error", nil, "id="+o.Id)
}
if len(o.UserId) != 26 {
- return NewAppError("Post.IsValid", "Invalid user id", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.user_id.app_error", nil, "")
}
if len(o.ChannelId) != 26 {
- return NewAppError("Post.IsValid", "Invalid channel id", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.channel_id.app_error", nil, "")
}
if !(len(o.RootId) == 26 || len(o.RootId) == 0) {
- return NewAppError("Post.IsValid", "Invalid root id", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.root_id.app_error", nil, "")
}
if !(len(o.ParentId) == 26 || len(o.ParentId) == 0) {
- return NewAppError("Post.IsValid", "Invalid parent id", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.parent_id.app_error", nil, "")
}
if len(o.ParentId) == 26 && len(o.RootId) == 0 {
- return NewAppError("Post.IsValid", "Invalid root id must be set if parent id set", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.root_parent.app_error", nil, "")
}
if !(len(o.OriginalId) == 26 || len(o.OriginalId) == 0) {
- return NewAppError("Post.IsValid", "Invalid original id", "")
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.original_id.app_error", nil, "")
}
if utf8.RuneCountInString(o.Message) > 4000 {
- return NewAppError("Post.IsValid", "Invalid message", "id="+o.Id)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.msg.app_error", nil, "id="+o.Id)
}
if utf8.RuneCountInString(o.Hashtags) > 1000 {
- return NewAppError("Post.IsValid", "Invalid hashtags", "id="+o.Id)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.hashtags.app_error", nil, "id="+o.Id)
}
// should be removed once more message types are supported
if !(o.Type == POST_DEFAULT || o.Type == POST_JOIN_LEAVE || o.Type == POST_SLACK_ATTACHMENT || o.Type == POST_HEADER_CHANGE) {
- return NewAppError("Post.IsValid", "Invalid type", "id="+o.Type)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.type.app_error", nil, "id="+o.Type)
}
if utf8.RuneCountInString(ArrayToJson(o.Filenames)) > 4000 {
- return NewAppError("Post.IsValid", "Invalid filenames", "id="+o.Id)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.filenames.app_error", nil, "id="+o.Id)
}
if utf8.RuneCountInString(StringInterfaceToJson(o.Props)) > 8000 {
- return NewAppError("Post.IsValid", "Invalid props", "id="+o.Id)
+ return NewLocAppError("Post.IsValid", "model.post.is_valid.props.app_error", nil, "id="+o.Id)
}
return nil