Extracting i18n functionality to i18n core library (#16914)
* extracting i18n functionality to i18n core library * Removing utils.T * Adding documentation and changing one function name for better explanation * Changing other missing utils.T * Adding license string * Renaming corelibs to pkg * Renaming corelibs to pkg (moving directory) * Renaming from pkg to shared * Fixing bodyPage.Html casing * Fixing merges * Fixing merge problem * Fixing tests
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
85293fcf41
Коммит
5dd2e75c10
@@ -13,8 +13,8 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
)
|
||||
|
||||
// CreateBot creates the given bot and corresponding user.
|
||||
@@ -72,7 +72,7 @@ func (a *App) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
T := utils.GetUserTranslations(ownerUser.Locale)
|
||||
T := i18n.GetUserTranslations(ownerUser.Locale)
|
||||
botAddPost := &model.Post{
|
||||
Type: model.POST_ADD_BOT_TEAMS_CHANNELS,
|
||||
UserId: savedBot.UserId,
|
||||
@@ -471,7 +471,7 @@ func (a *App) getDisableBotSysadminMessage(user *model.User, userBots model.BotL
|
||||
botList += fmt.Sprintf("* %v\n", bot.Username)
|
||||
}
|
||||
|
||||
T := utils.GetUserTranslations(user.Locale)
|
||||
T := i18n.GetUserTranslations(user.Locale)
|
||||
message = T("app.bot.get_disable_bot_sysadmin_message",
|
||||
map[string]interface{}{
|
||||
"UserName": user.Username,
|
||||
|
||||
Ссылка в новой задаче
Block a user