fix(webui): rename arguments translation key to tool_arguments to avoid strict mode reserved word error

This commit is contained in:
yiling
2026-06-27 10:14:16 +08:00
parent 5c21463075
commit 8779ae52a2
8 changed files with 44 additions and 43 deletions
@@ -18,6 +18,7 @@ import { Avatar, AvatarFallback, AvatarImage } from '../ui/avatar'
import { DrawAnnotation } from '../ui/icons'
import { Skeleton } from '../ui/skeleton'
import { formatTimestamp } from '../viewers/utils'
import { m } from '@/ui/paraglide/messages.js'
interface MessageCardProps {
teamId?: string
@@ -445,7 +446,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
renderedBlocks.push(
<div key={`tool-${idx}`} className="text-xs space-y-2 py-1">
<div className="font-semibold text-violet-600 dark:text-violet-400 flex items-center gap-1.5">
Calling Tool:{' '}
{m.calling_tool()}{' '}
<span className="font-mono bg-violet-500/10 px-1 py-0.5 rounded text-[11px]">
{toolName}
</span>
@@ -453,7 +454,7 @@ export const MessageCard: React.FC<MessageCardProps> = ({
{!!toolArgs && (
<div className="space-y-1 pt-3">
<div className="text-[10px] text-muted-foreground/60 uppercase font-bold tracking-wider">
Arguments
{m.tool_arguments()}
</div>
{renderToolCallArguments(toolArgs)}
</div>
+1 -1
View File
@@ -739,7 +739,7 @@
"tool_result": "Tool Result:",
"role_thinking": "Thinking",
"calling_tool": "Calling Tool:",
"arguments": "Arguments",
"tool_arguments": "Arguments",
"image_object": "[Image Object]",
"no_logs_found": "No logs found for this session.",
"session_no_entries_yet": "The session might have been initialized but has not produced any entries yet.",
+1 -1
View File
@@ -739,7 +739,7 @@
"tool_result": "工具结果:",
"role_thinking": "思考中",
"calling_tool": "调用工具:",
"arguments": "参数",
"tool_arguments": "参数",
"image_object": "[图片对象]",
"no_logs_found": "未找到此会话的日志。",
"session_no_entries_yet": "该会话可能已初始化但尚未产生任何条目。",
+1 -1
View File
@@ -693,7 +693,7 @@ export * from './role_agent.js'
export * from './tool_result.js'
export * from './role_thinking.js'
export * from './calling_tool.js'
export * from './arguments.js'
export * from './tool_arguments.js'
export * from './image_object.js'
export * from './no_logs_found.js'
export * from './session_no_entries_yet.js'
+1 -1
View File
@@ -695,7 +695,7 @@ export * from './role_agent.js'
export * from './tool_result.js'
export * from './role_thinking.js'
export * from './calling_tool.js'
export * from './arguments.js'
export * from './tool_arguments.js'
export * from './image_object.js'
export * from './no_logs_found.js'
export * from './session_no_entries_yet.js'
@@ -1,32 +0,0 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js'
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} ArgumentsInputs */
const en_arguments = /** @type {(inputs: ArgumentsInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Arguments`)
}
const zh_arguments = /** @type {(inputs: ArgumentsInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`参数`)
}
/**
* | output |
* | --- |
* | "Arguments" |
*
* @param {ArgumentsInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const arguments =
/** @type {((inputs?: ArgumentsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<ArgumentsInputs, { locale?: "en" | "zh" }, {}>} */ (
(inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === 'en') return en_arguments(inputs)
return zh_arguments(inputs)
}
)
@@ -3,22 +3,22 @@
* | --- |
* | "Arguments" |
*
* @param {ArgumentsInputs} inputs
* @param {Tool_ArgumentsInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const arguments: ((
inputs?: ArgumentsInputs,
export const tool_arguments: ((
inputs?: Tool_ArgumentsInputs,
options?: {
locale?: 'en' | 'zh'
},
) => LocalizedString) &
import('../runtime.js').MessageMetadata<
ArgumentsInputs,
Tool_ArgumentsInputs,
{
locale?: 'en' | 'zh'
},
{}
>
export type LocalizedString = import('../runtime.js').LocalizedString
export type ArgumentsInputs = {}
export type Tool_ArgumentsInputs = {}
@@ -0,0 +1,32 @@
/* eslint-disable */
import { getLocale, experimentalStaticLocale } from '../runtime.js'
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
/** @typedef {{}} Tool_ArgumentsInputs */
const en_tool_arguments = /** @type {(inputs: Tool_ArgumentsInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`Arguments`)
}
const zh_tool_arguments = /** @type {(inputs: Tool_ArgumentsInputs) => LocalizedString} */ () => {
return /** @type {LocalizedString} */ (`参数`)
}
/**
* | output |
* | --- |
* | "Arguments" |
*
* @param {Tool_ArgumentsInputs} inputs
* @param {{ locale?: "en" | "zh" }} options
* @returns {LocalizedString}
*/
export const tool_arguments =
/** @type {((inputs?: Tool_ArgumentsInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Tool_ArgumentsInputs, { locale?: "en" | "zh" }, {}>} */ (
(inputs = {}, options = {}) => {
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
if (locale === 'en') return en_tool_arguments(inputs)
return zh_tool_arguments(inputs)
}
)