The problem with what you want to do is that you'll only find untranslated strings at runtime, and only for code paths which are actually executed. It may take years for you to find all strings, and in the meantime you have to look at your log files regularly and sync your updated translations with what's happening in the log file. That's not a deterministic approach to translations.
If you're using gettext, you need to establish a workflow that's appropriate for it. And the gettext workflow and toolchain are pretty well thought out and time tested.
- Prepare your source code by wrapping strings in gettext functions.
- Extract the prepared strings into POT files, typically using
xgettext
but possibly using a custom parser/extractor and a library like Kunststube\POTools (shameless self promotion).
- Create PO files from the extracted template files using
msginit
.
- Translate the PO files.
- Keep updated source/POT files in sync with PO files using
msgmerge
.
- Compile PO files to MO files using
msgfmt
.
- Rinse, repeat.
This is the proper gettext workflow in a nutshell, and it accounts for most problems in the translation process. Especially if you have distributed translators you typically have a time lag and overlap between source code being updated and translations coming in. Without automated string extraction and the msgmerge
utility it's easy for this process to devolve into chaos, which is why you should stick to the above steps.
If you do, your question becomes irrelevant since you can check your PO files at any time using the gettext utilities or a tool like Poedit to see which strings are untranslated.