transltr-package {transltr}R Documentation

Support Many Languages in R

Description

[Experimental]

An object model for source text and translations. Find and extract translatable strings. Provide translations and seamlessly retrieve them at runtime.

Introduction

R relies on GNU gettext to produce multi-lingual messages (if Native Language Support is enabled). This is well-designed software offering an extensive set of functionalities. It is ubiquitous and has withstood the test of time. It is not the objective of transltr to (fully) replace it.

Package transltr provides an alternative in-memory object model (and further functions) to easily inspect and manipulate source text and translations.

Getting Started

Write code as you normally would. Whenever a piece of text (literal  character vectors) should be available in multiple languages, pass it to method Translator$translate(). You may also use your own function.

  1. Once you are ready to translate your project, call find_source(). This returns a Translator object.

  2. Export the Translator object with translator_write(). Fill in the underlying translation files.

  3. Import translations back into an R session with translator_read().

Current language and source language are respectively set with language_set() and language_source_get(). By default, the latter is set equal to "en" (English).

Bugs and Feedback

You may submit bugs, request features, and provide feedback by creating an issue on GitHub.

Acknowledgements

Warm thanks to Jérôme Lavoué, who supported and sponsored the first release of this project.

Author(s)

Maintainer: Jean-Mathieu Potvin jeanmathieupotvin@ununoctium.dev [copyright holder]

Other contributors:

See Also

The scattered and incomplete documentation of R's Native Language Support:

The comprehensive technical documentation of GNU gettext.


[Package transltr version 0.1.0 Index]