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:
@@ -5,11 +5,11 @@ import "strings"
|
||||
const (
|
||||
InterruptTypeTicketCreationConfirmation = "ticket_creation_confirmation"
|
||||
InterruptTypeHandoffConfirmation = "handoff_confirmation"
|
||||
ConfirmOrCancelPrompt = "请回复“确认”或“取消”。"
|
||||
NeedExplicitConfirmationPrompt = "我需要你的明确确认,请直接回复“确认”或“取消”。"
|
||||
ConfirmationExpiredReply = "本次确认已失效,请重新发起。"
|
||||
CancelCreateTicketReply = "已取消本次工单创建。"
|
||||
CancelHandoffReply = "已取消本次转人工。"
|
||||
ConfirmOrCancelPrompt = `Please reply with "Confirm" or "Cancel".`
|
||||
NeedExplicitConfirmationPrompt = `I need your explicit confirmation. Please reply with "Confirm" or "Cancel".`
|
||||
ConfirmationExpiredReply = "This confirmation has expired. Please start again."
|
||||
CancelCreateTicketReply = "Ticket creation has been cancelled."
|
||||
CancelHandoffReply = "Human handoff has been cancelled."
|
||||
)
|
||||
|
||||
type ConfirmationDecision string
|
||||
@@ -24,13 +24,13 @@ func ParseConfirmationDecision(value string) ConfirmationDecision {
|
||||
if value == "" {
|
||||
return ""
|
||||
}
|
||||
confirmWords := []string{"确认", "是", "好的", "可以", "ok", "yes", "继续", "同意"}
|
||||
confirmWords := []string{"确认", "是", "好的", "可以", "ok", "yes", "continue", "confirm", "继续", "同意"}
|
||||
for _, item := range confirmWords {
|
||||
if strings.Contains(value, item) {
|
||||
return ConfirmationDecisionConfirm
|
||||
}
|
||||
}
|
||||
cancelWords := []string{"取消", "不用", "不需要", "算了", "no"}
|
||||
cancelWords := []string{"取消", "不用", "不需要", "算了", "no", "cancel"}
|
||||
for _, item := range cancelWords {
|
||||
if strings.Contains(value, item) {
|
||||
return ConfirmationDecisionCancel
|
||||
@@ -41,5 +41,8 @@ func ParseConfirmationDecision(value string) ConfirmationDecision {
|
||||
|
||||
func IsCancellationReply(replyText string) bool {
|
||||
replyText = strings.TrimSpace(replyText)
|
||||
return strings.Contains(replyText, CancelCreateTicketReply) || strings.Contains(replyText, CancelHandoffReply)
|
||||
return strings.Contains(replyText, CancelCreateTicketReply) ||
|
||||
strings.Contains(replyText, CancelHandoffReply) ||
|
||||
strings.Contains(replyText, "已取消本次工单创建。") ||
|
||||
strings.Contains(replyText, "已取消本次转人工。")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user