[MM-39299] Remove outdated translations and update go-i18n library (#18674)

* Remove outdated translations

* update go-i18n dependency

* reflect review comments

* add message count for languages which has two translations for plurals
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2021-10-15 16:26:25 +03:00
коммит произвёл GitHub
родитель 99e6039472
Коммит ba3a911c99
7 изменённых файлов: 9 добавлений и 22 удалений

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

@@ -328,7 +328,7 @@ func (es *Service) sendBatchedEmailNotification(userID string, notifications []*
data := es.NewEmailTemplateData(user.Locale)
data.Props["SiteURL"] = siteURL
data.Props["Title"] = translateFunc("api.email_batching.send_batched_email_notification.title")
data.Props["Title"] = translateFunc("api.email_batching.send_batched_email_notification.title", len(notifications)-1)
data.Props["SubTitle"] = translateFunc("api.email_batching.send_batched_email_notification.subTitle")
data.Props["Button"] = translateFunc("api.email_batching.send_batched_email_notification.button")
data.Props["ButtonURL"] = siteURL

2
go.mod
Просмотреть файл

@@ -66,7 +66,7 @@ require (
github.com/ledongthuc/pdf v0.0.0-20210621053716-e28cb8259002
github.com/lib/pq v1.10.3
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattermost/go-i18n v1.11.0
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404
github.com/mattermost/gorp v1.6.2-0.20210714143452-8b50f5209a7f
github.com/mattermost/gosaml2 v0.3.3
github.com/mattermost/gziphandler v0.0.1

4
go.sum
Просмотреть файл

@@ -746,8 +746,8 @@ github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsI
github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/marstr/guid v0.0.0-20170427235115-8bdf7d1a087c/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/mattermost/go-i18n v1.11.0 h1:1hLKqn/ZvhZ80OekjVPGYcCrBfMz+YxNNgqS+beL7zE=
github.com/mattermost/go-i18n v1.11.0/go.mod h1:RyS7FDNQlzF1PsjbJWHRI35exqaKGSO9qD4iv8QjE34=
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 h1:Khvh6waxG1cHc4Cz5ef9n3XVCxRWpAKUtqg9PJl5+y8=
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404/go.mod h1:RyS7FDNQlzF1PsjbJWHRI35exqaKGSO9qD4iv8QjE34=
github.com/mattermost/gorp v1.6.2-0.20210714143452-8b50f5209a7f h1:J47te5ubXIEbEaXi/nwStKQ/sLniXACgZ7LhK365YIY=
github.com/mattermost/gorp v1.6.2-0.20210714143452-8b50f5209a7f/go.mod h1:QCQ3U0M9T/BlAdjKFJo0I1oe/YAgbyjNdhU8bpOLafk=
github.com/mattermost/gosaml2 v0.3.3 h1:ysWrjp08tpWmo6rV2MQ88Eag/Ttjuj91fZsvibF4/Tg=

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

@@ -8887,13 +8887,6 @@
"id": "api.error_get_first_admin_visit_marketplace_status",
"translation": "Грешка при опит за извличане от хранилището статуса първо администраторско посещение на пазара ."
},
{
"id": "api.email_batching.send_batched_email_notification.title",
"translation": {
"one": "{{ .SenderName }} Ви изпрати ново съобщение",
"other": "{{ .SenderName }} и {{.Count}} други Ви изпратиха ново съобщение"
}
},
{
"id": "api.email_batching.send_batched_email_notification.time",
"translation": "{{.Hour}}:{{.Minute}} {{.TimeZone}}"

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

@@ -8955,13 +8955,6 @@
"id": "api.server.warn_metric.support_email_not_configured.notification_title",
"translation": "Állítsa be a támogatási email címét"
},
{
"id": "api.email_batching.send_batched_email_notification.title",
"translation": {
"one": "Önnek új üzenetei vannak",
"other": "{{ .SenderName }} és {{.Count}} másvalaki új üzenetet kültek Önnek"
}
},
{
"id": "api.email_batching.send_batched_email_notification.subTitle",
"translation": "Az új üzenetek összefoglalását lásd alább."

7
vendor/github.com/mattermost/go-i18n/i18n/bundle/bundle.go сгенерированный поставляемый
Просмотреть файл

@@ -386,12 +386,13 @@ func (b *Bundle) translate(lang *language.Language, translationID string, args .
countInt, ok := count.(int)
if ok && countInt > 1 {
template = translation.Template(language.Other)
if template == nil {
return translationID
}
}
}
if template == nil {
return translationID
}
s := template.Execute(data)
if s == "" {
return translationID

2
vendor/modules.txt поставляемый
Просмотреть файл

@@ -374,7 +374,7 @@ github.com/mailru/easyjson
github.com/mailru/easyjson/buffer
github.com/mailru/easyjson/jlexer
github.com/mailru/easyjson/jwriter
# github.com/mattermost/go-i18n v1.11.0
# github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404
## explicit
github.com/mattermost/go-i18n/i18n
github.com/mattermost/go-i18n/i18n/bundle