Skip to content

Deprecate the server's i18n option, which nothing reads #154

Closed

Description

@anurag629

ChatCopsServerConfig has an i18n option (packages/server/src/config.ts, line 15), and the setup docs show it in their example, but nothing in packages/server/src reads config.i18n. Passing it changes nothing. The widget's own text comes from its strings option, and the only language handling on the server is the "Respond in the user's language" line it adds to the system prompt when a request has a locale (packages/server/src/handler.ts, lines 114 to 117).

Removing the option outright would break the build for TypeScript users who pass it, so let's deprecate it first and remove it in a later minor release.

What to do

  • Mark i18n in ChatCopsServerConfig as deprecated with a JSDoc @deprecated tag that says the server ignores it and points to the widget's strings option.
  • In createChatHandler (packages/server/src/handler.ts, line 13), log one console.warn when config.i18n is set: once per handler, not on every request.
  • Docs: take the i18n block out of the example in website/src/content/docs/server/setup.mdx (lines 68 to 72) and mark it deprecated in the interface further down (line 96). In website/src/content/docs/widget/i18n.mdx, say it's deprecated where the page mentions it. docs: say which languages the widget ships #151 rewrites that page, so start from that version once it's merged.

Acceptance criteria

  • i18n has a @deprecated JSDoc note, and the type still accepts it
  • One warning when i18n is set and none when it isn't, with tests in packages/server/tests/handler.test.ts
  • The setup docs no longer suggest using it
  • Changeset for @chatcops/server (patch)
  • pnpm -r build, pnpm -r typecheck and pnpm test pass

Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #154. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.

Activity

  1. prakashNalla commented on Oct 18, 2026

    @prakashNalla
    Contributor

    I'd like to take this one. I'll add a @deprecated note to i18n that points to the widget's strings, warn once in createChatHandler when it's set (with tests for both cases), drop it from the setup example and mark it in the interface docs, and add a patch changeset for the server. For widget/i18n.mdx I'll build on #151 once it's merged.

  2. anurag629 commented on Oct 19, 2026

    @anurag629
    MemberAuthor

    Hey @prakashNalla, it's yours, next to discord-bot #37. That plan covers it, and #151 is merged now, so widget/i18n.mdx on dev already has the new text to build on.

    Let me know if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueGood for newcomershacktoberfestGood pick for Hacktoberfest contributorsserverAffects @chatcops/server package

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions