Skip to content

refactor: modernize format-po-gettext#2428

Merged
andrii-bodnar merged 7 commits intonextfrom
refactor/po-gettext
Feb 2, 2026
Merged

refactor: modernize format-po-gettext#2428
andrii-bodnar merged 7 commits intonextfrom
refactor/po-gettext

Conversation

@timofei-iatsenko
Copy link
Collaborator

@timofei-iatsenko timofei-iatsenko commented Jan 30, 2026

Description

This PR enables the TypeScript strict: true option and fixes all issues introduced by this change.

I also removed the node-gettext package, which we previously used to obtain gettext plural formulas, and replaced it with a static JSON file generated using the gettext/Languages project.

I added a github workflow, which should check for the updates in CLDR once a month and create a PR. I tested with pull_request trigger before switching to cron.

Since the generated JSON also contains plural samples and case names (one, few, many, etc.), I was able to remove the cldr-core and plurals-cldr packages and simplify the “generate samples” implementation.

Additionally, I extracted some utilities whose implementations I wasn’t fully confident in and covered them with their own set of tests.

There is still room for improvement, but this should be good enough for now.

This PR introduces no breaking changes; the functionality remains the same.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Examples update

Fixes # (issue)

Checklist

  • I have read the CONTRIBUTING and CODE_OF_CONDUCT docs
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
js-lingui Ready Ready Preview Jan 30, 2026 4:24pm

Request Review

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

size-limit report 📦

Path Size
packages/core/dist/index.mjs 1.77 KB (0%)
packages/detect-locale/dist/index.mjs 618 B (0%)
packages/react/dist/index.mjs 1.21 KB (0%)

@timofei-iatsenko timofei-iatsenko changed the title Refactor/po gettext refactor: modernize format-po-gettext Jan 30, 2026
"esModuleInterop": true,
"stripInternal": true,
"noUnusedLocals": true,
"resolveJsonModule": true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is intentional, i don't want typescript to read and analyze big json files, it's slows it down

@timofei-iatsenko timofei-iatsenko marked this pull request as ready for review January 30, 2026 10:44
Co-authored-by: Andrii Bodnar <andrii.bodnar@crowdin.com>
@andrii-bodnar andrii-bodnar merged commit e3b0993 into next Feb 2, 2026
7 checks passed
@andrii-bodnar andrii-bodnar deleted the refactor/po-gettext branch February 2, 2026 08:28
@andrii-bodnar andrii-bodnar added this to the v6 milestone Feb 2, 2026
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.

2 participants