Skip to content

docs: say which languages the widget ships - #151

Open
anurag629 wants to merge 1 commit into
devfrom
docs/i18n-what-ships
Open

anurag629 wants to merge 1 commit into
devfrom
docs/i18n-what-ships

Conversation

@anurag629

Copy link
Copy Markdown
Member

What does this change?

The i18n page says the widget has 8 built-in locales. It has one: packages/widget/src/i18n.ts only registers en, and getWidgetLocale falls back to it for any other code. So data-locale="es" gives English buttons and placeholders without any warning. The 8 locale files live in @chatcops/core, and neither the widget nor the server uses them.

  • widget/i18n.mdx now says English is the only built-in language, shows how to translate the widget with strings (that option already exists, nothing new here), lists only en in the table and links Add built-in translations to the widget #55 for built-in translations.
  • Its "Server-Side i18n" section showed an i18n server option with Spanish strings. The server never reads that option. What it does is add "Respond in the user's language. Current locale: es" to the system prompt (packages/server/src/handler.ts line 115), so the section says that now. Error messages the visitor sees come from the widget's strings.
  • widget/configuration.mdx: the comment on locale listed 8 codes.
  • server/setup.mdx: the i18n line in the example now says the server doesn't read it yet.
  • README.md: the feature line said 8 built-in locales.

Whether the unused i18n server option should go away or get wired up can be its own issue.

How I tested this

  • pnpm build in website/ passes, and I read the rendered i18n page in the build output.
  • The strings example from the page type-checks against WidgetConfig.

Checklist

  • This PR targets dev
  • Changeset added: not needed, only docs and the README change

This branch has not been deployed

No deployments
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.

1 participant