MichaelChirico / potools

Tools for working with translations in R
https://michaelchirico.github.io/potools/
58 stars 2 forks source link

Handle Rgui domain as well #69

Open MichaelChirico opened 3 years ago

MichaelChirico commented 3 years ago

Rgui is the last domain that comes along with base, see brief mention here and the Rgui.pot template: https://github.com/wch/r-source/blob/trunk/src/library/base/po/RGui.pot

IINM we are looking for strings in the po/POTFILES (see #68) files that are marked with G_(.) as the translation macro (this macro is defined here: https://github.com/wch/r-source/blob/f8f705fe994ee163919d6246af3ae8c48440c65f/src/gnuwin32/win-nls.h#L27)

MichaelChirico commented 3 years ago

Handy reference:

https://github.com/wch/r-source/blob/b87d430b5e2398b2d48e124b8e8b23fde3c68b57/src/library/tools/R/translations.R#L239-L301

MichaelChirico commented 3 years ago

I'm wondering whether these should be translated alongside the other base translations. That's what I started doing on this branch... but the documentation suggests (and it makes sense) that the translators for RGui may be different from those for the rest of the messaging (it's why they separated to a different domain to begin with).

So maybe we need a different function to orchestrate this entirely...

MichaelChirico commented 3 years ago

Given this and that it seems non-trivial to shoehorn this into the is_base workflow, and that it doesn't seem super high-priority to fix, I'll deprioritize this for the initial CRAN release. I also envision encoding issues arising from this Windows-only feature...

MichaelChirico commented 3 years ago

NB: get_po_messages() has this line which needs to be adjusted alongside this enhancement:

message_source = if (startsWith(basename(po_file), "R-")) "R" else "src"