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
Этот коммит содержится в:
Jesús Espino
2021-02-26 08:12:49 +01:00
коммит произвёл GitHub
родитель 85293fcf41
Коммит 5dd2e75c10
90 изменённых файлов: 596 добавлений и 568 удалений

Просмотреть файл

@@ -17,8 +17,8 @@ import (
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/services/cache"
"github.com/mattermost/mattermost-server/v5/shared/i18n"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
)
const (
@@ -65,7 +65,7 @@ func (a *App) CreatePostAsUser(post *model.Post, currentSessionId string, setOnl
}
}
T := utils.GetUserTranslations(user.Locale)
T := i18n.GetUserTranslations(user.Locale)
a.SendEphemeralPost(
post.UserId,
&model.Post{
@@ -218,7 +218,7 @@ func (a *App) CreatePost(post *model.Post, channel *model.Channel, triggerWebhoo
if post.Type == "" && !a.HasPermissionToChannel(user.Id, channel.Id, model.PERMISSION_USE_CHANNEL_MENTIONS) {
mention := post.DisableMentionHighlights()
if mention != "" {
T := utils.GetUserTranslations(user.Locale)
T := i18n.GetUserTranslations(user.Locale)
ephemeralPost = &model.Post{
UserId: user.Id,
RootId: post.RootId,