Skip to content

Commit f059a0d

Browse files
authored
fix(frontend): stop Alpha Zoo headline rendering the count twice (#286) (#287)
The AlphaZoo headline rendered a standalone `{total}` and then the translated `prebuiltAlpha` string, which already interpolates `{{count}}` — so the page showed the number twice (e.g. "456 456 pre-built quant alphas across 4 zoos"). It also carried a hardcoded, now-stale `452` fallback. Render only the translated string with the live (filter-aware) total, and show a count-less loading variant while alphas load. New `alphaZoo.prebuiltAlphaLoading` key added to both en and zh-CN.
1 parent eea2124 commit f059a0d

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

frontend/src/i18n/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@
350350
"alphaZoo": {
351351
"title": "Alpha Zoo",
352352
"prebuiltAlpha": "{{count}} pre-built quant alphas across 4 zoos",
353+
"prebuiltAlphaLoading": "Pre-built quant alphas across 4 zoos",
353354
"browseDesc": "Browse formula-driven cross-sectional signals from Qlib, the Kakushadze 101 set, GTJA 191, and the academic anomaly literature. Click any alpha to read its formula and source code, or run a bench to score the whole zoo on a universe and period.",
354355
"search": "Search",
355356
"searchPlaceholder": "Filter by id or nickname…",

frontend/src/i18n/locales/zh-CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@
350350
"alphaZoo": {
351351
"title": "Alpha 动物园",
352352
"prebuiltAlpha": "{{count}} 个预构建量化 Alpha,覆盖 4 个动物园",
353+
"prebuiltAlphaLoading": "预构建量化 Alpha,覆盖 4 个动物园",
353354
"browseDesc": "浏览来自 Qlib、Kakushadze 101 公式集、GTJA 191 以及学术异象文献的公式驱动截面信号。点击任意 Alpha 查看公式和源码,或运行基准测试在特定市场和时间段上评分整个动物园。",
354355
"search": "搜索",
355356
"searchPlaceholder": "按 ID 或昵称筛选…",

frontend/src/pages/AlphaZoo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ function BrowseView() {
215215
<Layers className="h-3.5 w-3.5" aria-hidden="true" /> Alpha Zoo
216216
</div>
217217
<h1 className="text-2xl md:text-3xl font-bold tracking-tight">
218-
{total > 0 ? total : 452} {i18n.t("alphaZoo.prebuiltAlpha", { count: total > 0 ? total : 452 })}
218+
{loading
219+
? i18n.t("alphaZoo.prebuiltAlphaLoading")
220+
: i18n.t("alphaZoo.prebuiltAlpha", { count: total })}
219221
</h1>
220222
<p className="text-sm text-muted-foreground max-w-2xl">
221223
Browse formula-driven cross-sectional signals from Qlib, the

0 commit comments

Comments
 (0)