Page MenuHomePhabricator

ReadingLists error messages in notifications not translated
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • e.g. let the user session timeout on web/desktop and try to add something to the reading list with the reading list icon. There is a error notification message "An error has occurred: notloggedin"

Screenshot 2025-08-11 at 11.33.05 AM.png (2,698×850 px, 216 KB)

What should have happened instead?:

This should be a human-readable message that is translated to the user's language.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

QA steps

  • Log in
  • Open two tabs
  • In tab 1 log out
  • In tab 2 click the bookmark icon

Expected: the error message should be localized.

Requirement

Scope: Desktop web (Vector 2022) and mobile web (Minerva).

  • Reading List error notifications must display human-readable, localized messages.
  • Raw backend error codes (e.g., “notloggedin”) must be mapped to translatable user-facing strings.
  • Translations must follow MediaWiki i18n conventions and display correctly for the user’s interface language.
  • Notification system must still function normally for all other error types.

BDD

Feature: Localized error messages in Reading List notifications

  Scenario: Session timeout error
    Given I have a logged-out session while viewing a page with the Reading List icon
    When I click the bookmark icon to save the article
    Then a localized, human-readable error message is shown
    And no raw backend error code is displayed

Test Steps

Test Case 1: Session timeout error message localization

  1. Log in and open two tabs of the same wiki page.
  2. In Tab 1, log out.
  3. In Tab 2, click the Reading List (bookmark) icon.
  4. AC1: A notification appears with a localized, human-readable error message.
  5. AC2: The raw error code “notloggedin” does not appear.

QA Results - Beta

ACStatusDetails
1T401607#11244499
2T401607#11244499

QA Results - Prod

ACStatusDetails
1T401607#11244501
2T401607#11244501

Details

Event Timeline

We should address this after the messaging has been finalized in T402172

The translation for notloggedin exists but is being passed in raw in here
https://github.com/wikimedia/mediawiki-extensions-ReadingLists/blob/master/resources/ext.readingLists.bookmark/bookmark.js#L138

Current:

mw.notify(
						mw.msg( 'readinglists-browser-error-intro', err ),
						{ tag: 'saved', type: 'error' }
					);

Expected:

mw.notify(
						mw.msg( 'readinglists-browser-error-intro', mw.msg( err ) ),
						{ tag: 'saved', type: 'error' }
					);

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly point to the codebase URL and provide clear steps to help a contributor get set up for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

LazyShrey subscribed.

I'm going to contribute to this task, please review my commit soon.

Change #1183226 had a related patch set uploaded (by Jdlrobson; author: LazyShrey):

[mediawiki/extensions/ReadingLists@master] ReadingLists: localize browser error message

https://gerrit.wikimedia.org/r/1183226

Jdlrobson-WMF set the point value for this task to 2.Sep 3 2025, 5:12 PM

Change #1183226 had a related patch set uploaded (by LazyShrey; author: LazyShrey):

[mediawiki/extensions/ReadingLists@master] Localize browser error message

https://gerrit.wikimedia.org/r/1183226

Change #1183226 merged by jenkins-bot:

[mediawiki/extensions/ReadingLists@master] Localize browser error message

https://gerrit.wikimedia.org/r/1183226

@Sneha The following messages are used here:

* readinglists-browser-error-intro
* readinglists-db-error-list-entry-deleted

From i18n/qqq.json

"readinglists-browser-error-intro": "Message indicating that an error has occurred\n\nParameters:\n* $1 - The error message from the server.",
"readinglists-db-error-list-entry-deleted": "Error message used when trying to do something with a list entry that has been deleted.",

From i18n/en.json

"readinglists-browser-error-intro": "An error has occurred: $1",
"readinglists-db-error-list-entry-deleted": "List entry $1 has been deleted.",

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Session timeout error message localization

  1. Log in and open two tabs of the same wiki page.
  2. In Tab 1, log out.
  3. In Tab 2, click the Reading List (bookmark) icon.
  4. AC1: A notification appears with a localized, human-readable error message.
  5. AC2: The raw error code “notloggedin” does not appear.

screenshot 104.mov.gif (1,638×686 px, 1 MB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Session timeout error message localization

  1. Log in and open two tabs of the same wiki page.
  2. In Tab 1, log out.
  3. In Tab 2, click the Reading List (bookmark) icon.
  4. AC1: A notification appears with a localized, human-readable error message.
  5. AC2: The raw error code “notloggedin” does not appear.

screenshot 103.mov.gif (1,638×686 px, 1 MB)

screenshot 102.mov.gif (1,638×686 px, 1 MB)

This seems pretty clear cut so I added the verified tag. If it doesn't get resolved please remove the verified tag.

Jdrewniak claimed this task.

LGTM