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 ability to set global locale in gt() #866

Merged
merged 5 commits into from Jan 29, 2022
Merged

Conversation

rich-iannone
Copy link
Member

This PR adds the locale argument to gt(). The value (NULL or a locale string) is immutably set in the gt object's "_locale" key. It's validated within the gt() function. Formatter functions will automatically use the global setting, if any, or, will use any non-NULL locale value provided during within a formatter (fmt_*()) function (overriding the global locale).

Fixes #682

jcheng5
jcheng5 previously approved these changes Jan 28, 2022
@jcheng5 jcheng5 self-requested a review January 28, 2022 20:41
@rich-iannone rich-iannone marked this pull request as ready for review January 28, 2022 21:38
@rich-iannone rich-iannone merged commit c44578b into master Jan 29, 2022
@rich-iannone rich-iannone deleted the set-locale-globally branch January 29, 2022 00:52
rich-iannone added a commit that referenced this pull request Jan 29, 2022
* master:
  Add ability to set global locale in `gt()` (#866)
  Bug fixes and enhancements to date/time formatters (#801)
rich-iannone added a commit that referenced this pull request Feb 1, 2022
* master:
  Add ability to set global locale in `gt()` (#866)
  Bug fixes and enhancements to date/time formatters (#801)
  Fixes to footer (footnotes and source notes) across all output formats (#864)
  Row group labels as a column in stub (#855)
  Use reusable GHA workflows (#847)
  Increment version number
  v0.3.1 Release Candidate (#821)
rich-iannone added a commit that referenced this pull request Feb 2, 2022
* master: (23 commits)
  Improve color handling and add tests (#870)
  Change HTML percent sign to literal `%` (#871)
  Add ability to set global locale in `gt()` (#866)
  Bug fixes and enhancements to date/time formatters (#801)
  Update gt_workflow_diagram.svg
  Update gt_parts_of_a_table.svg
  Update README.md
  Add dedicated ISSUE TEMPLATEs
  Update README.md
  Delete README.Rmd
  Update intro-creating-gt-tables.Rmd
  Update LICENSE
  Make corrections to docs (`columns`/`rows`)
  Update _pkgdown.yml
  Fixes to footer (footnotes and source notes) across all output formats (#864)
  Row group labels as a column in stub (#855)
  Use reusable GHA workflows (#847)
  Increment version number
  v0.3.1 Release Candidate (#821)
  Fix for styles applied to summary cells when row groups are reordered (#814)
  ...
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.

Option to set locale globally
2 participants