Skip to content

feat: bilingual (中文/English) dashboard, Chinese by default - #3

Merged
johnsonice merged 1 commit into
mainfrom
feat/dashboard-scanner-polish
Jul 1, 2026
Merged

feat: bilingual (中文/English) dashboard, Chinese by default#3
johnsonice merged 1 commit into
mainfrom
feat/dashboard-scanner-polish

Conversation

@johnsonice

Copy link
Copy Markdown
Contributor
  • Dashboard artifact gains an EN/中文 toggle, defaulting to 中文; UI chrome and the strategy/rationale prose both localize.
  • Opportunity 'thesis' and 'risks' now accept a localizedText value (a plain string or a {en, zh} object), so scan output carries both languages; build_data maps it through and the template renders the active language.
  • artifacts.md / orchestration.md / SKILL.md document producing bilingual prose; tests cover localizedText mapping.

- Dashboard artifact gains an EN/中文 toggle, defaulting to 中文; UI chrome and the
  strategy/rationale prose both localize.
- Opportunity 'thesis' and 'risks' now accept a localizedText value (a plain string
  or a {en, zh} object), so scan output carries both languages; build_data maps it
  through and the template renders the active language.
- artifacts.md / orchestration.md / SKILL.md document producing bilingual prose;
  tests cover localizedText mapping.
Copilot AI review requested due to automatic review settings July 1, 2026 01:57
@johnsonice
johnsonice merged commit 31eca2e into main Jul 1, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds bilingual (中文/English) support to the generated dashboard artifact, defaulting the UI to Chinese while allowing an instant in-dashboard toggle to English. It also extends the opportunity/run data model so thesis/risks (and other user-facing prose) can be provided as either plain strings or {en, zh} objects and rendered in the active language.

Changes:

  • Add zh/en i18n layer + language toggle to the dashboard HTML template (default zh via meta.lang / localStorage override).
  • Update assets/build_data.py to emit bilingual strategy_note / gate_note and pass through localized thesis/risks without stringifying objects.
  • Update schema + documentation and add unit tests covering localizedText mapping and meta.lang default/override.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_build_data.py Adds tests validating bilingual gate_note/strategy_note, localized thesis/risks passthrough, and meta.lang behavior.
SKILL.md Documents that the dashboard is bilingual by default and how to set run.json.lang.
reference/orchestration.md Instructs sub-agents to output bilingual thesis/risks compatible with the dashboard toggle.
reference/opportunity.schema.json Introduces localizedText (string or {en, zh}) and applies it to thesis and risks[].
reference/artifacts.md Documents bilingual rendering expectations and meta.lang in the DATA schema.
assets/dashboard-template.html Implements the zh/en toggle, UI-string i18n, and rendering of {en, zh} data values via tv().
assets/build_data.py Emits bilingual STRATEGY_NOTES / GATE_REASON_NOTES, wraps unknown gate reasons, and sets meta.lang (default zh).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

var vol=m.volume_24h?'<span>'+t("card.vol24")+' <b>$'+compact(m.volume_24h)+'</b></span>':"";
var tl=timeLeft(m), tlHTML=tl?'<span class="mtime '+tl.cls+'">'+esc(tl.txt)+'</span>':"";
var tag=m.category?'<span class="mtag">'+esc(m.category)+'</span>':"";
return '<div class="mkt" data-idx="'+idx+'" role="button" tabindex="0" aria-label="'+esc(m.question)+' — open details">'+
var flow=num(m.net_flow), flowTxt=(m.net_flow==null||m.net_flow==="")?"":'<span>'+t("card.flow")+' <b class="'+(flow>=0?"pos":"neg")+'">'+(flow>=0?"+":"−")+"$"+compact(flow)+'</b></span>';
var vol=m.volume_24h?'<span>'+t("card.vol24")+' <b>$'+compact(m.volume_24h)+'</b></span>':"";
var tl=timeLeft(m), tlHTML=tl?'<span class="mtime '+tl.cls+'">'+esc(tl.txt)+'</span>':"";
var tag=m.category?'<span class="mtag">'+esc(m.category)+'</span>':"";
'<div class="mkt-block"><div class="block-head"><span class="eyebrow">Order book</span></div>'+bookHTML(m.depth)+'</div>'+
(url?'<a class="trade" href="'+esc(url)+'" target="_blank" rel="noopener noreferrer" aria-label="Trade '+esc(m.question)+' on Polymarket">Trade on Polymarket <span class="ext" aria-hidden="true">↗</span></a>':'')+
'<div class="mkt-block"><div class="block-head"><span class="eyebrow">'+t("card.orderBook")+'</span></div>'+bookHTML(m.depth)+'</div>'+
(url?'<a class="trade" href="'+esc(url)+'" target="_blank" rel="noopener noreferrer" aria-label="'+esc(m.question)+'">'+t("card.trade")+' <span class="ext" aria-hidden="true">↗</span></a>':'')+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants