Move to the mattermost/go-i18n fork (#10669)

This change is being made to address an issue where the go-i18n
translation library would result in partial-translations when a
given language dictionary was missing a given plural keyword. The
improvement made here leads the translation library to try an
'other' keyword lookup if the first plural keyword fails to have
a value.

This change was not accepted upstream due to concern regarding
changing the behavior, so we are using a fork at this time to
address the issue.
Этот коммит содержится в:
Gabe Jackson
2019-04-23 09:33:42 -04:00
коммит произвёл GitHub
родитель 0d1c69927f
Коммит be4b473aee
78 изменённых файлов: 888 добавлений и 409 удалений

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

@@ -9,6 +9,7 @@ import (
"net/http"
"strconv"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/einterfaces"
"github.com/mattermost/mattermost-server/jobs"
"github.com/mattermost/mattermost-server/mlog"
@@ -17,7 +18,6 @@ import (
"github.com/mattermost/mattermost-server/services/imageproxy"
"github.com/mattermost/mattermost-server/services/timezones"
"github.com/mattermost/mattermost-server/utils"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type App struct {

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

@@ -11,11 +11,11 @@ import (
"net/url"
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/store"
"github.com/mattermost/mattermost-server/utils"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type CommandProvider interface {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type AwayProvider struct {

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

@@ -4,7 +4,7 @@
package app
import (
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
)

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

@@ -4,7 +4,7 @@
package app
import (
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
)

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

@@ -4,7 +4,7 @@
package app
import (
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
)

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

@@ -6,8 +6,8 @@ package app
import (
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type CodeProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type DndProvider struct {

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

@@ -9,9 +9,9 @@ import (
"strings"
"time"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
var echoSem chan bool

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

@@ -6,8 +6,8 @@ package app
import (
"strconv"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type ExpandProvider struct {

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

@@ -7,9 +7,9 @@ import (
"fmt"
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type groupmsgProvider struct {

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

@@ -3,7 +3,7 @@ package app
import (
"testing"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/mattermost/go-i18n/i18n"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/model"

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type HelpProvider struct {

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

@@ -6,7 +6,7 @@ package app
import (
"strings"
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"

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

@@ -6,9 +6,9 @@ package app
import (
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type InvitePeopleProvider struct {

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

@@ -6,7 +6,7 @@ package app
import (
"strings"
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
)

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

@@ -6,7 +6,7 @@ package app
import (
"testing"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/mattermost/go-i18n/i18n"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/model"

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type LeaveProvider struct {

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

@@ -10,10 +10,10 @@ import (
"strconv"
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
var usage = `Mattermost testing commands to help configure the system

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type LogoutProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type MeProvider struct {

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

@@ -6,9 +6,9 @@ package app
import (
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type msgProvider struct {

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

@@ -6,7 +6,7 @@ package app
import (
"testing"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/mattermost/go-i18n/i18n"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/model"

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

@@ -6,8 +6,8 @@ package app
import (
"strings"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type MuteProvider struct {

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

@@ -7,8 +7,8 @@ import (
"testing"
"time"
"github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/stretchr/testify/assert"
)

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type OfflineProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type OnlineProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type OpenProvider struct {

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

@@ -6,7 +6,7 @@ package app
import (
"strings"
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type SearchProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type SettingsProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type ShortcutsProvider struct {

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

@@ -4,8 +4,8 @@
package app
import (
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
type ShrugProvider struct {

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

@@ -9,7 +9,7 @@ import (
"net/http"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/mattermost/go-i18n/i18n"
"github.com/pkg/errors"
"github.com/throttled/throttled"
"github.com/throttled/throttled/store/memstore"

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

@@ -16,7 +16,7 @@ import (
"net/http"
"github.com/nicksnyder/go-i18n/i18n"
"github.com/mattermost/go-i18n/i18n"
)
const (

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

@@ -13,7 +13,7 @@ var mainHelper *testlib.MainHelper
func TestMain(m *testing.M) {
var options = testlib.HelperOptions{
EnableStore: true,
EnableStore: true,
EnableResources: true,
}

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

@@ -11,10 +11,10 @@ import (
"strings"
"time"
"github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
"github.com/nicksnyder/go-i18n/i18n"
)
func (a *App) sendNotificationEmail(notification *postNotification, user *model.User, team *model.Team) *model.AppError {

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

@@ -9,10 +9,10 @@ import (
"net/http"
"strings"
"github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils"
"github.com/nicksnyder/go-i18n/i18n"
)
type NotificationType string

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

@@ -230,7 +230,7 @@ func TestPanicLog(t *testing.T) {
ConsoleJson: true,
EnableFile: true,
FileLocation: tmpfile.Name(),
FileLevel: mlog.LevelInfo,
FileLevel: mlog.LevelInfo,
})
// Creating a server with logger

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

@@ -10,9 +10,9 @@ import (
"time"
"github.com/gorilla/websocket"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/model"
goi18n "github.com/nicksnyder/go-i18n/i18n"
)
const (

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

@@ -8,7 +8,7 @@ import (
"time"
"github.com/gorilla/websocket"
goi18n "github.com/nicksnyder/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/model"