Add qps-ploc pseudolocalization support - #158
Conversation
|
[Claude Fable 5] Consulted Devin on 2026-08-21 up to commit |
|
[Claude Fable 5] Consulted Devin on 2026-08-24 up to commit |
|
[Claude Fable 5] Consulted Devin on 2026-08-24 up to commit |
3e71b88 to
0b956b2
Compare
|
[Claude Fable 5] Consulted Devin on 2026-08-24 up to commit |
Lookups for the standard qps-ploc pseudo-locale return the live English
text pseudolocalized at runtime — every vowel doubled with an accent on
the first of the pair, wrapped in brackets ("Title Missing" ->
"[Tîitlée Mîissîing]") — so testers can spot non-internationalized
strings (plain English), truncation (missing "]"), concatenation
(brackets mid-sentence), and layout problems (~30-40% in-word
expansion). Format placeholders ({0}, {0:n0}, named {app_title}-style,
and %0-style) and HTML/XML markup pass through untouched.
- Derived from English at lookup time: no translation files exist, are
loaded, or are written for the pseudo-locale; it never maps to or from
a real language; availability and counts report it exactly as complete
as English.
- Lookups work by simply setting the language code; all lookup funnels
are hooked (static, preferred-languages, dynamic, and the WinForms
paths — both runtime lookups and designer-created controls, whose
component localizers read the string cache directly), transforming
exactly once, with code-supplied English winning over the cache as it
does for "en".
- LocalizationManager.OfferPseudoLocalization (default false) gates only
whether the locale is advertised in language lists; display name is
hard-coded as "Pseudo-English (qps-ploc)".
- LocalizationManager.PseudoLocalize exposes the transform for strings
that bypass L10NSharp.
- Self-contained in src/L10NSharp/Pseudo/ with no new package
dependency; the placeholder-skipping logic is adapted from the
MIT-licensed PseudoLocalizer project (attribution in the folder's
README). 31 tests pin the transform and lookup semantics.
Smoke-tested end to end in Bloom (WinForms chrome incl. designer-created
dialogs, React UI, live placeholder substitution; no pseudo files
written).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
303b495 to
23cd79b
Compare
Problem
Applications built on L10NSharp have no good way for testers to verify internationalization. Hard-coded (non-localizable) strings, clipped layouts, broken format placeholders, and runtime string concatenation are invisible in an English UI and only surface after real translations arrive.
Fix
This PR adds the industry-standard qps-ploc pseudo-locale. Any lookup for language
qps-plocreturns the live English text pseudolocalized — every vowel doubled with an accent on the first of the pair for ~30-40% in-word expansion, all wrapped in brackets (e.g.Title Missing→[Tîitlée Mîissîing]) — with format placeholders ({0},{0:n0}, named{app_title}-style, and%0-style) and HTML/XML tags passed through untouched. Plain English on screen then means a hard-coded string; a missing]means truncation; brackets mid-sentence mean concatenation.SetUILanguage("qps-ploc")or a per-call language list); all the lookup funnels (static, preferred-languages, dynamic, and the WinForms paths — both runtime lookups and designer-created controls, whose localizers read the string cache directly) are hooked, and the transform is applied exactly once. The code-supplied English wins over the cache, mirroring the existingenrule.LocalizationManager.OfferPseudoLocalization(default false) gates only whether it is advertised inGetAvailableLocalizedLanguages()/GetUILanguages(), so end users never see the test locale unless the app opts in (e.g. alpha channels). Display name is hard-coded as "Pseudo-English (qps-ploc)".src/L10NSharp/Pseudo/silo and adds no package dependency. The vowel-doubling style follows Mozilla’s pseudolocalization approach, chosen for readability after trying several styles live in Bloom; the MIT-licensed PseudoLocalizer project was the starting point, and its adapted placeholder/markup-skipping logic remains (attribution in the silo’s README).LocalizationManager.PseudoLocalize(string)exposes the transform for strings that bypass L10NSharp.Additive only — no behavior change for consumers that never request qps-ploc. 31 new tests pin the transform behaviors and the lookup/gating semantics.
Devin review
This change is