Details
-
Task
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
-
Very Small (VS) < 1day
-
Out of scope
-
High
-
Very Small (VS) < 1day
Description
The current code
https://github.com/folio-org/stripes-smart-components/blob/cbee693/lib/SearchAndSort/SearchAndSort.js#L539
takes the moduleName to build a translation key: ui-${moduleName}.resultCount
ui-*/translations/en.json always has this entry:
"resultCount": "{count, number} {count, plural, one {Record found} other {Records found}}"
See the list of all */en.json: https://github.com/search?l=JSON&q=org%3Afolio-org+resultcount&type=Code
The current code has these issues:
- Redundant translation strings in the caller modules.
- No default string.
- No documentation about ui-${moduleName}.resultCount in the readme: https://github.com/folio-org/stripes-smart-components/tree/11284e8/lib/SearchAndSort
- Restricted to a single record type per module. One module may have three different searches and want to show "1 title found", "1 instance found", "1 item found" but there is no way to do so.
- Difficult for the translators to find out where ui-inventory.resultCount is used; often some context (on which screen/form is it used?) is required to make a translation.
This is an idea how this may get solved:
As default use translation id stripes-smart-components.searchResultCount with this string:
"{count, number} {count, plural, one {Record found} other {Records found}}"
This is used unless the caller passes a resultCountMsgId, for example ui-inventory.itemSearch.resultCount.
TestRail: Results
Attachments
Issue Links
- relates to
-
STSMACOM-86 Extract all translatable text into translations/en.json
-
- Closed
-