Open hadley opened 3 years ago
Should we track GitHub user name of contributors? Would be nice to be able to ping folks when translations need updating.
From what I understand, this would be served well by X-
fields in the .po metadata:
e.g. we could add X-GitHub-Id: michaelchirico
and read from that in whatever tooling we add
(@MichaelChirico these are the notes I made from our conversation, updated based on my experience with the PRs)
A few scenarios to consider:
Big package with large community (e.g. data.table, tidyverse): few developers, many translators.
Bilingual author who wants to provide messages in English + their native language (e.g. metR): developer = translator
One really passionate user or a language community who contributes to many packages.
Basic workflow
Initial translation:
po_scan()
: R/C source ->.pot
po_create()
:.pot
->.po
Translators edit
.po
po_compile()
:.po
->.mo
Updates:
po_scan()
to update.pot
po_update()
to update.po
Translators update
.po
po_compile()
:.po
->.mo
More details
Getting started
Add
tr_()
andtr_n()
functions.untr_()
or similar to declare that you have reviewed a message and have decided not to translate it?Do whatever is needed on the C side
Run
po_report()
and pick a function to translate. Repeat.cat()
/message()
/warning()
/stop()
and rlang equivalents) and check that the first argument is a call totr_()
ortr_n()
.Use
po_scan()
to scan R/ and src/ to generate.pot
filesTranslator: Adding a new language
Run
po_create("fr")
Fill in translations
Run
po_compile()
to build.mo
fileProbably best done with CI --- probably in the pull request or on merge to main. Or maybe because it's a binary, maybe do it on release? (e.g. is \~ 1 meg for data.table). If on release, what's the workflow for prototyping.
Would be nice to be able to dynamically get just the translations you need.
Developer: Translating more messages
Run
po_report()
and pick an function to translate. Repeat.Use
po_update()
to update individual.po
files.Ask translators to update.
Before release
Use
po_report()
to make sure all messages have translations, and all languages have translations for message.use_release_issue()
should add to bullets ifpo
directory exists.As needed, ping translators to request updates
po_compile()
to make sure all up to date