potools icon indicating copy to clipboard operation
potools copied to clipboard

Handle Rgui domain as well

Open MichaelChirico opened this issue 4 years ago • 4 comments
trafficstars

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 avatar May 26 '21 03:05 MichaelChirico

Handy reference:

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

MichaelChirico avatar May 29 '21 09:05 MichaelChirico

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 avatar Jun 19 '21 20:06 MichaelChirico

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 avatar Jun 19 '21 22:06 MichaelChirico

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"

MichaelChirico avatar Jun 20 '21 02:06 MichaelChirico