Shiny applications internationalisation made easy!
Using it is very simple: just prepare your translation files in one of the supported formats, read them into your app using user-friendly shiny.i18n interface and surround your expressions to translate by a translator tag. Thanks to that your app will remain neat and readible.
Actually, you can use shiny.i18n as a standalone R package - shiny app is just a perfect usecase example.
Change languages and formats easy with shiny.i18n.
This library source code can be found on Appsilon Data Science’s Github:
https://github.com/Appsilon/shiny.i18n/
At the moment it’s possible to install this library with devtools.
To install previous version you can run:
You can find some basic examples in examples
folder:
Using i18n object with CSV translation files or JSON translation files.
Live language change on the browser side or with the server function renderUI.
Example of translation data format.
Currently shiny.i18n supports two translation formats:
translation_<LANGUAGE-CODE>.csv
containing two columns: key translation, language to which it needs to be translated. Example of translation_pl.csv
for Polish language you may find here: inst/examples/data/translation_pl.csv
. You load the data by passing the path to folder containing all the csv files:translation.json
with mandatory fields: "languages"
with list of all language codes and "translation"
with list of dictionaries assigning each translation to a language code. Example of such a json file for Polish language you may find here: inst/examples/data/translation.json
. You load the data by passing the path to json file.If you want to contribute to this project please submit a regular PR, once you’re done with new feature or bug fix. Reporting a bug is also helpful - please use github issues and describe your problem as detailed as possible.
Changes in documentation
Documentation is rendered with pkgdown
. Just run pkgdown::build_site()
after editing documentation or README.md
.
We used the latest versions of dependencies for this library, so please update your R environment before installation.
Get in touch dev@appsilon.com.