-
Notifications
You must be signed in to change notification settings - Fork 273
feat: configprovider #3180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat_v3.x
Are you sure you want to change the base?
feat: configprovider #3180
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ | |
const classPrefix = 'nut-audio' | ||
const handleEnded = (e: SyntheticEvent<HTMLAudioElement>) => { | ||
if (loop) { | ||
console.warn(locale.audio.tips || 'onPlayEnd事件在loop=false时才会触发') | ||
console.warn(locale.audio?.tips || 'onPlayEnd事件在loop=false时才会触发') | ||
} else { | ||
onEnd?.(e) | ||
} | ||
|
@@ -183,7 +183,7 @@ | |
className="back" | ||
onClick={handleBack} | ||
> | ||
{locale.audio.back || '快退'} | ||
{locale.audio?.back || '快退'} | ||
</Button> | ||
Comment on lines
+186
to
187
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain统一使用可选链操作符增强国际化处理的健壮性 在按钮文本中使用可选链操作符访问 locale.audio 的各个属性,并提供默认文本,使组件在国际化配置不完整时依然能正常显示。 建议为音频组件添加更完善的单元测试,确保在各种国际化配置场景下能正确显示按钮文本。 Also applies to: 195-197, 199-200, 208-209 🏁 Script executed: #!/bin/bash
# 检查音频组件的测试覆盖情况
# 查找音频组件测试文件
echo "音频组件测试文件:"
fd -t f "audio.*test" .
# 查找测试中是否包含国际化测试
echo "查找国际化相关测试:"
fd -t f "audio.*test" . --exec grep -l "locale\|i18n\|国际化" {} \; Length of output: 344 请补充涵盖国际化场景的单元测试 目前代码中对国际化文本的处理已正确使用可选链操作符及默认文本(适用于文件
|
||
<Button | ||
type="primary" | ||
|
@@ -192,11 +192,11 @@ | |
onClick={handleStatusChange} | ||
> | ||
{playing | ||
? `${locale.audio.pause || '暂停'}` | ||
: `${locale.audio.start || '开始'}`} | ||
? `${locale.audio?.pause || '暂停'}` | ||
: `${locale.audio?.start || '开始'}`} | ||
</Button> | ||
<Button type="primary" size="small" onClick={handleForward}> | ||
{locale.audio.forward || '快进'} | ||
{locale.audio?.forward || '快进'} | ||
</Button> | ||
<Button | ||
type={ | ||
|
@@ -205,7 +205,7 @@ | |
size="small" | ||
onClick={handleMute} | ||
> | ||
{locale.audio.mute || '静音'} | ||
{locale.audio?.mute || '静音'} | ||
</Button> | ||
</div> | ||
</> | ||
|
Uh oh!
There was an error while loading. Please reload this page.