refactor: support i18n
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"cs-agent/internal/pkg/enums"
|
||||
"cs-agent/internal/pkg/i18nx"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDashboardTextUsesEnglishLocale(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if got := dashboardText(i18nx.LocaleEnUS, "alert.pendingLongWait.title"); got != "Queued conversations are piling up" {
|
||||
t.Fatalf("dashboardText() = %q", got)
|
||||
}
|
||||
if got := dashboardText(i18nx.LocaleZhCN, "alert.pendingLongWait.title"); got != "待接入会话堆积" {
|
||||
t.Fatalf("dashboardText() = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConversationStatusLabelUsesEnglishLocale(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
if got := conversationStatusLabel(enums.IMConversationStatusPending, i18nx.LocaleEnUS); got != "Queued" {
|
||||
t.Fatalf("conversationStatusLabel() = %q", got)
|
||||
}
|
||||
if got := conversationStatusLabel(enums.IMConversationStatusPending, i18nx.LocaleZhCN); got != "待接入" {
|
||||
t.Fatalf("conversationStatusLabel() = %q", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user