Refactor localization strings to English across various services and UI components

- Updated titles and subtitles in channel_service.go for web channel and WeChat MP channel configurations.
- Changed handoff messages in conversation_human_dispatch_service.go to English.
- Modified notification messages in event handlers for ticket and conversation assignments to English.
- Adjusted ticket creation messages in ticket_service.go to reflect English localization.
- Updated default locale settings in i18n configuration files to English (en-US).
- Changed HTML language attribute in layout.tsx to English.
- Refactored widget locale detection logic in agent-desk-sdk.ts to prioritize English.
This commit is contained in:
mlogclub
2026-05-31 20:06:44 +08:00
parent bcf2ee38c0
commit b128447a7e
36 changed files with 315 additions and 164 deletions
+7 -6
View File
@@ -9,8 +9,9 @@ import (
)
const (
LocaleZhCN = "zh-CN"
LocaleEnUS = "en-US"
LocaleZhCN = "zh-CN"
LocaleEnUS = "en-US"
DefaultLocale = LocaleEnUS
)
var supportedLocales = map[string]string{
@@ -26,17 +27,17 @@ var supportedLocales = map[string]string{
func NormalizeLocale(value string) string {
key := strings.ToLower(strings.TrimSpace(value))
if key == "" {
return LocaleZhCN
return DefaultLocale
}
if locale, ok := supportedLocales[key]; ok {
return locale
}
return LocaleZhCN
return DefaultLocale
}
func ResolveRequestLocale(req *http.Request) string {
if req == nil {
return LocaleZhCN
return DefaultLocale
}
if locale := normalizeSupportedLocale(req.Header.Get("X-Locale")); locale != "" {
return locale
@@ -47,7 +48,7 @@ func ResolveRequestLocale(req *http.Request) string {
if locale := normalizeSupportedLocale(req.URL.Query().Get("locale")); locale != "" {
return locale
}
return LocaleZhCN
return DefaultLocale
}
func Middleware() gin.HandlerFunc {