fix(i18n): add lowercase keys for selected search facets (#5048)#5052
Conversation
093b034 to
f3b7d30
Compare
…ls-due-to-case-sensitivity-mismatch
|
@tdonohue I have refactored the code to implement the lowercase normalization strategy as discussed #5048 (using the I have two questions regarding the next steps: 1. The "Archived" vs "item" discrepancy
Currently, selecting "Archived" displays "item" because I haven't added the
2. Other Language Files
|
|
@JohnnyMendesC : Based on your question, I was looking at how this behaves on sandbox.dspace.org and I've realized this is an existing bug (similar/related to the original ticket in this PR). I can reproduce that same behavior on https://sandbox.dspace.org and doesn't appear to be caused by your PR, nor is it solved by this PR (yet). That said, I think your solution is likely the correct one. It seems like there's a missing i18n key that should be added for I'm not sure why that key doesn't already exist. Regarding updating all the other i18n files (besides |
- Adds 'search.filters.namedresourcetype.item' to all language files, mirroring the existing 'Archived' translation, to fix the ID discrepancy in the selected filter state
…guages Updates all translation files to use lowercase keys for 'workspace', 'workflow', 'archived', 'validation', and 'waiting for controller' facets. This aligns with the new case-insensitive normalization strategy.
|
Thank you for taking the time to verify the item bug on the sandbox and for the clear guidance @tdonohue ! I have pushed two new commits to address both points:
The PR should be all set now and ready for a final review. Let me know if there's anything else needed! |
|
@JohnnyMendesC : Just a brief note... this PR still has some minor lint failures that need cleanup. That's why there are test failures. |
|
Thanks for the heads-up, @tdonohue! |


References
Description
This PR fixes a bug where selected search facets (e.g., "Workspace", "Workflow", "Archived") displayed raw, untranslated values due to a case sensitivity mismatch between URL parameters (lowercase) and i18n keys (TitleCase).
It implements a code-based normalization strategy to force all facet lookups to lowercase, ensuring consistency between the sidebar list (Solr response) and selected filters (URL parameters), preventing regressions in boolean or other non-string filters.
Instructions for Reviewers
Context and Analysis:
The issue stems from inconsistent casing:
f.namedresourcetype=workspace).List of changes in this PR:
search-facet-option.component.htmlandsearch-facet-selected-option.component.htmlto apply the lowercase pipe to filter values.LowerCasePipein the corresponding standalone components.Workflow,Workspace) to lowercase inen.json5andpt-BR.json5.This PR implements a "lowercase normalization" strategy:
SearchFacetOptionComponent) and the selected filter breadcrumb (SearchFacetSelectedOptionComponent) now explicitly pipe the value to| lowercasebefore looking up the translation.en.json5andpt-BR.json5were renamed to lowercase to match the normalized lookup.How to test:
/admin/workflowor/admin/search.Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.