Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utils.ts #6383

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Update utils.ts #6383

wants to merge 1 commit into from

Conversation

fergie-nz
Copy link
Contributor

Fixes #6382

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Fix to how report names (code) is translated in the front end.

Currently only replaces first instance of ' ' in string with '-'. Should replace all

πŸ’Œ Any notes for the reviewer?

πŸ§ͺ Testing

You can test this by adding multiple words to a report 'code' in your database, then view how it appears in the list view on the front end with both this branch and develop.
You will see this branch searches and replaces all spaces rather than just the first.

πŸ“ƒ Documentation

  • Part of an epic: documentation will be completed for the feature as a whole

@github-actions github-actions bot added needs triage feature: reports needs daily triage New bug to be triaged by the release team labels Feb 2, 2025
Copy link

github-actions bot commented Feb 2, 2025

Bundle size difference

Comparing this PR to main

Old size New size Diff
5.27 MB 5.27 MB 1 B (0.00%)

@jmbrunskill
Copy link
Contributor

Fixes #6382

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Fix to how report names (code) is translated in the front end.

Currently only replaces first instance of ' ' in string with '-'. Should replace all

Why not make the code with no spaces, or aligned directly with the translation key?
I thought that was part of the point of calling it a code, it doesn't need to be directly readable by humans?

@fergie-nz
Copy link
Contributor Author

fergie-nz commented Feb 3, 2025

Fixes #6382

πŸ‘©πŸ»β€πŸ’» What does this PR do?

Fix to how report names (code) is translated in the front end.
Currently only replaces first instance of ' ' in string with '-'. Should replace all

Why not make the code with no spaces, or aligned directly with the translation key? I thought that was part of the point of calling it a code, it doesn't need to be directly readable by humans?

Agreed! I've made a separate issue here to restructure how we translate report names:

#6385

I added this because it was causing issues in unexpected ways with how we are currently managing translations for front end reports, and is an easy fix to this particular issue.

With the new and custom report suite, we have a number of reports with more than one space in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: reports needs daily triage New bug to be triaged by the release team needs triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Report name translation only replacing first space
2 participants