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

Add text translate util #771

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Add text translate util #771

merged 1 commit into from
Sep 27, 2024

Conversation

bangbay-bluetiger
Copy link
Contributor

Description

  • Add a translate util that replaces any keys in {{key}} format within a string with defined values
  • Use the util in ExportedReportPage with a LaunchDarkly flag
  • Remove old LD flags in tests

Related ticket(s)

CMDCT-3677


How to test

  1. Create a WP and SAR.
  2. Verify the headings are as expected.
  3. Unit tests also provide coverage.

Notes

If we like this pattern, there are several other components where we can use the util.


Pre-review checklist

  • I have added thorough tests, if necessary
  • I have updated relevant documentation, if necessary
  • I have performed a self-review of my code
  • I have manually tested this PR in the deployed cloud environment

Copy link

codeclimate bot commented Sep 25, 2024

Code Climate has analyzed commit f943f46 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (90% is the threshold).

This pull request will bring the total coverage in the repository to 93.2% (0.1% change).

View more on Code Climate.

Copy link
Contributor

@gmrabian gmrabian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good to me. I'm curious to see the other use cases you have in mind. Is the advantage just of defining the desired string in a verbiage or json file rather than in the components?

@bangbay-bluetiger
Copy link
Contributor Author

Changes look good to me. I'm curious to see the other use cases you have in mind. Is the advantage just of defining the desired string in a verbiage or json file rather than in the components?

Yes, defining the strings in verbiage files makes it easier to find them. Plus, instead of using string fragments where it isn't obvious they're being combined later, it's easier to see the complete string.

Copy link
Contributor

@britt-mo britt-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked good in the browser. I like this change, looks cleaner than using string interpolation in the component.

@bangbay-bluetiger bangbay-bluetiger merged commit fb8646b into main Sep 27, 2024
25 of 26 checks passed
@bangbay-bluetiger bangbay-bluetiger deleted the text-translate branch September 27, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants