NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

shiny.i18n: Shiny Applications Internationalization

Jakub Nowicki, Dominik Krzemiński, Krystian Igras, Jakub SobolewskiOpenalex Unknown 2018 · OpenAlex

Abstract

shiny.i18n (version 0.3.0) provides a comprehensive framework for the internationalization (i18n) of Shiny applications. It is designed to function both as a specialized tool for interactive web apps and as a standalone translation package for reports, visualizations, and graphical elements. The package requires R (>= 3.3) and offers a structured approach to managing multi-language dictionaries and reactive UI updates.

Introduction

As data science tools like Shiny gain global adoption, developers face increasing pressure to make their applications accessible to non-English speakers. Historically, implementing multi-language support in R was a fragmented process, often requiring developers to hard-code conditional logic for every string or build custom, brittle translation layers. This paper describes shiny.i18n, a unified solution that automates the "plumbing" of internationalization: identifying translatable strings, managing translation files, and ensuring the user interface (UI) updates reactively when a user switches languages.

Architectural Design: The Translator R6 Class

The package is architected around an R6 class system, which provides a robust and stateful way to manage translation logic. The primary interface for developers is the Translator object.

The core Translator R6 Class definition

This object manages the application's language state and provides methods for parsing dates and potentially numbers. By encapsulating translation logic within a class, the package ensures that language settings remain consistent across different modules of a complex Shiny application.

Methodology and Workflow

The shiny.i18n workflow is designed to minimize developer friction through a three-step process: tagging, extraction, and implementation.

Tagging and Extraction

Developers begin by wrapping translatable strings in a translation method, typically i18n$t("String"). To avoid the manual labor of building dictionaries, the package includes an auxiliary function, create_translation_file. This utility scans the source code for these tags and automatically generates template translation files.

Arguments for the file inspection and translation generation utility

As shown in the parameters above, developers can specify the file path to inspect, the desired output format (JSON or CSV), and the name of the Translator object handle used within the script. This automation ensures that the translation keys in the code remain synchronized with the external dictionary files.

Flexible Data Backends

The package supports two primary formats for storing translations:

  1. JSON: Ideal for structured, nested translation data.
  2. CSV: A folder-based system where each language has its own file (e.g., translation_pl.csv), allowing teams to use familiar spreadsheet tools for localization.

Additionally, shiny.i18n provides a wrapper for the googleLanguageR package. This allows developers to bootstrap their translation files using Google Cloud’s machine translation APIs, significantly speeding up the initial localization phase.

Reactive Integration and User Experience

A key feature of the package is its ability to support "live" language switching without requiring a full page refresh. This is achieved through the integration of usei18n() and update_lang(). These functions leverage Shiny’s native reactive domain (shiny::getDefaultReactiveDomain()) to send messages to the browser's session object. When a user selects a new language, the package triggers updates across all tagged UI elements—such as headers, buttons, and labels—dynamically.

Beyond the interactive UI, the authors designed the package to be "standalone." This means it can be used to translate elements in static R Markdown reports or graphical components like plot labels, making it a versatile tool for the entire R ecosystem.

Discussion and Future Work

While shiny.i18n provides a comprehensive API for internationalization, certain limitations remain. The documentation notes that numerical localization (e.g., parse_number()) is not yet implemented, which is a critical requirement for full localization in regions with different decimal separator conventions. Furthermore, the CSV-based system relies on strict file-naming conventions that may require adjustment for some existing workflows.

Future development is expected to focus on completing the numerical parsing features and potentially expanding the automated translation hooks beyond Google Cloud to other providers. Despite these areas for growth, shiny.i18n represents a significant step forward in making R-based applications globally accessible through a standardized, developer-friendly framework.

Summary updated

BibTeX
@inproceedings{nowicki2018shiny,
  author = {Jakub Nowicki and Dominik Krzemiński and Krystian Igras and Jakub Sobolewski},
  title = {{shiny.i18n: Shiny Applications Internationalization}},
  booktitle = {Openalex Unknown},
  year = {2018},
  doi = {10.32614/cran.package.shiny.i18n},
}
Figure