Skip to content

Commit

Permalink
Expose LANG and all categories of the current session's locale (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennybc authored Mar 20, 2024
1 parent f079a92 commit e733523
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/ark/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ark"
version = "0.1.66"
version = "0.1.67"
edition = "2021"
rust-version = "1.75.0"
description = """
Expand Down
10 changes: 10 additions & 0 deletions crates/ark/src/modules/positron/system.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ has_cairo <- function() {
has_x11 <- function() {
capabilities("X11")
}

#' Reports aspects of the locale for the R process.
#' @returns Named character vector of LANG env var and all categories of the locale.
#' @export
.ps.rpc.get_locale <- function() {
cats <- .LC.categories
stats::setNames(cats, cats)
out <- as.list(vapply(cats, Sys.getlocale, "string", USE.NAMES = TRUE))
c(LANG = Sys.getenv("LANG"), out)
}

0 comments on commit e733523

Please sign in to comment.