fix(i18n): use English runtime text and localize system UI

This commit is contained in:
Arthur Koba
2026-10-25 19:44:15 +03:00
parent ada0550571
commit 65a96670d5
289 changed files with 8092 additions and 3426 deletions
+23
View File
@@ -0,0 +1,23 @@
// Copyright 2026 Arctel.net
// SPDX-License-Identifier: Apache-2.0
package push
import (
"testing"
"github.com/Rain-kl/Wavelet/internal/model"
"github.com/stretchr/testify/assert"
)
func TestLocalizeEventMetadataPreservesTemplatesAndRegistry(t *testing.T) {
source := EventMetadata{Name: "Administrator login", DefaultTemplate: NotificationMessage{Title: "Administrator login notification"}}
localized := localizeEventMetadata("zh-CN", source)
assert.Equal(t, "管理员登录", localized.Name)
assert.Equal(t, "管理员登录提醒", localized.DefaultTemplate.Title)
assert.Equal(t, "Administrator login", source.Name)
assert.Equal(t, "Administrator login notification", source.DefaultTemplate.Title)
event := model.PushEvent{Name: "自定义事件", Template: `{"title":"管理员登录提醒"}`, Targets: []string{"系统"}}
assert.Equal(t, event, localizePushEvent("en", event))
}