The pogrep tool extracts messages that match a regular expresion into a new set of PO files that can be examined, edited and corrected. These corrections can then be merged using pomerge.
pogrep [options] <in> <out>
Where:
In and out are either directories or files. Out will contain PO/Xliff files with only those messages that match the regular expression that was you searched for.
Options:
--version | show program’s version number and exit |
-h, --help | show this help message and exit |
--manpage | output a manpage based on the help |
--progress=PROGRESS | show progress as: dots, none, bar, names, verbose |
--errorlevel=ERRORLEVEL | show errorlevel as: none, message, exception, traceback |
-iINPUT, --input=INPUT | read from INPUT in po, pot, xlf formats (XLIFF since version 1.0) |
-xEXCLUDE, --exclude=EXCLUDE | exclude names matching EXCLUDE from input paths |
-oOUTPUT, --output=OUTPUT | write to OUTPUT in po, pot, xlf formats (XLIFF since version 1.0) |
--psyco=MODE | use psyco to speed up the operation (set mode) |
--search=SEARCHPARTS | searches the given parts (msgid, msgstr, comment, source) |
-I, --ignore-case | ignore case distinctions |
-e, --regexp | use regular expression matching |
-v, --invert-match | select non-matching lines |
--accelerator=ACCELERATOR | ignores the given accelerator when matching |
pogrep --accelerator="_" --search msgid -I -e "software|hardware" only-zu only-zu-check
Search for the words “software” or “hardware” in the msgid field. Ignore case (-I) and treat the underscore (_) character as an accelerator key. Search through all PO files in the directory “only-zu” and place any matches in PO files in the directory “only-zu-check”. This would be useful to run if you know that the word for software and hardware has been changed during the course of translation and you want to check and correct all these instances.
pogrep --search=msgid -e '^\w+(\s+\w+){0,3}$' -i templates -o short-words
Find all messages in the tempalates directory that have between 1 and 4 words and place them in short-words. Use this if you want to see quick results by translating messages that are most likely menu entries or dialogue labels.
pogrep --search=msgstr -I -e "Ifayile" zu zu-check
Search all translations for the occurance of Ifayile. You would use this to check if words have been used correctly. Usefull if you find problematic use of the same word for different concepts. You can use pocompendium to find these conflicts.
We seem to have problems with Unicode from time to time.