Skip to content

feat: add pseudolocalize options#2583

Open
ThibaultJanBeyer wants to merge 1 commit into
lingui:mainfrom
ThibaultJanBeyer:2582-pass-extend
Open

feat: add pseudolocalize options#2583
ThibaultJanBeyer wants to merge 1 commit into
lingui:mainfrom
ThibaultJanBeyer:2582-pass-extend

Conversation

@ThibaultJanBeyer

@ThibaultJanBeyer ThibaultJanBeyer commented Jun 26, 2026

Copy link
Copy Markdown

Description

The current pseudolocalization doesn't allow for padding to catch UI bugs caused by longer languages.
Here is the related issue: #2582

Types of changes

The signature of the pseudoLocale can now look either like this:

// before
export default defineConfig({
  locales: ['en', 'pseudo'],
  sourceLocale: 'en',
  pseudoLocale: 'pseudo',
  catalogs: [],
})

or like this:

// after
export default defineConfig({
  locales: ['en', 'pseudo'],
  sourceLocale: 'en',
  pseudoLocale: { locale: 'pseudo', prepend: '⟦ ', append: ' ⟧', extend: 0.4 },
  catalogs: [],
})
  • 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 #2582

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)
    (I'm not sure, added it to website/docs/ref/conf.md. Somewhere else to add?

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
js-lingui Ready Ready Preview Jun 26, 2026 10:35am

Request Review

@timofei-iatsenko timofei-iatsenko changed the title add pseudolocalize options feat: add pseudolocalize options Jun 26, 2026
export { makeConfig } from "./makeConfig"
export { defineConfig } from "./defineConfig"
export { getConfig } from "./getConfig"
export { getPseudoLocale, getPseudoLocaleOptions } from "./getPseudoLocale"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i suggest not export that from the package, but instead apply and normalize config in the makeConfig. So all consumers would receive normalized (expanded) option

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.75%. Comparing base (6bb8983) to head (a5215b9).
⚠️ Report is 354 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2583       +/-   ##
===========================================
+ Coverage   77.05%   89.75%   +12.69%     
===========================================
  Files          84      125       +41     
  Lines        2157     3698     +1541     
  Branches      555     1112      +557     
===========================================
+ Hits         1662     3319     +1657     
+ Misses        382      341       -41     
+ Partials      113       38       -75     

☔ View full report in Codecov by Harness.
📢 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.

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.

Pseudolocale options (Simulating DE (+~30%), FI, etc.)

2 participants