4

I am using shinyapps.io to host quite a few Shiny apps. Usually, I am hosting apps in German.

Now, I want to host one app in English. The only thing that does not work are the abbreviated month names on the scale_x_date axis of a ggplot. These are still shown in German.

I manually set the locale at the beginning of the server.R file. This worked fine on my machine. The abbreviated month names are shown in English. However, as soon as I deploy the app to shinyapps.io, German abbreviations are shown again.

I understand that this happens because the {rsconnect} package is trying to match the locale for the app on shinyapps.io with the locale on my machine. So, my question is:

How can I force shinyapps.io (or the {rsconnect} package) to use a specific locale for just this single app. Preferably, I don't want to change my overall system locale and certainly not all locales for all apps in my shinyapps.io account.

Another solution would be to force scale_x_date to use English month abbreviations and not use those from the current locale.

Thank you very much for your help and time!

swolf
  • 1,020
  • 7
  • 20

1 Answers1

3

I found adding Sys.setlocale("LC_ALL","C") to the beginning of the code (so outside the app, where you load packages, etc) works. Don't know why the Shiny locale changes if my "offline" one is in English though.