Skip to content

fix(no-single-variables-to-translate): allow top-level calls to plural/select/selectOrdinal#133

Merged
andrii-bodnar merged 2 commits into
lingui:mainfrom
jtbandes:fix-toplevel-plural
Jun 5, 2026
Merged

fix(no-single-variables-to-translate): allow top-level calls to plural/select/selectOrdinal#133
andrii-bodnar merged 2 commits into
lingui:mainfrom
jtbandes:fix-toplevel-plural

Conversation

@jtbandes

Copy link
Copy Markdown
Contributor

Fixes #126

This PR updates the no-single-variables-to-translate logic to explicitly allow syntax like msg`${plural(...)}`, which seems to be the recommended way to do plural messages with a custom i18n instance (outside of JSX), according to this discussion: lingui/js-lingui#1312 (comment)

@jtbandes

jtbandes commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Hi @timofei-iatsenko, any interest in this patch?

@jtbandes jtbandes force-pushed the fix-toplevel-plural branch from c548c5f to b72abf3 Compare May 6, 2026 06:46
@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.13%. Comparing base (05d7ae4) to head (b72abf3).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #133      +/-   ##
==========================================
+ Coverage   98.11%   98.13%   +0.02%     
==========================================
  Files          13       13              
  Lines         636      643       +7     
  Branches      214      220       +6     
==========================================
+ Hits          624      631       +7     
  Misses         12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@andrii-bodnar andrii-bodnar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me, thanks for the contribution!

@timofei-iatsenko WDYT?

@jtbandes

jtbandes commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Friendly bump :)

@andrii-bodnar andrii-bodnar merged commit 8577e5c into lingui:main Jun 5, 2026
4 checks passed
@jtbandes jtbandes deleted the fix-toplevel-plural branch June 5, 2026 18:03
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.

no-single-variables-to-translate warns about plural() used inside t or msg

2 participants