feat(i18n): Enhance internationalization support for tool specifications and notifications

- Added TitleKey and DescriptionKey fields to ToolSpec for dynamic localization.
- Updated tool specifications to use i18nx for titles, descriptions, and appendices.
- Refactored notification messages to utilize i18nx for localization in conversation and ticket assignment events.
- Improved localization in the debug dialog component for skill definitions.
- Added new translation keys in English and Chinese for ticket and conversation assignment notifications.
- Ensured that fallback messages are properly localized based on user locale.
This commit is contained in:
mlogclub
2026-06-03 09:36:33 +08:00
parent 5b6c54de34
commit 3439d20537
23 changed files with 520 additions and 265 deletions
@@ -11,6 +11,7 @@ import (
"agent-desk/internal/pkg/enums"
"agent-desk/internal/pkg/errorsx"
"agent-desk/internal/pkg/eventbus"
"agent-desk/internal/pkg/i18nx"
"agent-desk/internal/repositories"
"github.com/mlogclub/simple/sqls"
@@ -18,11 +19,19 @@ import (
var ConversationHumanDispatchService = newConversationHumanDispatchService()
const (
HandoffWaitingMessage = "We are connecting you to a human support agent. Please wait."
HandoffOffHoursMessage = "Human support is currently outside service hours. You can keep describing the issue and I will do my best to help. You can also request a human agent again when service hours resume."
var (
HandoffWaitingMessage = HandoffWaitingMessageForLocale(i18nx.DefaultLocale)
HandoffOffHoursMessage = HandoffOffHoursMessageForLocale(i18nx.DefaultLocale)
)
func HandoffWaitingMessageForLocale(locale string) string {
return i18nx.Getf(locale, "conversation.handoff.waiting")
}
func HandoffOffHoursMessageForLocale(locale string) string {
return i18nx.Getf(locale, "conversation.handoff.offHours")
}
type HandoffDecisionType string
const (