Skip to content

[codex] Add dashboard language packs and Korean localization#32

Closed
jhste102lab wants to merge 1 commit into
alexgreensh:mainfrom
jhste102lab:codex/dashboard-language-packs
Closed

[codex] Add dashboard language packs and Korean localization#32
jhste102lab wants to merge 1 commit into
alexgreensh:mainfrom
jhste102lab:codex/dashboard-language-packs

Conversation

@jhste102lab
Copy link
Copy Markdown

Summary

Adds a language-pack based localization layer to the Token Optimizer dashboard and ships an initial Korean translation pass.

This PR keeps translations out of the dashboard render logic by injecting a versioned language-pack asset at dashboard generation time. Users can switch between English and Korean from the dashboard footer using the new ENG / KOR control.

Closes #31.

What Changed

  • Added skills/token-optimizer/assets/language-packs.json with English fallback metadata and Korean phrase mappings.
  • Added dashboard runtime i18n support that:
    • persists the selected language in localStorage
    • applies translations without a full page reload
    • re-applies localization after initial render, tab switches, right-panel updates, and async per-turn detail loads
    • translates text nodes plus title, placeholder, and aria-label attributes
  • Added an ENG / KOR selector above the existing Built by Alex Greenshpun footer area.
  • Updated dashboard generation in measure.py to inject both dashboard data and language packs.
  • Adjusted a couple of hook help strings so sentence-level translation is not broken by inline markup.

Why

Korean-speaking users currently see a mixed-language dashboard. Some management sections can be partially localized, but core areas such as Overview, Quick Wins, Health, Coach, Hooks, Selection Summary, and generated recommendation text remain mostly English.

Hardcoding Korean strings into render functions would make future translation updates harder. A language-pack asset lets maintainers update translations through normal git review and makes it possible to add more languages later.

Implementation Notes

  • English remains the default fallback.
  • The runtime translator converts already-translated text back through the language pack before applying a new language, so users can switch between ENG and KOR without reloading.
  • The translator skips unsafe areas such as scripts, styles, code blocks, textareas, update commands, SVGs, and prompt modal content to avoid corrupting commands, code samples, model IDs, file paths, and generated prompts.
  • The initial Korean pack focuses on dashboard-owned UI and generated copy. Arbitrary third-party skill descriptions may still appear in their source language unless those upstream metadata strings get their own translation source.

Validation

  • python3 -m json.tool skills/token-optimizer/assets/language-packs.json
  • python3 -m py_compile skills/token-optimizer/scripts/measure.py
  • Generated a standalone Codex dashboard with TOKEN_OPTIMIZER_RUNTIME=codex.
  • Manually verified the KOR toggle in the generated dashboard across Overview, Quick Wins, Habits, Coach, Hooks, Manage, and Trends.

Screens / Manual QA Notes

Verified that Korean localization covers major generated sections including:

  • Overview summary and component cards
  • Active Compression / Codex optimization cards
  • Quick Wins and recommendation detail text
  • Habits guidance
  • Coach issue/fix/savings cards
  • Hook profiles and installed hook descriptions
  • Trends labels and cache/model summaries

Commands and code-like content remain readable and are intentionally not translated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 3, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@jhste102lab
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request May 3, 2026
@jhste102lab jhste102lab closed this by deleting the head repository May 11, 2026
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.

Add dashboard language packs and Korean localization toggle

1 participant