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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use other locales even though changing LC_TIME #111

Open
DanChaltiel opened this issue Feb 9, 2024 · 0 comments
Open

Cannot use other locales even though changing LC_TIME #111

DanChaltiel opened this issue Feb 9, 2024 · 0 comments

Comments

@DanChaltiel
Copy link

Hi,

Thank you for this incredible package that will change so many things in the R ecosystem 馃ぉ.

I have a shinylive app running on httpuv::runStaticServer() (and soon on GHpages), which works as intended.

However, the app has a UI in French when run from RStudio, but in English when run from the httpuv server.
Despite my many efforts, I was not able to switch the latter to French.

As a (hopefully) reproducible example, you can add the following code anywhere in the minimal example of shinylive.
I put the output read in the JS console as comments.
Note that I'm running RStudio desktop on Windows 10 on a French computer.

library(lubridate)
print(Sys.getlocale("LC_ALL"))  #"fr_FR.UTF-8"
wday(today(), label=TRUE) |> print()  #Friday
wday(today(), label=TRUE), locale="French" |> print() #Friday

Sys.setlocale("LC_ALL", locale="French_France.1252")
print(Sys.getlocale("LC_ALL")) #"French_France.1252"
wday(today(), label=TRUE) |> print() #Friday

"French_France.1252" is the output of Sys.getlocale("LC_ALL") when run locally in the R console. Of note, "fr_FR.UTF-8" is not recognized as a correct locale in the R console.

Additionally, the different dateInputs are in English, regardless of Sys.setlocale and of Sys.setenv(LANGUAGE="fr").
I get some JS warning from bootstrap (bootstrap-datepicker.min.js:1) that might be related:

Details

DEPRECATED: This filename doesn't follow the convention, use bootstrap-datepicker.en-CA.js instead.
DEPRECATED: The language code "kh" is deprecated and will be removed in 2.0. For Khmer support use "km" instead.
DEPRECATED: The language code "kr" is deprecated and will be removed in 2.0. For korean support use "ko" instead.
DEPRECATED: This language code "rs-latin" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian latin support use "sr-latin" instead.
DEPRECATED: This language code "rs" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian support use "sr" instead.

I don't get notable errors, except the following, which are already described in other issues and don't seem to cause any trouble

shinylive.js:34938 preload error:wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
shinylive.js:34938 preload error:falling back to ArrayBuffer instantiation
preload error:Warning in install(dep, repos, info, lib, quiet, mount) :
preload error:  Requested package curl not found in webR binary repo.
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

No branches or pull requests

1 participant