pocount
Count the number of portable object messages
TLDR
Print a colorful table with the translation progress of a file
Print translation progress of various files, one line per file
Generate a CSV file with the translation progress of various files
SYNOPSIS
pocount [OPTION]... [FILE]...
PARAMETERS
-h, --help
Display a help message and exit.
-V, --version
Output version information and exit.
-s, --summary
Print a single summary line for all files instead of detailed counts for each.
-t, --total
Print grand totals for all processed files. This option requires the --summary option to be effective.
-n, --no-headers
Suppress the header lines that typically describe the output columns.
-e, --empty
Count empty translation strings (msgstr "") as untranslated. By default, empty strings might be considered translated if they are not marked fuzzy.
-f, --fuzzy
Count fuzzy entries as untranslated. Fuzzy entries are translations marked as potentially incorrect or needing human review (e.g., automatically translated or marked by a translator for later review).
-U, --untranslated-strings
Explicitly count untranslated strings, including those that are empty or fuzzy, as untranslated.
-T, --translated-strings
Explicitly count non-empty, non-fuzzy strings as translated.
--statistics
This option implies --summary and prints a summary line, similar to --summary.
[FILE]...
One or more PO (Portable Object) files to be processed by pocount. If no files are specified, it typically reads from standard input.
DESCRIPTION
pocount is a command-line utility that is part of the GNU gettext toolset, which is widely used for software internationalization (i18n) and localization (l10n). Its core purpose is to provide statistical insights into PO (Portable Object) files. These files are standard plain text files used by gettext to store translatable strings and their corresponding translations.
When executed, pocount processes one or more specified PO files and outputs a count of the messages found within them. It typically distinguishes between three main categories: total messages, translated messages, and untranslated messages. This functionality is crucial for localization teams to monitor the progress of translation efforts, identify remaining work, and assess the completeness of language packs.
The command offers various options to fine-tune how messages are categorized. For instance, users can specify whether empty translation strings or "fuzzy" entries (translations marked as uncertain, often needing human review) should be considered untranslated. It can present detailed counts for each file, or a consolidated summary line for all processed files, which can include grand totals. This flexibility makes pocount an invaluable tool for managing large-scale translation projects, ensuring that all necessary strings are localized accurately and efficiently. Its simplicity and integration within the gettext ecosystem make it a go-to choice for PO file analysis.
CAVEATS
pocount relies on the correct formatting of PO files. Malformed PO files might lead to unexpected results or errors. The precise definition of "translated" versus "untranslated" messages can be nuanced and is highly dependent on the chosen command-line options such as --empty and --fuzzy. Users must understand how these options categorize messages to accurately interpret the output.
USAGE CONTEXT
pocount is primarily utilized within software development and localization workflows. It's often integrated into automated build scripts or used by localization project managers to assess translation progress, monitor quality, and identify specific language files or strings requiring further translation effort. Its output can be used to generate reports or integrate with project management dashboards.
PO FILE STRUCTURE
PO (Portable Object) files are plain text files that typically contain original source strings (marked by msgid) and their corresponding translated strings (marked by msgstr). These files can also include various forms of comments, context indicators, and flags such as 'fuzzy', which pocount interprets when calculating its counts based on the supplied options.
HISTORY
pocount is an integral part of the GNU gettext project, which was originally conceived at Sun Microsystems in the early 1990s and later adopted and extensively developed by the GNU Project. gettext rapidly became the de facto standard for internationalization in free and open-source software. pocount specifically emerged as a valuable tool within this ecosystem to help manage the increasing complexity of translation projects. It provides a quick and automated overview of translation completeness, eliminating the need for manual parsing of PO files. Its development closely tracks the evolution of the broader gettext suite, ensuring continued compatibility and utility for modern localization workflows.