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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user