Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
P2
-
Resolution: Won't Do
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:
-
Template:
-
Sprint:Prokopovych - Sprint 115
-
Development Team:Vega
-
Affected Institution:GBV
-
Epic Link:
Description
Overview:
To have back-end messages been translated we need
- entries in a translation file, for example https://github.com/folio-org/ui-requests/blob/master/translations/ui-requests/en.json , that the translators can translate (out of scope of this issue, see UIREQ-607, UICIRC-577, ...)
- the front-end to take the "code" property and create a translated message (this issue)
- the back-end to send the translation key in the "code" property (out of scope for this issue, see CIRC-1146)
Steps to Reproduce:
- Switch to German locale
- Request an item that the requester currently has on loan.
Expected Results:
German error message.
Actual Results:
English error message:
This requester currently has this item on loan.
Translators cannot translate this because
- there is no entry in the translation file https://github.com/folio-org/ui-requests/blob/master/translations/ui-requests/en.json (out of scope of this issue, see UIREQ-607, UICIRC-577, ...) and
- the front-end doesn't use the "code" property to look up a translation in the translation file (this issue) and
- because of this the back-end doesn't know which translation code to send as "code" property (out of scope of this issue, see CIRC-1146):
{ "errors" : [ { "message" : "This requester currently has this item on loan.", "parameters" : [ { "key" : "itemId", "value" : "7212ba6a-8dcf-45a1-be9a-ffaa847c4423" }, { "key" : "userId", "value" : "b4cee18d-f862-4ef1-95a5-879fdd619603" }, { "key" : "loanId", "value" : "38c377d0-842f-4c59-952f-b56635445cd5" } ] } ] }
Additional information:
Currently the back-end doesn't send a "code" property (out of scope of this issue, see CIRC-1146) but declares it in the error.schema/extended-error.json:
https://github.com/folio-org/raml/blob/raml1.0/schemas/error.schema
https://github.com/folio-org/mod-circulation/blame/v20.1.5/ramls/extended-error.json
{ "errors" : [ { "code" : "mod-circulation.errors.requesterHasItemOnLoan", "message" : "This requester currently has this item on loan.", "parameters" : [ { "key" : "itemId", "value" : "7212ba6a-8dcf-45a1-be9a-ffaa847c4423" }, { "key" : "userId", "value" : "b4cee18d-f862-4ef1-95a5-879fdd619603" }, { "key" : "loanId", "value" : "38c377d0-842f-4c59-952f-b56635445cd5" } ] } ] }
Task:
For this issue assume that the back-end fills the "code" property with a valid translation key that can be used to lookup the translated error message. (If there is no "code" property simply display the "message" property without translation as before.)
The "parameters" are the placeholders for the icu message syntax.
{ "errors" : [ { "code" : "mod-circulation.errors.noItemFoundForBarcodeFailure", "message" : "No item with barcode 1234 exists.", "parameters" : [ { "key" : "itemBarcode", "value" : "1234" } ] } ] }
Assume that the current language has this translation for the translation key:
"mod-circulation.errors.noItemFoundForBarcodeFailure": "Es existiert kein Exemplar mit dem Barcode {itemBarcode}."
Then front-end should show this error message:
Es existiert kein Exemplar mit dem Barcode 1234.
Note that "errors" is an array. Each array element results in an error message, and all of them need to be displayed. Example:
{ "errors" : [ { "code" : "mod-circulation.errors.noUserFoundForBarcodeFailure", "message" : "No user with barcode 98765 exists.", "parameters" : [ { "key" : "userBarcode", "value" : "98765" } ] }, { "code" : "mod-circulation.errors.noItemFoundForBarcodeFailure", "message" : "No item with barcode 1234 exists.", "parameters" : [ { "key" : "itemBarcode", "value" : "1234" } ] } ] }
In scope:
Use the "code" property to look up a translation and replace placeholders (2. in list above). If there is no "code" property display the "message" property without translation.
Out of scope:
- Changing mod-circulation to send the "code" (3. in list above, see CIRC-1146)
- Creating a file with translation keys and translation values for messages from mod-circulation (1. in list above, see UIREQ-607, , UICIRC-577, ...).
TestRail: Results
Attachments
Issue Links
- defines
-
UXPROD-371 Enable translation of validation and other error messages that display verbatim from back end
-
- Open
-
- is blocked by
-
CIRC-1146 Internationalize back-end failure messages
-
- In progress
-
-
STRIPES-750 DECISION: Which module should host back-end translation files?
-
- Closed
-
- relates to
-
UIREQ-220 English words/phrases showing up in FOLIO Apps UI while in RTL - Requests App
-
- Closed
-
-
FOLIO-1716 Uniquely identify backend API validation errors
-
- Closed
-
-
UICIRC-577 Add translation key "mod-circulation.noItemFoundForBarcode"
-
- Blocked
-
-
UIREQ-607 Add translation key "mod-circulation.requesterHasItemOnLoan"
-
- Blocked
-
- mentioned in
-
Page Loading...