Skip to content

Add gettext .po/.pot dictionary support#178

Merged
yanthomasdev merged 2 commits into
lunariajs:v1from
ascorbic:po-dictionary-support
Apr 11, 2026
Merged

Add gettext .po/.pot dictionary support#178
yanthomasdev merged 2 commits into
lunariajs:v1from
ascorbic:po-dictionary-support

Conversation

@ascorbic
Copy link
Copy Markdown

Description (required)

Adds support for gettext .po and .pot files as a dictionary format, allowing Lunaria to track translation completeness for projects using the gettext toolchain.

How it works:

  • .pot (template) files emit all msgids as keys, so they work as source dictionaries
  • .po (locale) files only emit entries with non-empty, non-fuzzy translations — untranslated and fuzzy entries are correctly reported as missing keys
  • msgctxt maps to nested dictionary keys; entries without context stay at the top level
  • Plural entries require all msgstr[n] forms to be non-empty to count as translated

Uses the gettext-parser package for parsing.

Related issues & labels (optional)

  • Suggested label: feat

Parse .po and .pot files as dictionaries for translation tracking.
Source .pot templates emit all msgids as keys; locale .po files
only emit entries with non-empty, non-fuzzy translations. Contexts
map to nested dictionary keys.
@github-actions github-actions Bot added the core Changes to the @lunariajs/core package label Apr 11, 2026
Copy link
Copy Markdown
Member

@yanthomasdev yanthomasdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yanthomasdev yanthomasdev merged commit 83617cc into lunariajs:v1 Apr 11, 2026
1 of 3 checks passed
ascorbic added a commit to emdash-cms/emdash that referenced this pull request Apr 11, 2026
Configure Lunaria to track PO files directly using dictionary mode
(via lunariajs/lunaria#178). Add Spanish as first translation locale.

- Add lunaria.config.json with PO dictionary tracking
- Add Spanish locale to Lingui config and extract empty catalog
- Add locale:extract and locale:compile scripts to root
ascorbic added a commit to emdash-cms/emdash that referenced this pull request Apr 11, 2026
* Add Lunaria translation tracking with PO dictionary support

Configure Lunaria to track PO files directly using dictionary mode
(via lunariajs/lunaria#178). Add Spanish as first translation locale.

- Add lunaria.config.json with PO dictionary tracking
- Add Spanish locale to Lingui config and extract empty catalog
- Add locale:extract and locale:compile scripts to root

* Switch Lunaria config to TypeScript with defineConfig

* Fix Lunaria config: include only source file, not all PO files

* Add translation status dashboard deployable to i18n.emdashcms.com

Static HTML dashboard generated from Lunaria, deployed as Cloudflare
Workers static assets. Shows per-locale completion with progress bars,
missing keys, and GitHub edit links.

* Move Lunaria build/deploy scripts into i18n/ package

* Add Lunaria GitHub Action for PR translation impact comments

* Add i18n workspace package, update lockfile

* style: format

* Replace Spanish with German as first translation locale

* fix ts

* style: format

* Add wrangler

---------

Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
fmhall pushed a commit to fmhall/emdash that referenced this pull request Apr 13, 2026
* Add Lunaria translation tracking with PO dictionary support

Configure Lunaria to track PO files directly using dictionary mode
(via lunariajs/lunaria#178). Add Spanish as first translation locale.

- Add lunaria.config.json with PO dictionary tracking
- Add Spanish locale to Lingui config and extract empty catalog
- Add locale:extract and locale:compile scripts to root

* Switch Lunaria config to TypeScript with defineConfig

* Fix Lunaria config: include only source file, not all PO files

* Add translation status dashboard deployable to i18n.emdashcms.com

Static HTML dashboard generated from Lunaria, deployed as Cloudflare
Workers static assets. Shows per-locale completion with progress bars,
missing keys, and GitHub edit links.

* Move Lunaria build/deploy scripts into i18n/ package

* Add Lunaria GitHub Action for PR translation impact comments

* Add i18n workspace package, update lockfile

* style: format

* Replace Spanish with German as first translation locale

* fix ts

* style: format

* Add wrangler

---------

Co-authored-by: emdashbot[bot] <emdashbot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Changes to the @lunariajs/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants