Translate in Shiny

,

Hello,

I have a question on Shiny. Is it possible to introduce an online translator for the website?
I ask this questio because i code in english but i wonder if i could make online translation to other languages instead of translating every variable to avoid mistakes.

Thanks a lot,

There's this: Shiny Applications Internationalization • shiny.i18n but it requires you to provide all the translations.

Thanks a lot. Let me have a look. If i understand the translation requires to plug all the translated word so that i an work off the web i guess. Why not if it is not complicated to handle.

Hello,

It did not work for me as i still repeatedly receives error message while i'm just picking a basic example i found online. The error message is: "Key translation is not the same in all files. In load_local_config(translation_csv_config) : You didn't specify config translation yaml file. Default settings are used.".

The code found here is posit is:

#create csv file with:
"en","it"
"Hello Shiny!","Ciao Shiny!"
"Histogram of x","Istogramma di x"
"This is description of the plot.","Questa è la descrizione della trama."
"Frequency","Frequenza"
"Number of bins:","Numero di scomparti:"
"Change language,"Cambia lingua"

i18n <- Translator$new(translation_csvs_path = "translations/translation_IT.csv")
i18n$set_translation_language("en")

i18n$languages

ui <- fluidPage(p(i18n$t("Hello")))

server <- function(input, output) {}

shinyApp(ui, server)

I haven't run your example (and never even used this package) but it looks like the problem is you have "Hello" in the UI but "Hello Shiny!" in your translations. Every string inside a i18n$t() needs to be included in the first column of the csv.

True thank you. However, the error message remains. Maybe it's due to my csv file with "" or whatever. The error message adds it does not find while i load it 'i18n' !!!

Hello i can tell you that this R package for translation is not working in my R as even when i download the csv and json file with the app code for github official package repository i receive plenty of errors. I would be interested to see if someone can run it without errors. Thank you for sharing.

Just FYI: {i18n} works fine for me.

Thanks a lot. It is strange because i downloaded code and json/csv files from Appsilon · GitHub but get error messages after hours of attempts. Please if any suggestion, very welcome !

This topic was automatically closed 90 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.