How can I check .mo file validity?
Asked Answered
L

2

11

I'm using PHP to make .mo files out of the database and have run into a strange problem: some keys work, some don't. I think there is some kind of a problem with the generated files. How can I check, whether a .mo file is correct?

Legitimize answered 16/6, 2011 at 11:5 Comment(0)
M
15

Use msgunfmt, which is the opposite of msgfmt:

msgunfmt something.mo

If the .mo file is messed up, msgunfmt will complain.

Matilda answered 4/7, 2011 at 12:49 Comment(1)
This worked great. If on MacOS, and using Homebrew. You can do brew install gettext and then brew link get text and then have access to this command.Mazdaism
K
0

polib can open and read .mo files; it should not be difficult to create a small tool that iterates through the entries, allowing you to verify them.

Kea answered 16/6, 2011 at 11:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.