fix: translate voice design category labels (Gender, Age, Pitch, etc.)

This commit is contained in:
SummerSec
2026-05-17 01:42:42 +08:00
parent ec6d0168e1
commit f678e33789
3 changed files with 66 additions and 14 deletions
+22 -1
View File
@@ -81,7 +81,28 @@
"tshift": "t_shift",
"pos_temp": "Pos Temp",
"class_temp": "Class Temp",
"layer_pen": "Layer Pen"
"layer_pen": "Layer Pen",
"auto_kicker": "· auto",
"cat_Gender": "Gender",
"cat_Age": "Age",
"cat_Pitch": "Pitch",
"cat_Style": "Style",
"cat_EnglishAccent": "English Accent",
"cat_ChineseDialect": "Chinese Dialect",
"opt_Auto": "✨ Auto",
"opt_male": "male",
"opt_female": "female",
"opt_child": "child",
"opt_teenager": "teenager",
"opt_young_adult": "young adult",
"opt_middle_aged": "middle-aged",
"opt_elderly": "elderly",
"opt_very_low_pitch": "very low pitch",
"opt_low_pitch": "low pitch",
"opt_moderate_pitch": "moderate pitch",
"opt_high_pitch": "high pitch",
"opt_very_high_pitch": "very high pitch",
"opt_whisper": "whisper"
},
"settings": {
"title": "Settings",
+22 -1
View File
@@ -81,7 +81,28 @@
"tshift": "t_shift",
"pos_temp": "位置温度",
"class_temp": "分类温度",
"layer_pen": "层惩罚"
"layer_pen": "层惩罚",
"auto_kicker": "· 自动",
"cat_Gender": "性别",
"cat_Age": "年龄",
"cat_Pitch": "音高",
"cat_Style": "风格",
"cat_EnglishAccent": "英语口音",
"cat_ChineseDialect": "中文方言",
"opt_Auto": "✨ 自动",
"opt_male": "男声",
"opt_female": "女声",
"opt_child": "儿童",
"opt_teenager": "青少年",
"opt_young_adult": "青年",
"opt_middle_aged": "中年",
"opt_elderly": "老年",
"opt_very_low_pitch": "极低音",
"opt_low_pitch": "低音",
"opt_moderate_pitch": "中音",
"opt_high_pitch": "高音",
"opt_very_high_pitch": "极高音",
"opt_whisper": "低语"
},
"settings": {
"title": "设置",
+15 -5
View File
@@ -285,12 +285,17 @@ export default function CloneDesignTab(props) {
<div className="clone-sliders-col">
{Object.entries(CATEGORIES).map(([key, options]) => {
const many = options.length > 6;
const optLabel = (val) => {
const tKey = `clone.opt_${val.replace(/[ -]/g, '_')}`;
const tl = t(tKey);
return tl !== tKey ? tl : val;
};
return (
<div key={key}>
<div className="label-row label-row--sm">
{key.replace(/([A-Z])/g, ' $1').trim()}
{t(`clone.cat_${key}`)}
<span className="clone-slider-kicker">
{vdStates[key] === 'Auto' ? '· auto' : `· ${vdStates[key]}`}
{vdStates[key] === 'Auto' ? t('clone.auto_kicker') : `· ${optLabel(vdStates[key])}`}
</span>
</div>
{many ? (
@@ -303,16 +308,21 @@ export default function CloneDesignTab(props) {
</select>
) : (
<div className="chip-group">
{options.map(opt => (
{options.map(opt => {
const optTKey = `clone.opt_${opt.replace(/[ -]/g, '_')}`;
const optTl = t(optTKey);
const optLabel = optTl !== optTKey ? optTl : opt;
return (
<button
key={opt}
type="button"
className={`chip ${vdStates[key] === opt ? 'active' : ''}`}
onClick={() => setVdStates({ ...vdStates, [key]: opt })}
>
{opt === 'Auto' ? '✨ Auto' : opt}
{opt === 'Auto' ? t('clone.opt_Auto') : optLabel}
</button>
))}
);
})}
</div>
)}
</div>