Joel Nitta
The University of Tokyo
https://joelnitta.github.io/carpentrycon_2022_trans
Not as simple as just re-writing text in another language as if translating a novel
Carpentries lessons are technical documents (rendered using software) and therefore present unique challenges
gettext
and PO files) are designed with software in mind, not prose textTwo aspects:
internationalization (i18n
): Providing the framework to support translation (requires technical knowledge)
localization (l10n
): Actually translating strings (requires linguistic knowlege)
The current Carpentries lesson format is called the “Styles” format
The Styles format is based on Jekyll (and some other tools)
Translation system1 designed by David Pérez-Suárez used a tool called PO4gitbook
All translations controlled from a central repo with submodules for each lesson (can track changes)
Rendering not straightforward
Various methods used to localize
R-novice-gapminder
, working on git-novice
, shell-novice
The upcoming Carpentries lesson format is called “Workbench”, developed by Zhian Kamvar
The Workbench format is based on Rmarkdown and pandoc
dovetail
Each translation is contained within each lesson1
Rendering is easily accomplished locally by the translator
Plan to have a standard system for translation (e.g., pushing/pulling from transifex)
dovetail
library(dovetail)
# Copy (untranslated) files needed for rendering lesson
create_locale("ja")
# Create PO files ----
create_po_for_locale("ja")
# Edit PO files ----
# for example, with
# usethis::edit_file("po/ja/01-introduction.po")
# Translate md files ----
# translate all (R)md files at once to `./locale/{lang}/`
translate_md_for_locale("ja")
# Build translated lesson ----
sandpaper::build_lesson("locale/ja/")
dovetail
Output of translation
|-- CONTRIBUTING.md # - Carpentries Rules for Contributions
|-- README.md # - Describes lesson
...
|-- po # - NEW, contains PO files for translation
| `-- ja/
| |-- 00-introducition.po
| |-- CONTRIBUTING.po
| |...
|-- locale # - NEW, contains translated files
| `-- ja/
| |-- CONTRIBUTING.md # - NEW, translated markdown files
| |-- site/ # - NEW, translated, rendered site
| |-- built/
| |...
dovetail
design philosophyi18n
)
l10n
)
l10n
) simple, we can encourage participation and grow local communities