MyNixOS website logo
Description

Tools for Internationalization and Portability in R Packages.

Translating messages in R packages is managed using the po top-level directory and the 'gettext' program. This package provides some helper functions for building this support in R packages, e.g. common validation & I/O tasks.

potools: Tools for Portability and Internationalization of R packages

Overview

R users are a global community. From Xiamen to Santiago, Addis Ababa to Tbilisi, Ogallala to Adelaide, R users are legion and speak many different languages. To serve these diverse communities, R includes built-in tools based on the GNU gettext system that make it possible to translate user-facing communications like messages, warnings, and errors. Unfortunately, this system uses new file types (.pot templates, .po files, and .mo binaries) that come with their own quirks and idiosyncrasies. The goal of potools is make it as easy as possible to translate your package by abstracting away as many details of the gettext system as possible.

The potool logo features a potoo and was designed by Allison Horst.

Installation

Start by installing the released version potools from CRAN:

install.packages("potools")

Or the development version from GitHub:

# install.packages("remotes")
remotes::install_github("MichaelChirico/potools")

You'll also need to install gettext, the GNU command line toolkit that powers potools. Installation depends on your operating system:

  • On Windows, gettext is bundled with Rtools, so if you're developing packages you probably already have it.

  • On Mac, it's easiest to install with brew: brew install gettext

  • On Linux, it's usually already installed; otherwise you'll need to install gettext with your distro's standard tool.

Workflow

There are two core workflows provided by potools:

  • translate_package() is a one-stop-shop for interactively setting your package and providing translations, as described in ?translate_package.

  • po_extract(), po_create(), po_update(), and po_compile() let you perform the individual steps of translate_package() as described in vignette("developers") and vignette("translators").

Alternative software

potools is by no means the first tool for facilitating internationalization; other open-source projects have deeper experience in this domain and as a result there are some relatively mature options for working with gettext/the po ecosystem in general. Here is a smattering of such tools that I've come across:

  • Poedit - https://poedit.net/ - GUI Software for writing translations
  • Gtranslator - https://wiki.gnome.org/Apps/Gtranslator - GNOME Translation editor
  • Lokalize - https://userbase.kde.org/Lokalize - KDE's Computer-Aided Translation system
  • Virtaal - https://virtaal.translatehouse.org/?id=virtaal/index - Another FOSS software for translation
  • Pootle - https://pootle.translatehouse.org/ - Apparently related to Virtaal, and apparently there's even a paper written comparing the two
  • Localization Toolkit - https://toolkit.translatehouse.org/ - Again I'm not sure the difference vs. Virtaal & Pootle
  • PO mode in Emacs - https://www.emacswiki.org/emacs/PoMode.
Metadata

Version

0.2.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows