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 locale support to theme provider and use in date-text column #1410

Merged
merged 26 commits into from
Sep 1, 2023

Conversation

m-akinc
Copy link
Contributor

@m-akinc m-akinc commented Aug 1, 2023

Pull Request

🤨 Rationale

Fixes #1293
Part of #1014
Adding design token ("lang") for locale and honoring that token's value when formatting dates in the date-text column.

👩‍💻 Implementation

  • introduced "lang" design token with dynamic default that uses the page's lang property, if valid, otherwise uses "en-US"
  • new DocumentElementLang singleton watches page element's lang property
  • added lang property to theme provider which sets design token value
  • using design token value when creating formatter used by date-text column
  • added new validation flag to theme provider that is set when the locale is malformed
  • setting 'en-US' locale for all date-text unit tests (which they were already assuming)
  • added unit tests

🧪 Testing

Unit tests pass (even when system locale is something other than 'en').

✅ Checklist

  • I have updated the project documentation to reflect my changes or determined no changes are needed.

@m-akinc m-akinc requested a review from mollykreis August 1, 2023 22:05
@m-akinc m-akinc changed the title Add locale support to date-text column Add locale support to theme provider and use in date-text column Aug 2, 2023
@m-akinc m-akinc requested a review from msmithNI August 2, 2023 16:35
@m-akinc m-akinc marked this pull request as ready for review August 2, 2023 18:27
@m-akinc m-akinc requested a review from msmithNI August 4, 2023 22:03
@rajsite rajsite marked this pull request as draft August 5, 2023 00:20
@m-akinc m-akinc requested a review from mollykreis August 7, 2023 14:46
@rajsite rajsite marked this pull request as draft August 8, 2023 20:11
@m-akinc m-akinc requested a review from rajsite August 28, 2023 17:59
@m-akinc m-akinc marked this pull request as ready for review August 29, 2023 20:54
@mollykreis mollykreis self-requested a review August 31, 2023 18:09
@m-akinc m-akinc enabled auto-merge (squash) September 1, 2023 18:23
@m-akinc m-akinc merged commit 5e462b1 into main Sep 1, 2023
8 of 9 checks passed
@m-akinc m-akinc deleted the users/makinc/datetime-column-locale branch September 1, 2023 19:16
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.

Provide locale setting on nimble-theme-provider
5 participants