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
@@ -16,8 +16,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"
|
||||
"github.com/mattermost/mattermost-server/v5/utils/markdown"
|
||||
)
|
||||
|
||||
@@ -245,7 +245,7 @@ func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *mod
|
||||
|
||||
// Check for channel-wide mentions in channels that have too many members for those to work
|
||||
if int64(len(profileMap)) > *a.Config().TeamSettings.MaxNotificationsPerChannel {
|
||||
T := utils.GetUserTranslations(sender.Locale)
|
||||
T := i18n.GetUserTranslations(sender.Locale)
|
||||
|
||||
if mentions.HereMentioned {
|
||||
a.SendEphemeralPost(
|
||||
@@ -486,7 +486,7 @@ func (a *App) userAllowsEmail(user *model.User, channelMemberNotificationProps m
|
||||
}
|
||||
|
||||
func (a *App) sendNoUsersNotifiedByGroupInChannel(sender *model.User, post *model.Post, channel *model.Channel, group *model.Group) {
|
||||
T := utils.GetUserTranslations(sender.Locale)
|
||||
T := i18n.GetUserTranslations(sender.Locale)
|
||||
ephemeralPost := &model.Post{
|
||||
UserId: sender.Id,
|
||||
RootId: post.RootId,
|
||||
@@ -586,7 +586,7 @@ func makeOutOfChannelMentionPost(sender *model.User, post *model.Post, outOfChan
|
||||
ogUsers := model.UserSlice(outOfGroupsUsers)
|
||||
ogUsernames := ogUsers.Usernames()
|
||||
|
||||
T := utils.GetUserTranslations(sender.Locale)
|
||||
T := i18n.GetUserTranslations(sender.Locale)
|
||||
|
||||
ephemeralPostId := model.NewId()
|
||||
var message string
|
||||
@@ -1003,7 +1003,7 @@ func (n *PostNotification) GetChannelName(userNameFormat, excludeId string) stri
|
||||
// and whether or not the username has been overridden by an integration.
|
||||
func (n *PostNotification) GetSenderName(userNameFormat string, overridesAllowed bool) string {
|
||||
if n.Post.IsSystemMessage() {
|
||||
return utils.T("system.message.name")
|
||||
return i18n.T("system.message.name")
|
||||
}
|
||||
|
||||
if overridesAllowed && n.Channel.Type != model.CHANNEL_DIRECT {
|
||||
|
||||
Ссылка в новой задаче
Block a user