mshaffer
mshaffer

Reputation: 1003

How to open a MO gnu gettext file?

I am reviewing how to address multi-language support for documentation and messaging with a library. I found that the MASS package uses such support, and I wanted to review the how and why. For example, the ITALIAN pot/po file is compressed or binarized into MO form:

MASS_7.3-58.1\MASS\inst\po\it\LC_MESSAGES\R-MASS.mo

The question is: how do I open the R-MASS.mo file to see its ITALIAN contents or convert to a non-binary PO form?

I have installed gnu gettext on both WINDOZE and a DEBIAN Oracle VirtualBox. I have read the MAN page, and don't see how to extract MO files. Maybe there is an R Script that reads the binary to perform the necessary conversion? [ Similar to readRDB for .rdx/.rdb files, see https://stackoverflow.com/a/62394942/184614 ]

Upvotes: 2

Views: 1041

Answers (1)

Jānis Elmeris
Jānis Elmeris

Reputation: 2045

Use gettext's msgunfmt utility to extract all strings from a MO file:

msgunfmt MASS_7.3-58.1\MASS\inst\po\it\LC_MESSAGES\R-MASS.mo

Upvotes: 1

Related Questions