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
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type AwayProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*AwayProvider) GetTrigger() string {
|
||||
return CmdAway
|
||||
}
|
||||
|
||||
func (*AwayProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*AwayProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdAway,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type HeaderProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*HeaderProvider) GetTrigger() string {
|
||||
return CmdHeader
|
||||
}
|
||||
|
||||
func (*HeaderProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*HeaderProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdHeader,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type PurposeProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*PurposeProvider) GetTrigger() string {
|
||||
return CmdPurpose
|
||||
}
|
||||
|
||||
func (*PurposeProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*PurposeProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdPurpose,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type RenameProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*RenameProvider) GetTrigger() string {
|
||||
return CmdRename
|
||||
}
|
||||
|
||||
func (*RenameProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*RenameProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
renameAutocompleteData := model.NewAutocompleteData(CmdRename, T("api.command_channel_rename.hint"), T("api.command_channel_rename.desc"))
|
||||
renameAutocompleteData.AddTextArgument(T("api.command_channel_rename.hint"), "[text]", "")
|
||||
return &model.Command{
|
||||
|
||||
@@ -6,10 +6,9 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type CodeProvider struct {
|
||||
@@ -27,7 +26,7 @@ func (*CodeProvider) GetTrigger() string {
|
||||
return CmdCode
|
||||
}
|
||||
|
||||
func (*CodeProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*CodeProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdCode,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,11 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type CustomStatusProvider struct {
|
||||
@@ -31,7 +30,7 @@ func (*CustomStatusProvider) GetTrigger() string {
|
||||
return CmdCustomStatus
|
||||
}
|
||||
|
||||
func (*CustomStatusProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*CustomStatusProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdCustomStatus,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type DndProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*DndProvider) GetTrigger() string {
|
||||
return CmdDND
|
||||
}
|
||||
|
||||
func (*DndProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*DndProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdDND,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -8,11 +8,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
var echoSem chan bool
|
||||
@@ -32,7 +31,7 @@ func (*EchoProvider) GetTrigger() string {
|
||||
return CmdEcho
|
||||
}
|
||||
|
||||
func (*EchoProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*EchoProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdEcho,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,10 +6,9 @@ package slashcommands
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type ExpandProvider struct {
|
||||
@@ -36,7 +35,7 @@ func (*CollapseProvider) GetTrigger() string {
|
||||
return CmdCollapse
|
||||
}
|
||||
|
||||
func (*ExpandProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*ExpandProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdExpand,
|
||||
AutoComplete: true,
|
||||
@@ -45,7 +44,7 @@ func (*ExpandProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Com
|
||||
}
|
||||
}
|
||||
|
||||
func (*CollapseProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*CollapseProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdCollapse,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -7,11 +7,10 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type groupmsgProvider struct {
|
||||
@@ -29,7 +28,7 @@ func (*groupmsgProvider) GetTrigger() string {
|
||||
return CmdGroupMsg
|
||||
}
|
||||
|
||||
func (*groupmsgProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*groupmsgProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdGroupMsg,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,10 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/go-i18n/i18n"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
func TestGroupMsgUsernames(t *testing.T) {
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type HelpProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (h *HelpProvider) GetTrigger() string {
|
||||
return CmdHelp
|
||||
}
|
||||
|
||||
func (h *HelpProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (h *HelpProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdHelp,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,11 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type InviteProvider struct {
|
||||
@@ -28,7 +27,7 @@ func (*InviteProvider) GetTrigger() string {
|
||||
return CmdInvite
|
||||
}
|
||||
|
||||
func (*InviteProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*InviteProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdInvite,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,11 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type InvitePeopleProvider struct {
|
||||
@@ -28,7 +27,7 @@ func (*InvitePeopleProvider) GetTrigger() string {
|
||||
return CmdInvite_PEOPLE
|
||||
}
|
||||
|
||||
func (*InvitePeopleProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*InvitePeopleProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
autoComplete := true
|
||||
if !*a.Config().EmailSettings.SendEmailNotifications || !*a.Config().TeamSettings.EnableUserCreation || !*a.Config().ServiceSettings.EnableEmailInvitations {
|
||||
autoComplete = false
|
||||
|
||||
@@ -6,10 +6,9 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type JoinProvider struct {
|
||||
@@ -27,7 +26,7 @@ func (*JoinProvider) GetTrigger() string {
|
||||
return CmdJoin
|
||||
}
|
||||
|
||||
func (*JoinProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*JoinProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdJoin,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,10 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/go-i18n/i18n"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
func TestJoinCommandNoChannel(t *testing.T) {
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type LeaveProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*LeaveProvider) GetTrigger() string {
|
||||
return CmdLeave
|
||||
}
|
||||
|
||||
func (*LeaveProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*LeaveProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdLeave,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -12,12 +12,12 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"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/utils"
|
||||
)
|
||||
|
||||
@@ -95,7 +95,7 @@ func (*LoadTestProvider) GetTrigger() string {
|
||||
return CmdTest
|
||||
}
|
||||
|
||||
func (*LoadTestProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*LoadTestProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
if !*a.Config().ServiceSettings.EnableTesting {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type LogoutProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*LogoutProvider) GetTrigger() string {
|
||||
return CmdLogout
|
||||
}
|
||||
|
||||
func (*LogoutProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*LogoutProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdLogout,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type MeProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*MeProvider) GetTrigger() string {
|
||||
return CmdMe
|
||||
}
|
||||
|
||||
func (*MeProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*MeProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdMe,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -7,11 +7,10 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"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"
|
||||
)
|
||||
|
||||
@@ -30,7 +29,7 @@ func (*msgProvider) GetTrigger() string {
|
||||
return CmdMsg
|
||||
}
|
||||
|
||||
func (*msgProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*msgProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdMsg,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -6,10 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/mattermost/go-i18n/i18n"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
func TestMsgProvider(t *testing.T) {
|
||||
|
||||
@@ -6,10 +6,9 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type MuteProvider struct {
|
||||
@@ -27,7 +26,7 @@ func (*MuteProvider) GetTrigger() string {
|
||||
return CmdMute
|
||||
}
|
||||
|
||||
func (*MuteProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*MuteProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdMute,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/go-i18n/i18n"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
func TestMuteCommandNoChannel(t *testing.T) {
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type OfflineProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*OfflineProvider) GetTrigger() string {
|
||||
return CmdOffline
|
||||
}
|
||||
|
||||
func (*OfflineProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*OfflineProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdOffline,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type OnlineProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*OnlineProvider) GetTrigger() string {
|
||||
return CmdOnline
|
||||
}
|
||||
|
||||
func (*OnlineProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*OnlineProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdOnline,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type OpenProvider struct {
|
||||
@@ -26,7 +25,7 @@ func (open *OpenProvider) GetTrigger() string {
|
||||
return CmdOpen
|
||||
}
|
||||
|
||||
func (open *OpenProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (open *OpenProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
cmd := open.JoinProvider.GetCommand(a, T)
|
||||
cmd.Trigger = CmdOpen
|
||||
cmd.DisplayName = T("api.command_open.name")
|
||||
|
||||
@@ -6,11 +6,10 @@ package slashcommands
|
||||
import (
|
||||
"strings"
|
||||
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type RemoveProvider struct {
|
||||
@@ -37,7 +36,7 @@ func (*KickProvider) GetTrigger() string {
|
||||
return CmdKick
|
||||
}
|
||||
|
||||
func (*RemoveProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*RemoveProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdRemove,
|
||||
AutoComplete: true,
|
||||
@@ -47,7 +46,7 @@ func (*RemoveProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Com
|
||||
}
|
||||
}
|
||||
|
||||
func (*KickProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*KickProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdKick,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type SearchProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (search *SearchProvider) GetTrigger() string {
|
||||
return CmdSearch
|
||||
}
|
||||
|
||||
func (search *SearchProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (search *SearchProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdSearch,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type SettingsProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (settings *SettingsProvider) GetTrigger() string {
|
||||
return CmdSettings
|
||||
}
|
||||
|
||||
func (settings *SettingsProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (settings *SettingsProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdSettings,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type ShortcutsProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*ShortcutsProvider) GetTrigger() string {
|
||||
return CmdShortcuts
|
||||
}
|
||||
|
||||
func (*ShortcutsProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*ShortcutsProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdShortcuts,
|
||||
AutoComplete: true,
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
package slashcommands
|
||||
|
||||
import (
|
||||
goi18n "github.com/mattermost/go-i18n/i18n"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/app"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/shared/i18n"
|
||||
)
|
||||
|
||||
type ShrugProvider struct {
|
||||
@@ -25,7 +24,7 @@ func (*ShrugProvider) GetTrigger() string {
|
||||
return CmdShrug
|
||||
}
|
||||
|
||||
func (*ShrugProvider) GetCommand(a *app.App, T goi18n.TranslateFunc) *model.Command {
|
||||
func (*ShrugProvider) GetCommand(a *app.App, T i18n.TranslateFunc) *model.Command {
|
||||
return &model.Command{
|
||||
Trigger: CmdShrug,
|
||||
AutoComplete: true,
|
||||
|
||||
Ссылка в новой задаче
Block a user