futureverse / futureverse/progressr
Translation: Make it possible to translate errors, warnings, and other messages
- Dominant language
- R
- Stars
- 299
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
# Wish
Add support translation of error and warning messages.
# Tasks
1. Update all `stop(msg)` and `warning(msg)` calls to use `stop(gettext(msg))` and `warning(gettext(msg))`, or possibly `gettextf(fmtstr, ...)` and `ngettext(n, msg1, msg2)`
2. For native code, update all `error(msg)` to `error(_(msg))`
3. Create a `po/R-{{package-name}}.pot` with `msgid` and `msgstr` entries
4. Harmonize messages, if possible, to lower the number of unique messages that need translation
5. Ask community for help to translate to other languages
# References
The **[potools](https://github.com/MichaelChirico/potools)** package looks like a useful tool, e.g. [rstudio::globals(2021) talk on 'Making .pot-ery with R: Translations in R Packages'](https://www.rstudio.com/resources/rstudioglobal-2021/making-pot-ery-with-r-translations-in-r-packages/) and upcoming [useR! 2021 workshop](https://www.conftool.org/user2021/index.php?page=browseSessions&ismobile=true&search=Translating+R).
Contributor guide
Assessment
This issue has not been assessed yet.