Skip to content

Translate Post Office search results#10882

Merged
mitchellhenke merged 6 commits intomainfrom
mitchellhenke/localized-usps-search
Jul 1, 2024
Merged

Translate Post Office search results#10882
mitchellhenke merged 6 commits intomainfrom
mitchellhenke/localized-usps-search

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented Jun 27, 2024

🛠 Summary of changes

Re-uses existing hours translation functionality in the ReadyToVerifyPresenter for the translation of content for the Post Office search results controllers.

Comment on lines 69 to 71
Copy link
Contributor

Choose a reason for hiding this comment

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

just realized this whole thing is repeated in two controllers, what if we made EnrollmentHelper.localized_location or some other helper that could be reused?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I thought about that and I felt I was already deep enough in the rabbit hole to open a PR. I'm on board with it.

Copy link
Contributor Author

@mitchellhenke mitchellhenke Jun 28, 2024

Choose a reason for hiding this comment

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

Forgot that slice/merge doesn't work because location is a PostOffice rather than a hash. I've moved it to the EnrollmentHelper and switched to calling the attributes as methods rather than #[] to indicate that in a1ecb7aa25.

Copy link
Contributor

Choose a reason for hiding this comment

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

yay big fan of methods

Copy link
Contributor

Choose a reason for hiding this comment

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

oooo or what if we had PostOffice#localized which returns another instance of PostOffice (maybe with a localized?: true snuck in there to make sure we can't double-localize

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I experimented with something along those lines, but it felt less consistent with how it's handled in the ready_to_verify presenter/view. I think this would be preferable if the presenter used PostOffice as well.

@mitchellhenke mitchellhenke force-pushed the mitchellhenke/localized-usps-search branch 2 times, most recently from 33c82c1 to 342dd44 Compare June 28, 2024 15:53
@mitchellhenke mitchellhenke marked this pull request as ready for review June 28, 2024 15:55
Mitchell Henke and others added 6 commits June 28, 2024 12:38
@mitchellhenke mitchellhenke force-pushed the mitchellhenke/localized-usps-search branch from 74ee1f5 to 07738cf Compare June 28, 2024 17:39
@mitchellhenke mitchellhenke requested review from a team and WilliamBirdsall June 28, 2024 18:39
@eileen-nava eileen-nava requested review from a team and rutvigupta-design and removed request for a team June 28, 2024 20:39
Copy link
Contributor

@eileen-nava eileen-nava left a comment

Choose a reason for hiding this comment

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

I think this looks good from an engineering perspective. I tagged @18F/identity-joy-designers to take a look.

@mitchellhenke please don't merge the PR until someone from Joy design has okayed the change. (To be clear, I don't expect any issues, but I'd rather err on the side of checking with design.) Thanks!

return unless selected_location_details
hours = selected_location_details["#{prefix}_hours"]
return localized_hours(hours) if hours
UspsInPersonProofing::EnrollmentHelper.localized_hours(hours) if hours
Copy link
Contributor

Choose a reason for hiding this comment

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

👏🏻 Nice refactor, I like the idea of moving this to the EnrollmentHelper.

is_enhanced_ipp = resolved_authn_context_result.enhanced_ipp?
response = proofer.request_facilities(candidate, is_enhanced_ipp)
if response.length > 0
locations = proofer.request_facilities(candidate, is_enhanced_ipp)
Copy link
Contributor

Choose a reason for hiding this comment

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

@rutvigupta-design I'm including screenshots for you to look at.

French
Screenshot 2024-06-28 at 16 52 25

Spanish
Screenshot 2024-06-28 at 16 53 18

Chinese
Screenshot 2024-06-28 at 16 54 03

Copy link

@rutvigupta-design rutvigupta-design Jun 28, 2024

Choose a reason for hiding this comment

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

@eileen-nava the results LGTM but is there something strange going on in the H3 with all the languages? I don't think "lkn, lkn" in French, "kn, lkn" in Spanish, and "poj, ojpoj" should be there?

Screen Shot 2024-06-28 at 4 31 22 PM Screen Shot 2024-06-28 at 4 31 16 PM Screen Shot 2024-06-28 at 4 27 46 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think those are test values for the address/city fields in the search form

Choose a reason for hiding this comment

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

Ahh, okay that makes sense, thanks for clarifying! This LGTM then!

Copy link
Contributor

Choose a reason for hiding this comment

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

@rutvigupta-design Mitchell is correct, I typed in nonsense values for a test address. Thanks for reviewing the PR! 🙏🏻

Copy link

@rutvigupta-design rutvigupta-design left a comment

Choose a reason for hiding this comment

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

LGTM!

@mitchellhenke mitchellhenke merged commit b2306c7 into main Jul 1, 2024
@mitchellhenke mitchellhenke deleted the mitchellhenke/localized-usps-search branch July 1, 2024 14:17
@mitchellhenke mitchellhenke restored the mitchellhenke/localized-usps-search branch July 3, 2024 14:04
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.

5 participants