fix: localize simulation description and display A-Copilot in v1.2.18
This commit is contained in:
@@ -92,6 +92,15 @@ function renderResponse(message, now, reducedMotion = false, extra = {}) {
|
||||
return renderToStaticMarkup(ProgressiveChatResponse({ message, dark: true, children: React.createElement('button', null, '승인'), ...extra }))
|
||||
}
|
||||
|
||||
test('managed agent responses display A-Copilot without an internal provider ID or duplicate model name', () => {
|
||||
const html = renderResponse({ content: '분석 결과', provider: 'A_COPILOT', model: 'A-Copilot' }, 0)
|
||||
assert.ok(html.includes('A-Copilot'))
|
||||
assert.ok(!html.includes('A_COPILOT'))
|
||||
assert.ok(!html.includes('A-Copilot · A-Copilot'))
|
||||
assert.equal((html.match(/>A-Copilot<\/p>/g) ?? []).length, 1)
|
||||
assert.ok(renderResponse({ content: '결과', provider: 'QWEN', model: 'qwen3.8-max' }, 0).includes('QWEN · qwen3.8-max'))
|
||||
})
|
||||
|
||||
test('approval controls wait for the explanation; restored history does not replay', () => {
|
||||
const message = { role: 'assistant', revealStartedAt: 1000, plan: { summary: '조향 설명', explanation: content }, provider: 'QWEN', model: 'test' }
|
||||
const first = renderResponse(message, 1000)
|
||||
|
||||
@@ -9,6 +9,39 @@ const { createInstance } = require('i18next')
|
||||
const root = path.resolve(__dirname, '../src/renderer/src')
|
||||
const dictionary = JSON.parse(fs.readFileSync(path.join(root, 'i18n/en.json'), 'utf8'))
|
||||
|
||||
test('only the default simulation description follows language; vehicle and custom text stay unchanged', () => {
|
||||
const { api } = setup('ko')
|
||||
const exports = {}
|
||||
const source = fs.readFileSync(path.join(root, 'features/platforms/PlatformCards.tsx'), 'utf8')
|
||||
const code = ts.transpileModule(source, { compilerOptions: {
|
||||
module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022,
|
||||
jsx: ts.JsxEmit.ReactJSX, esModuleInterop: true
|
||||
} }).outputText
|
||||
vm.runInNewContext(code, { exports, require: name => name === '../../i18n'
|
||||
? { ...api, useLocaleRender() {} } : require(name) })
|
||||
const { createElement } = require('react')
|
||||
const { renderToStaticMarkup } = require('react-dom/server')
|
||||
const description = '내 PC에서 직접 개발 환경을 실행합니다.'
|
||||
const platform = { id: 'local', platformKey: 'futuredrive-local-pc', title: '로컬 PC', description, state: 'ready' }
|
||||
const render = value => renderToStaticMarkup(createElement(exports.PlatformOptionCard, {
|
||||
platform: value, Icon: () => null, dotClassName: '', unavailable: false,
|
||||
statusPending: false, displayStatus: '사용 가능', primaryAction: '연결',
|
||||
actionDisabled: false, running: false, onAction() {}, onSettings() {}
|
||||
}))
|
||||
assert.ok(render(platform).includes(description))
|
||||
api.setLanguage('en')
|
||||
assert.ok(render(platform).includes('Run the development environment directly on this PC.'))
|
||||
assert.ok(!render(platform).includes(description))
|
||||
const vehicleDescription = '기초 SLAM 및 자율주행 실습 장비입니다.'
|
||||
assert.ok(render({ ...platform, platformKey: 'mk-mini', description: vehicleDescription }).includes(vehicleDescription))
|
||||
assert.ok(render({ ...platform, platformKey: 'mk-mini' }).includes(description))
|
||||
assert.ok(render({ ...platform, description: '강사가 작성한 시뮬레이션 안내' }).includes('강사가 작성한 시뮬레이션 안내'))
|
||||
assert.ok(render({ ...platform, description: '설정' }).includes('>설정</p>'))
|
||||
api.setLanguage('ko')
|
||||
assert.ok(render(platform).includes(description))
|
||||
assert.equal(platform.description, description)
|
||||
})
|
||||
|
||||
test('close studio modal translates the built-in Local PC title but preserves vehicle names', () => {
|
||||
const source = fs.readFileSync(path.join(root, 'App.tsx'), 'utf8')
|
||||
const expression = source.match(/platformTitle=\{(runningPlatformCloseTarget\.platformKey[^\n]+)\}/)?.[1]
|
||||
|
||||
Reference in New Issue
Block a user