Ws 2759: Expand on sport translations#14090
Open
Isabella-Mitchell wants to merge 29 commits into
Open
Conversation
…sport-translation-extend-2
Base automatically changed from
WS-2706-world-cup-team-name-translations
to
latest
June 3, 2026 13:00
| } | ||
|
|
||
| const homeTeamTranslation = fetchTeamNameTranslation( | ||
| const homeTeamTranslation = translateTeamName( |
Contributor
Author
There was a problem hiding this comment.
Not fetching homeTeamTranslation and awayTeamTranslation inside of transformTeam function to save passing in Translations - but I'm not actually sure if this is better/ worse for performance?
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends Sport Data Header (HeadToHead v2) localisation by adding new sport translation keys per service, translating period labels/grouped action labels, and translating minute/score numerals for non‑Western numeral services. It also refactors “Most Read” numeral selection into a shared utility and updates downstream imports (including Cypress).
Changes:
- Add new
translations.sportkeys (assists/penalties/HT/FT/ET/AET, venue/attendance, win-on-penalties phrasing) and populate them for multiple services. - Enhance HeadToHead v2 data transformation to apply label translations and numeral translations (scores, running scores, action minute labels), and surface translated values via new
translation/translatedfields in types. - Extract
serviceNumeralsintogetServiceNumeralsutility and update Most Read + Cypress usage.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| ws-nextjs-app/cypress/e2e/pageTypes/mostReadPage/mostReadAssertions.ts | Updates numeral utility import for Cypress assertions. |
| ws-nextjs-app/cypress/e2e/assertions/crossPlatformAssertion.ts | Updates numeral utility import for cross-platform Cypress checks. |
| src/app/models/types/translations.ts | Adds new sport translation keys and win-on-penalties shape. |
| src/app/lib/config/services/turkce.ts | Adds sport translations for Turkish. |
| src/app/lib/config/services/swahili.ts | Adds sport translations for Swahili. |
| src/app/lib/config/services/portuguese.ts | Adds sport translations for Portuguese. |
| src/app/lib/config/services/persian.ts | Adds sport translations for Persian. |
| src/app/lib/config/services/mundo.ts | Adds sport translations for Mundo (Spanish). |
| src/app/lib/config/services/hausa.ts | Adds sport translations for Hausa. |
| src/app/lib/config/services/arabic.ts | Adds sport translations for Arabic. |
| src/app/lib/config/services/afrique.ts | Adds sport translations for Afrique (French). |
| src/app/components/MostRead/utilities/getServiceNumerals.ts | Introduces shared numeral lookup utility. |
| src/app/components/MostRead/Canonical/Rank/index.tsx | Uses the shared numeral utility instead of inline logic. |
| src/app/components/MostRead/Amp/getRemoteDataScript/index.ts | Uses the shared numeral utility in AMP remote-data script. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/types.ts | Extends types to carry translated labels (translation, translated). |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/transformers/translateSportData.tsx | Implements sport label + numeral translations for H2H v2 data. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/transformers/translateSportData.test.tsx | Expands transformer unit tests for new translation behaviours. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/helpers/event-summary.ts | Updates fallback period label helper to accept translations. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/head-to-head-v2.tsx | Passes service into the translation transformer. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/components/score-details.tsx | Applies translated HT/FT labels in score details (incl. visually hidden text). |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/components/period.tsx | Displays translated period label when available. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/components/penalty-scores.tsx | Localises the win-on-penalties sentence using new translations. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/components/match-progress.tsx | Updates fallback period label invocation to new signature. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/components/actions.tsx | Passes sport translations down to score details. |
| src/app/components-webcore/SportDataHeader/head-to-head-v2/components/actions-time.tsx | Uses translated minute labels + translated penalty abbreviation for “pen” markers. |
Comment on lines
+83
to
94
| const aetTranslatedFallback = aetTranslation | ||
| ? { | ||
| value: aetTranslation, | ||
| accessible: aetTranslation, | ||
| } | ||
| : aetFallback; | ||
| const ftTranslatedFallback = ftTranslation | ||
| ? { | ||
| value: ftTranslation, | ||
| accessible: ftTranslation, | ||
| } | ||
| : ftFallback; |
shayneahchoon
approved these changes
Jun 5, 2026
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.
Resolves JIRA: https://bbc.atlassian.net/browse/WS-2759
Summary
Translates the following info in the sports data header:
Some translations are out of scope, these include (but are not limited to)
Note, since this was a lift and shift, RTL is not fully supported by the component
(Country team names translated in previous PR)
Code changes
*Note, in deeply nested objects I have added a 'translated' key/ value pair rather than overwriting the value. This is because I saw at least one instance where the value was used in another context. So it seemed safer to add a new pair than override an existing pair.
Testing
http://localhost:7081/afrique/live/c7gk1vjglxn1t
http://localhost:7081/afrique/live/c7gk1vjglxn1t?renderer_env=live
http://localhost:7081/arabic/live/ckq1ll8qlmdmt?renderer_env=test
Useful Links