frappe-translations-writer
Translation Helper
File paths
| File | Path |
|---|---|
| POT template | apps/<app>/<app>/locale/main.pot |
| PO translations | apps/<app>/<app>/locale/<locale>.po |
| MO compiled | sites/assets/locale/<locale>/LC_MESSAGES/<app>.mo |
Workflow
PYTHON=/workspace/development/frappe-bench/env/bin/python
SCRIPTS=<skill_dir>/scripts
PO=apps/<app>/<app>/locale/es_PE.po
cd /workspace/development/frappe-bench
# 1. Extract strings from code → update POT
bench generate-pot-file --app <app>
# 2. Merge new strings into PO
bench update-po-files --app <app> --locale es_PE
# 3. Query strings → save to <po_dir>/drafts/es_PE.review.po
$PYTHON $SCRIPTS/po_query.py --po $PO --out es_PE.review.po
# Filter by module: add --path "<module>/**" --out es_PE.module.po
# Only untranslated: add --untranslated --out es_PE.untranslated.po
# Only fuzzy: add --fuzzy --out es_PE.fuzzy.po
# 4. Edit the partial PO — fill in msgstr values
# 5. Merge partial PO back into the full file
$PYTHON $SCRIPTS/po_merge.py --main $PO --patch locale/drafts/es_PE.review.po --dry-run
$PYTHON $SCRIPTS/po_merge.py --main $PO --patch locale/drafts/es_PE.review.po
# 6. Compile PO → MO binary
bench compile-po-to-mo --app <app> --locale es_PE
# 7. Clear cache
bench clear-cache
--siteis only required when--appis omitted.
Command options
| Command | Key options |
|---|---|
generate-pot-file |
--app |
update-po-files |
--app, --locale |
compile-po-to-mo |
--app, --locale, --force |
po_query.py |
--path GLOB (repeatable), --format po|tsv|json, --out (relative → <po_dir>/drafts/, absolute → as-is, omit → stdout); filters: --untranslated, --fuzzy (omit both = all entries) |
po_merge.py |
--dry-run, --clear-fuzzy, --out |
See scripts/po_query.py and scripts/po_merge.py for full usage.
Key rules
- Locale format:
es_PE(underscore), notes-PE - Always regenerate POT before updating PO when code has changed
- Context syntax:
_("text", context="Name")in Python,__("text", { context: "Name" })in JS
Common issues
See REFERENCE.md for validation commands, fuzzy entries, and migration from CSV.
More from kehwar/skills
tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development. Tracks progress in Beads Issue Tracker.
8to-tasks
Break a plan, spec, or PRD into independently-grabbable tasks/issues on Beads Issue Tracker using tracer-bullet vertical slices. Use when user wants to convert a plan into tasks, create implementation tickets, or break down work into tasks.
7grill-with-docs
Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise. Use when user wants to stress-test a plan against their project's language and documented decisions.
4dev-log
Write a development log entry capturing implementation decisions, bug findings, insights, or implementation details. Entries are saved as Markdown files in docs/development-log/. Use when user says "write a dev log", "log this decision", "document this", "write a dev journal entry", "record what happened", or after completing a plan phase, PRD, session, or set of commits.
3write-a-prd
Create a PRD through user interview, codebase exploration, and module design, then save to docs/prd/<name>.md in the repo. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.
3vue
Vue 3 Composition API, script setup macros, reactivity system, and built-in components. Use when writing Vue SFCs, defineProps/defineEmits/defineModel, watchers, or using Transition/Teleport/Suspense/KeepAlive.
3