feat: localize default strategy names by UI language at registration

- Pass `lang` from register request body to createDefaultStrategies
- Support zh/en/id locales for strategy names and descriptions
- Wrap strategy creation in a transaction to prevent partial writes
- Frontend sends current UI language in register request body
- Strategy list UI: 2-line clamp, unselected border, larger spacing, smaller font for non-zh
This commit is contained in:
Dean
2026-03-27 21:11:12 +08:00
committed by shinchan-zhai
parent eae05c5715
commit b9f6a32ad6
3 changed files with 73 additions and 21 deletions

View File

@@ -706,7 +706,7 @@ export function StrategyStudioPage() {
</button>
</div>
</div>
<div className="space-y-1">
<div className="space-y-2">
{strategies.map((strategy) => (
<div
key={strategy.id}
@@ -719,11 +719,11 @@ export function StrategyStudioPage() {
}}
className={`group px-2 py-2 rounded-lg cursor-pointer transition-all ${selectedStrategy?.id === strategy.id
? 'ring-1 ring-nofx-gold/50 bg-nofx-gold/10 shadow-[0_0_15px_rgba(240,185,11,0.1)]'
: 'hover:bg-nofx-bg-lighter/60 hover:ring-1 hover:ring-nofx-gold/20 bg-transparent'
: 'hover:bg-nofx-bg-lighter/60 ring-1 ring-white/10 hover:ring-nofx-gold/20 bg-transparent'
}`}
>
<div className="flex items-center justify-between">
<span className="text-sm truncate text-nofx-text">{strategy.name}</span>
<div className="flex items-start justify-between">
<span className={`line-clamp-2 text-nofx-text ${language === 'zh' ? 'text-sm' : 'text-xs'}`}>{strategy.name}</span>
<div className="flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity">
<button
onClick={(e) => { e.stopPropagation(); handleExportStrategy(strategy) }}