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:
+1
-1
@@ -43,7 +43,7 @@ export default function RootLayout({
|
||||
children: React.ReactNode
|
||||
}>) {
|
||||
return (
|
||||
<html lang="zh-CN" suppressHydrationWarning>
|
||||
<html lang="en-US" suppressHydrationWarning>
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
|
||||
@@ -25,6 +25,7 @@ async function loadConfig() {
|
||||
test("normalizes supported locale aliases", async () => {
|
||||
const { DEFAULT_LOCALE, normalizeLocale } = await loadConfig()
|
||||
|
||||
assert.equal(DEFAULT_LOCALE, "en-US")
|
||||
assert.equal(normalizeLocale("zh-CN"), "zh-CN")
|
||||
assert.equal(normalizeLocale("zh_CN"), "zh-CN")
|
||||
assert.equal(normalizeLocale("zh"), "zh-CN")
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
export const SUPPORTED_LOCALES = ["zh-CN", "en-US"] as const
|
||||
export type AppLocale = (typeof SUPPORTED_LOCALES)[number]
|
||||
|
||||
export const DEFAULT_LOCALE: AppLocale = "zh-CN"
|
||||
export const DEFAULT_LOCALE: AppLocale = "en-US"
|
||||
export const LOCALE_STORAGE_KEY = "cs_ai_agent_locale"
|
||||
|
||||
const LOCALE_ALIASES: Record<string, AppLocale> = {
|
||||
|
||||
@@ -42,9 +42,9 @@ function getWidgetLocale() {
|
||||
try {
|
||||
const stored = window.localStorage?.getItem("cs_ai_agent_locale")
|
||||
const language = stored || document.documentElement.lang || window.navigator?.language || ""
|
||||
return language.toLowerCase().startsWith("en") ? "en-US" : "zh-CN"
|
||||
return language.toLowerCase().startsWith("zh") ? "zh-CN" : "en-US"
|
||||
} catch {
|
||||
return "zh-CN"
|
||||
return "en-US"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user