MM-11008: Fix translation and change the code to be auto-extracted (#9009)

This commit is contained in:
Jesús Espino
2018-06-26 22:06:01 +02:00
committed by Elias Nahum
parent 41d2a9f435
commit 164e030d33
2 changed files with 12 additions and 4 deletions

View File

@@ -397,13 +397,13 @@ func (a *App) UpdateChannelPrivacy(oldChannel *model.Channel, user *model.User)
}
func (a *App) postChannelPrivacyMessage(user *model.User, channel *model.Channel) *model.AppError {
privacy := (map[string]string{
model.CHANNEL_OPEN: "private_to_public",
model.CHANNEL_PRIVATE: "public_to_private",
message := (map[string]string{
model.CHANNEL_OPEN: utils.T("api.channel.change_channel_privacy.private_to_public"),
model.CHANNEL_PRIVATE: utils.T("api.channel.change_channel_privacy.public_to_private"),
})[channel.Type]
post := &model.Post{
ChannelId: channel.Id,
Message: utils.T("api.channel.change_channel_privacy." + privacy),
Message: message,
Type: model.POST_CHANGE_CHANNEL_PRIVACY,
UserId: user.Id,
Props: model.StringInterface{

View File

@@ -99,6 +99,14 @@
"id": "api.channel.add_user_to_channel.type.app_error",
"translation": "Can not add user to this channel type"
},
{
"id": "api.channel.change_channel_privacy.private_to_public",
"translation": "This channel has been converted to a Public Channel and can be joined by any team member."
},
{
"id": "api.channel.change_channel_privacy.public_to_private",
"translation": "This channel has been converted to a Private Channel."
},
{
"id": "api.channel.convert_channel_to_private.default_channel_error",
"translation": "This default channel cannot be converted into a private channel."