Change shiny server language.

Hi, I have a question:

Is it possible to change the language of the shiny server? By default, shiny server's language is English, and if you want to switch to another language, is that possible?

Thank you so much!

Example:

In Rstudio:

[1] "domingo"       "segunda-feira" "terça-feira"   "quarta-feira"  "quinta-feira"  "sexta-feira"   "sábado"      

In shiny server:

  [1] "Sunday"    "Monday"    "Tuesday"   "Wednesday" "Thursday"  "Friday" [7] "Saturday"
1 Like

Can you please elaborate on what you mean by "shiny server's language is English", what specifically do you need to change to another language? Have in mind that Shiny Apps work with the system's default locale but you can manually change it for your current session to any other locale you need e.g. Sys.setlocale("LC_ALL", "en_US.UTF-8").

Thanks for answering @andresrcs . It's just that I'm having a brief problem, because in Rstudio I get my weekdays in Portuguese, for example, segunda-feira, terça-feira and so on. However, when I deploy this same app in shiny server, then I'm going to test it, my weekdays seem to be in English, for example, Monday, Tuesday.... Have you ever seen something like this? I inserted in the question as it appears for me.

Do you mean deploying to shinyapps.io? This is different than deploying to your own server.

If you are deploying to shinyapps.io, you can change the locale by using Sys.setlocale() (with your desired configuration) at the beginning of your app's code.

Yes @andresrcs , deploy to shinyapps.io.

I did this in the app, as suggested:

Sys.setlocale("LC_ALL", "pt_BR.UTF-8")
library(shiny)
library(shinythemes)
library(dplyr)
...

However, in the generated site, it still remains the weekdays in the English language . However, if I test the application through RStudio, the weekdays appear in Portuguese. This is weird! Any tips on what I can do to adjust?

I have tried myself and the problem is that the "pt_BR.UTF-8" locale is not installed in Shinyapps.io servers so I think this might need to be addressed by RStudio people.

2021-11-19T21:47:23.333711+00:00 shinyapps[5167359]:   OS reports request to set locale to "pt_BR.UTF-8" cannot be honored

Thanks for reply @andresrcs!

I understand now. I tested it like this too:

Sys.setlocale("LC_ALL", "Portuguese"), then the following appears:

[1] "LC_COLLATE=Portuguese_Brazil.1252;LC_CTYPE=Portuguese_Brazil.1252;LC_MONETARY=Portuguese_Brazil.1252;LC_NUMERIC=C;LC_TIME=Portuguese_Brazil.1252"

But it didn't work either when I go to test the site.

1 Like

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.