mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 14:54:23 +08:00
feat(i18n): add Russian UI and harden localization
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
"github.com/Rain-kl/Wavelet/internal/infra/task"
|
||||
"github.com/Rain-kl/Wavelet/internal/model"
|
||||
"github.com/Rain-kl/Wavelet/internal/repository"
|
||||
"github.com/Rain-kl/Wavelet/pkg/i18n"
|
||||
pkgpush "github.com/Rain-kl/Wavelet/pkg/push"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
@@ -25,6 +24,10 @@ type smtpConfig struct {
|
||||
Password string
|
||||
}
|
||||
|
||||
// This persisted recipient alias predates localization. Display translations
|
||||
// must never expand the set of reserved routing identifiers.
|
||||
const legacySystemTarget = "\u7cfb\u7edf"
|
||||
|
||||
func loadSMTPConfig(ctx context.Context) smtpConfig {
|
||||
host, _ := repository.GetSystemConfigByKey(ctx, model.ConfigKeySMTPHost)
|
||||
port, _ := repository.GetSystemConfigByKey(ctx, model.ConfigKeySMTPPort)
|
||||
@@ -332,7 +335,7 @@ func resolveTargetUser(ctx context.Context, resolved string, _ string) (model.Us
|
||||
}
|
||||
|
||||
func resolveSystemTarget(ctx context.Context, resolved string, channel string) (string, bool) {
|
||||
if i18n.Translate("en", resolved) != "System" && resolved != "system" && resolved != "0" {
|
||||
if resolved != legacySystemTarget && resolved != "system" && resolved != "0" {
|
||||
return "", false
|
||||
}
|
||||
adminUser, err := repository.GetFirstAdminUser(ctx)
|
||||
|
||||
Reference in New Issue
Block a user