summaryrefslogtreecommitdiffstats
path: root/api/import.go
diff options
context:
space:
mode:
authorElias Nahum <nahumhbl@gmail.com>2016-01-22 01:37:11 -0300
committerElias Nahum <nahumhbl@gmail.com>2016-01-22 01:37:11 -0300
commit6fd328ddaa61cd75c24cd2d9b8fdc0f73c7ab974 (patch)
tree04014253d528a8f8f79f7c26b02339e2945b20a5 /api/import.go
parentc8d22ed1fba591e7a6b18afc5e6a6d541c11645c (diff)
downloadchat-6fd328ddaa61cd75c24cd2d9b8fdc0f73c7ab974.tar.gz
chat-6fd328ddaa61cd75c24cd2d9b8fdc0f73c7ab974.tar.bz2
chat-6fd328ddaa61cd75c24cd2d9b8fdc0f73c7ab974.zip
Refactoring api to use translations (chunk 2)
- Add spanish translations - Does not include tests - Add func to get the translations for a user locale
Diffstat (limited to 'api/import.go')
-rw-r--r--api/import.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/api/import.go b/api/import.go
index 5c8f99348..7590277b0 100644
--- a/api/import.go
+++ b/api/import.go
@@ -6,6 +6,7 @@ package api
import (
l4g "github.com/alecthomas/log4go"
"github.com/mattermost/platform/model"
+ "github.com/mattermost/platform/utils"
)
//
@@ -17,7 +18,7 @@ func ImportPost(post *model.Post) {
post.Hashtags, _ = model.ParseHashtags(post.Message)
if result := <-Srv.Store.Post().Save(post); result.Err != nil {
- l4g.Debug("Error saving post. user=" + post.UserId + ", message=" + post.Message)
+ l4g.Debug(utils.T("api.import.import_post.saving.debug"), post.UserId, post.Message)
}
}
@@ -25,17 +26,17 @@ func ImportUser(user *model.User) *model.User {
user.MakeNonNil()
if result := <-Srv.Store.User().Save(user); result.Err != nil {
- l4g.Error("Error saving user. err=%v", result.Err)
+ l4g.Error(utils.T("api.import.import_user.saving.error"), result.Err)
return nil
} else {
ruser := result.Data.(*model.User)
if err := JoinDefaultChannels(ruser, ""); err != nil {
- l4g.Error("Encountered an issue joining default channels user_id=%s, team_id=%s, err=%v", ruser.Id, ruser.TeamId, err)
+ l4g.Error(utils.T("api.import.import_user.joining_default.error"), ruser.Id, ruser.TeamId, err)
}
if cresult := <-Srv.Store.User().VerifyEmail(ruser.Id); cresult.Err != nil {
- l4g.Error("Failed to set email verified err=%v", cresult.Err)
+ l4g.Error(utils.T("api.import.import_user.set_email.error"), cresult.Err)
}
return ruser