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

[HNT-295] fix section date localization #733

Closed
wants to merge 2 commits into from

Conversation

mmiermans
Copy link
Collaborator

@mmiermans mmiermans commented Dec 18, 2024

References

JIRA: HNT-295

Description

The date in the subtitle of the 'In the News' section is localized based on the ScheduledSurfaceId.

image

PR Review Checklist

Put an x in the boxes that apply

  • This PR conforms to the Contribution Guidelines
  • The PR title starts with the JIRA issue reference, format example [DISCO-####], and has the same title (if applicable)
  • [load test: (abort|skip|warn)] keywords are applied to the last commit message (if applicable)
  • Documentation has been updated (if applicable)
  • Functional and performance test coverage has been expanded and maintained (if applicable)

ScheduledSurfaceId.NEW_TAB_ES_ES: "es_ES",
ScheduledSurfaceId.NEW_TAB_IT_IT: "it_IT",
ScheduledSurfaceId.NEW_TAB_EN_INTL: "en_IN", # En-Intl is primarily used in India.
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The section experiment only runs in the US and Germany, but I thought it was better to implement this for all markets that we serve.

Returns:
str: Localized date string, for example "December 17, 2024".
"""
return format_date(date, format="long", locale=SURFACE_ID_TO_LOCALE.get(surface_id, "en_US"))
Copy link
Collaborator

Choose a reason for hiding this comment

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

just confirming that this defaults to en-US?

@mmiermans mmiermans changed the title [HNT-295] fix section date locations [HNT-295] fix section date localization Jan 14, 2025
@mmiermans
Copy link
Collaborator Author

Closing this because it was decided to remove 'In the News', and we therefore don't need to localize dates.

@mmiermans mmiermans closed this Jan 14, 2025
@mmiermans mmiermans deleted the hnt-295-date-localization branch January 14, 2025 12:53
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.

2 participants