Skip to content

Conversation

@ceolinwill
Copy link

Summary

Fixes PO loader replacing target Language header with source language when pushing translations.

Changes

  • Preserve headers from the target (pullInput) section when compiling updated PO sections in packages/cli/src/cli/loaders/po/index.ts.
  • Add test to reproduce and validate the bug: should preserve existing Language header when pushing translations with metadata in first section in packages/cli/src/cli/loaders/po/index.spec.ts.

Testing

Business logic tests added:

  • Validate that pushing translations preserves an existing Language header when metadata and the first entry are in the same section (exact test: should preserve existing Language header when pushing translations with metadata in first section).
  • Validate that other PO loader behaviors (comment order, multiline folding, context handling) remain unchanged by the fix (covered by existing tests in packages/cli/src/cli/loaders/po/index.spec.ts).
  • All tests pass locally

Visuals

Required for UI/UX changes:

  • Before/after screenshots attached
  • Video demo for interactions (< 30s)

Checklist

  • Changeset added (if version bump needed)
  • Tests cover business logic (not just happy path)
  • No breaking changes (or documented below)

Closes #1661

@ceolinwill ceolinwill changed the title fix: preserve Language header when pushing translations fix(cli): preserve Language header when pushing translations Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI replaces Language value with source language in PO files

1 participant