PLT-7: Refactoring stores to use translations (chunk 7)

- Add spanish translations
This commit is contained in:
Elias Nahum
2016-01-25 16:08:06 -03:00
parent 1701a2cbbe
commit 69fbea225e
16 changed files with 1931 additions and 247 deletions

View File

@@ -368,7 +368,7 @@ func getChannels(c *Context, w http.ResponseWriter, r *http.Request) {
// user is already in the team
if result := <-Srv.Store.Channel().GetChannels(c.Session.TeamId, c.Session.UserId); result.Err != nil {
if result.Err.Message == "No channels were found" { // store translation dependant
if result.Err.Id == "store.sql_channel.get_channels.not_found.app_error" {
// lets make sure the user is valid
if result := <-Srv.Store.User().Get(c.Session.UserId); result.Err != nil {
c.Err = result.Err

View File

@@ -494,7 +494,7 @@ func inviteMembers(c *Context, w http.ResponseWriter, r *http.Request) {
var invNum int64 = 0
for i, invite := range invites.Invites {
if result := <-Srv.Store.User().GetByEmail(c.Session.TeamId, invite["email"]); result.Err == nil || result.Err.Message != store.MISSING_ACCOUNT_ERROR {
if result := <-Srv.Store.User().GetByEmail(c.Session.TeamId, invite["email"]); result.Err == nil || result.Err.Id != store.MISSING_ACCOUNT_ERROR {
invNum = int64(i)
c.Err = model.NewLocAppError("invite_members", "api.team.invite_members.already.app_error", nil, strconv.FormatInt(invNum, 10))
return