Skip to content

Fix broadcast: use global i18n in wizard scenes#18

Merged
ashugaev merged 1 commit into
masterfrom
goose-b2ee
May 18, 2026
Merged

Fix broadcast: use global i18n in wizard scenes#18
ashugaev merged 1 commit into
masterfrom
goose-b2ee

Conversation

@AlekShu
Copy link
Copy Markdown
Collaborator

@AlekShu AlekShu commented May 18, 2026

Summary

  • Fix ctx.i18n being undefined in wizard steps 2+ (causes "Unknown error" on /broadcast)
  • setupI18N runs after stage.middleware() in the chain, so wizard steps never get ctx.i18n
  • Use global i18n.t(lang, key) singleton instead, matching the pattern in sceneWrapper

Root cause

Scene fail: broadcastCaptureMessage TypeError: Cannot read properties of undefined (reading 't')
    at broadcast.scenes.js:36:42

ctx.i18n is undefined in wizard steps 2+ because setupI18N middleware
runs after stage.middleware() in the chain. Wizard steps fire inside
stage.middleware(), so i18n middleware never executes for them.

Use the global i18n singleton with explicit language from ctx.dbuser,
matching the pattern used by sceneWrapper's own error handler.
@ashugaev ashugaev merged commit 695e04d into master May 18, 2026
3 checks passed
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