Skip to content

fix(i18n): localize error-component, fix bug report URL, replace console.trace in fn.ts#859

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-error-component-i18n-fn-logging
Open

fix(i18n): localize error-component, fix bug report URL, replace console.trace in fn.ts#859
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-error-component-i18n-fn-logging

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Localizes the TUI error/fatal screen component and fixes the broken bug report URL that still pointed to the original anomalyco/opencode repository. Also replaces raw console.trace/console.error in the schema validation utility with structured logging.

Changes (9 files)

packages/opencode/src/cli/cmd/tui/component/error-component.tsx:

  • Fixed issue URL: anomalyco/opencode/issues/newXiaomiMiMo/MiMo-Code/issues/new
  • Fixed title prefix: opentui: fatal:MiMo Code: fatal:
  • Renamed version param: opencode-versionmimo-code-version
  • Added useLanguage import and replaced all 6 hardcoded English strings with t() calls
  • Strings localized: "Please report an issue.", "Copy issue URL...", "Successfully copied", "A fatal error occurred!", "Reset TUI", "Exit"

packages/opencode/src/cli/cmd/tui/i18n/ (7 files):

  • Added 6 new tui.error.* keys to each of: en.ts, zh.ts, zht.ts, ja.ts, es.ts, fr.ts, ru.ts
  • Keys: tui.error.report_issue, tui.error.copy_url, tui.error.copied, tui.error.fatal, tui.error.reset, tui.error.exit

packages/opencode/src/util/fn.ts:

  • Replaced console.trace("schema validation failure stack trace:") + console.error("schema validation issues:", ...) with Log.create({ service: "fn" }).error("schema validation failure", { input, error })
  • Structured logging captures the input and error details properly in log files instead of dumping raw JSON to stderr

Closes #679 (partial — error screen branding)

…ole.trace in fn.ts

- error-component.tsx: fix issue URL from anomalyco/opencode to XiaomiMiMo/MiMo-Code
- error-component.tsx: fix title prefix from 'opentui: fatal:' to 'MiMo Code: fatal:'
- error-component.tsx: rename version param from 'opencode-version' to 'mimo-code-version'
- error-component.tsx: i18n all 6 hardcoded English strings (report_issue, copy_url, copied, fatal, reset, exit)
- Add 6 new tui.error.* keys to all 7 language files (en, zh, zht, ja, es, fr, ru)
- util/fn.ts: replace console.trace + console.error with structured Log.create({service: 'fn'}).error()
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.

Web UI still shows "opencode" branding instead of "MiMo Code"

1 participant