issue-1386: Improved unit translation support for next hour forecast#1387
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses #1386 by ensuring unit abbreviations are translated via the unitAbbreviations i18n namespace (instead of being rendered as raw unit strings) in next-hour and vertical forecast UI components.
Changes:
- Updated multiple forecast components to render units using
t(\unitAbbreviations:${unitAbb}`)` (temperature, wind, precipitation). - Aligned unit rendering across next-hour forecast panels/bars and the vertical 10-day forecast precipitation row.
- Updated i18n mocks in relevant unit tests so
unitAbbreviations:*resolves to the unit key (e.g.,C) for assertions.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/components/weather/NextHourForecastPanelWithWeatherBackground.tsx |
Translate displayed temperature unit abbreviation via unitAbbreviations namespace. |
src/components/weather/forecast/Vertical10DaysForecast.tsx |
Translate displayed precipitation unit abbreviation in the vertical 10-day list row. |
src/components/weather/forecast/NextHourForecastBar.tsx |
Translate displayed wind/precipitation/temperature unit abbreviations in the next-hour bar. |
src/components/weather/forecast/HourForecast.tsx |
Translate displayed temperature unit abbreviation in the hourly forecast item. |
__tests__/components/NextHourForecastPanelWithWeatherBackground.test.tsx |
Adjust t mock to return unit abbreviations for unitAbbreviations:* keys. |
__tests__/components/HourForecast.test.tsx |
Adjust t mock to return unit abbreviations for unitAbbreviations:* keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1386