Skip to content

fix(notifications): translate notification titles via i18n - #3421

Open
Surfoo wants to merge 1 commit into
seerr-team:developfrom
Surfoo:fix-translated-notif-title
Open

fix(notifications): translate notification titles via i18n#3421
Surfoo wants to merge 1 commit into
seerr-team:developfrom
Surfoo:fix-translated-notif-title

Conversation

@Surfoo

@Surfoo Surfoo commented Aug 21, 2026

Copy link
Copy Markdown

Description

Hello there,

The event field used to build notification titles was built from hardcoded English strings in MediaRequest.sendNotification, bypassing i18n entirely - unlike the rest of the notification body, which already goes through intl.formatMessage.

Fix :
Add generic notifications.event.* keys to en.json, reusable by all notification apps, and build event via intl.formatMessage. Each message uses an ICU select` on the media type (movie/series) so every locale can phrase its own full sentence with correct grammar and capitalization, instead of the code splicing a translated word into a fixed English sentence shape.

AI Disclosure: I used Claude for advices about the fix and the description of this pull request.

How Has This Been Tested?

Ran pnpm build, and a dev instance with my telegram bot (see screenshots below)

nvm use 22.19.0 && pnpm build                                                                                                                                       [0:24:05]
Now using node v22.19.0 (npm v10.9.3)

> seerr@0.1.0 build /mnt/westernd/github/seerr
> pnpm build:next && pnpm build:server


> seerr@0.1.0 build:next /mnt/westernd/github/seerr
> next build

▲ Next.js 16.2.6 (Turbopack)
- Experiments (use with caution):
  · largePageDataBytes: 512000
  ✓ scrollRestoration

✓ Finished TypeScript in 3.4s    
  Creating an optimized production build ...
✓ Compiled successfully in 7.3s
✓ Collecting page data using 11 workers in 6.8s    
Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps`
Read more: https://nextjs.org/docs/messages/opt-out-auto-static-optimization

✓ Finalizing page optimization in 4ms

Screenshots / Logs (if applicable)

Real example of the notification before the fix, a mix of English and French:

before

After the fix:
English:
after (english)
French:
after (french)

(french strings are not commited, I'll use weblate)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract

Copilot AI lite review requested due to automatic review settings August 21, 2026 23:48
@Surfoo
Surfoo requested a review from a team as a code owner August 21, 2026 23:48
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bb3cd632-8cfd-4440-929f-6d923b560b57

📥 Commits

Reviewing files that changed from the base of the PR and between 059008c and 9f9c017.

📒 Files selected for processing (2)
  • server/entity/MediaRequest.ts
  • server/i18n/locale/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Media request notifications now use localized message definitions. Notification text varies by notification state, media type, and 4K status. Existing recipients, subjects, routing, and error handling remain unchanged.

Changes

Localized notification messages

Layer / File(s) Summary
Notification message definitions
server/entity/MediaRequest.ts, server/i18n/locale/en.json
Added message descriptors and English ICU localization keys for notification states, movie or series media, generic media, and 4K variants.
Notification formatting integration
server/entity/MediaRequest.ts
Replaced hard-coded notification text with getIntl().formatMessage calls selected by notification type, media type, and 4K status. Recipient flags remain unchanged.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Merge Risk: ⚪ Minimal · up to 9f9c0

This localized change translates notification titles through i18n without any actionable merge-blocking risk remaining after normal checks and review.

Suggested reviewers: fallenbagel, 0xsysr3ll

Poem

A rabbit hops through messages bright,
With movie words and 4K light.
Series and pending, approved too,
Localized notes for every queue.
Thump, thump—the titles now speak true!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: notification titles now use i18n translation keys.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes notification title localization by moving MediaRequest notification “event” titles from hardcoded English strings to i18n-backed ICU messages, aligning title translation behavior with the rest of the notification content.

Changes:

  • Added reusable notifications.event.* ICU message keys to server/i18n/locale/en.json.
  • Updated MediaRequest.sendNotification to build the notification event title via intl.formatMessage(...) using the new message descriptors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
server/i18n/locale/en.json Adds new notifications.event.* translation keys using ICU select on media type.
server/entity/MediaRequest.ts Replaces hardcoded English notification title composition with i18n message formatting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +802 to 805
const intl = getIntl();
const mediaType = entity.type === MediaType.MOVIE ? 'movie' : 'series';
const is4k = entity.is4k;
let event: string | undefined;
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.

2 participants