@fuibox/po
v1.0.0
Published
Extract untranslated entries from PO files
Downloads
209
Readme
po
🔍 A simple CLI tool to extract untranslated entries from PO (Portable Object) files.
Installation
Local Installation (Recommended)
npm install -D poUsage
Basic Usage
# Check all .po files
po "**/*.po"
# Check specific directory
po "src/locales/**/*.po"
# Check single file
po "locales/zh/messages.po"Options
Default: Full PO Format
Shows complete PO entries with references, msgid, and msgstr.
po "src/locales/**/*.po"Output:
============================================================
📁 File: src/locales/zh/messages.po
📊 Found 2 untranslated entries
============================================================
#: xxx:68
msgid "Value:"
msgstr ""
#: xxx:80
msgid "NFT Member:"
msgstr ""--text: Text Only
Shows only the untranslated text content.
po "src/locales/**/*.po" --textOutput:
============================================================
📁 File: src/locales/zh/messages.po
📊 Found 2 untranslated entries
============================================================
Value:
NFT Member:-s, --summary: Summary Only
Shows only file paths and counts.
po "src/locales/**/*.po" -sOutput:
📁 src/locales/zh/messages.po: 2 untranslated
📁 src/locales/ja/messages.po: 5 untranslatedUsage with npm scripts
Add to your package.json:
{
"scripts": {
"check:i18n": "po 'src/locales/**/*.po'",
"check:i18n:text": "po 'src/locales/**/*.po' --text",
"check:i18n:summary": "po 'src/locales/**/*.po' -s"
},
"devDependencies": {
"@fuibox/po": "^1.0.0"
}
}Then run:
npm run check:i18nUsage with npx (No Installation Required)
npx @fuibox/po "src/locales/**/*.po"
npx po "**/*.po" --textExamples
Check all locales
po "locales/**/*.po"Check specific language
po "locales/zh-CN/messages.po" --textCheck and save to file
po "src/locales/**/*.po" > untranslated.txt
po "src/locales/**/*.po" --text > untranslated-text.txtUse in CI/CD
# .github/workflows/check-i18n.yml
name: Check Translations
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install -g po
- run: po "src/locales/**/*.po" -sOptions Summary
| Option | Description | Output |
|--------|-------------|--------|
| (default) | Full PO format | Complete entries with references |
| --text | Text content only | Just the msgid values |
| -s, --summary | Summary only | File paths and counts |
Help
po --helpor simply:
poLicense
MIT
Keywords
- po
- lingui
Repository
[GitHub Repository URL]
Bugs
[GitHub Issues URL]
Author
Your Name
