Skip to content

[bug] Weather component hard-codes Chinese condition labels #2147

Open

Description

@Jarvis636431

What happened

dashboard/src/pages/Chat/Weather/index.tsx uses the selected interface language for dates, but getWeatherLabel() returns hard-coded Chinese strings for sunny, rainy and cloudy. Rendering the component with an English i18next provider still shows 晴朗 / 雨天 / 多云.

Scope: this is reproduced in an isolated preview of the actual component. I did not find a current importer or dynamic glob loading this component in dashboard/src; this report does not claim that the production chat flow currently reaches it. Please confirm whether this component should remain supported.

Expected behavior

If retained, its condition labels should follow the existing zh/en interface language and update when that language changes. Unknown condition strings should remain readable.

Steps to reproduce

  1. Render the existing Weather component in an isolated preview with an English i18next provider.
  2. Supply the component's existing double-encoded JSON fixture format with a current item such as {location: "Shanghai", weather: "sunny", temperature: 23, date: "2026-10-17"}.
  3. Observe English date text but the Chinese condition 晴朗.

Environment

  • Source: develop 0d65f2ad.
  • macOS, source checkout, Node 22.18.
  • Isolated real-component preview with fixed tool data; no live weather/LLM request.

Logs / screenshots

Before, English provider:

Before: English preview with Chinese condition

Proposed component-only fix:

After: English condition

Eight real-i18next regression tests cover all three conditions in both languages, runtime language changes and unknown conditions. Against the original component: 4 failed / 4 passed; with the fix: 8 passed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions