Commit 2f1fb09
fix(notifications): user notifications page rendered raw i18n keys + wrong type field (#308)
Found while QA-testing the community & notifications area (#291).
The student/shared notifications page (`/dashboard/notifications`) was
fully broken visually:
1. The entire `dashboard.student.notifications` i18n namespace was missing
from en.json and es.json. Every label rendered as its raw key path —
"dashboard.student.notifications.title",
"dashboard.student.notifications.tabs.all", ".empty.none", etc. Added the
complete namespace in both locales (title, description, tabs, empty,
actions, toasts, priority, types).
2. `NotificationsClient` read `notification.notification.type`, but the
joined `notifications` row exposes `notification_type` (there is no
`type` column). The type badge therefore resolved to `undefined` and
showed a raw `types.undefined` key. Switched to `notification_type` and
guarded the lookup with `t.has()` so an unmapped type falls back to the
raw value instead of leaking the key path.
Verified end-to-end as Alice Student (4 certificate notifications):
- en + es chrome fully translated (title/description/tabs/empty)
- priority badge → "High"/"Alta", type badge → "Certificate"/"Certificado"
- "Mark all as read" flips Unread 4→0 / Read 0→4 with the localized toast
- admin (no notifications) shows the proper empty state
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 862d2ec commit 2f1fb09
4 files changed
Lines changed: 95 additions & 3 deletions
File tree
- components
- docs/screenshots
- messages
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
212 | 214 | | |
213 | 215 | | |
214 | 216 | | |
| |||
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
157 | 202 | | |
158 | 203 | | |
159 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
157 | 202 | | |
158 | 203 | | |
159 | 204 | | |
| |||
0 commit comments