From 70faa692cc9f7065a8940284b6bff5e9748f840d Mon Sep 17 00:00:00 2001 From: Andrew Polk Date: Thu, 3 Sep 2026 09:33:10 -0700 Subject: [PATCH] Turn on pseudolocalization in the SampleApp L10nSharp gained qps-ploc pseudolocalization support in #158, but nothing in the repo showed it working. Set LocalizationManager.OfferPseudoLocalization in the SampleApp so "Pseudo-English (qps-ploc)" appears in its language combo, and point the CHANGELOG entry at the sample app. The comment on the flag explains what the pseudo-locale is for, and notes one non-obvious consequence: while it is selected, the app's "Get Name Dynamically" demo no longer harvests its string into the English XLIFF, because pseudo lookups return before the collection step. That is intended and documented in Pseudo/README.md, but the sample app is read as documentation, so it belongs where someone trying the demo will see it. No library code changes; only the sample app opts in. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 2 +- src/SampleApp/Program.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ffa55e..8c9a930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added -- [L10NSharp] Added pseudolocalization support: lookups for the standard `qps-ploc` pseudo-locale (`LocalizationManager.PseudoLocalizationLanguageId`) return the English text pseudolocalized at runtime (e.g. `[Tîitlée Mîissîing]`), so testers can spot non-internationalized strings and layout problems. Set `LocalizationManager.OfferPseudoLocalization = true` to include it in the offered UI languages; `LocalizationManager.PseudoLocalize(string)` exposes the transform directly. See `src/L10NSharp/Pseudo/README.md`. +- [L10NSharp] Added pseudolocalization support: lookups for the standard `qps-ploc` pseudo-locale (`LocalizationManager.PseudoLocalizationLanguageId`) return the English text pseudolocalized at runtime (e.g. `[Tîitlée Mîissîing]`), so testers can spot non-internationalized strings and layout problems. Set `LocalizationManager.OfferPseudoLocalization = true` to include it in the offered UI languages; `LocalizationManager.PseudoLocalize(string)` exposes the transform directly. The SampleApp turns this on, so you can see it in action. See `src/L10NSharp/Pseudo/README.md`. ## [10.0.0] - 2026-08-27 diff --git a/src/SampleApp/Program.cs b/src/SampleApp/Program.cs index c722683..bac62f2 100644 --- a/src/SampleApp/Program.cs +++ b/src/SampleApp/Program.cs @@ -65,6 +65,17 @@ private static void SetUpLocalization(bool useAdditionalMethodInfo, bool useTmx) if (useTmx) throw new NotSupportedException("TMX-based localization is no longer supported."); + // Offer the qps-ploc pseudo-locale ("Pseudo-English") in the language lists. + // No translation files exist for it: lookups derive the text from the live + // English at runtime, doubling every vowel and wrapping the result in + // brackets ("Title Missing" -> "[Tîitlée Mîissîing]"), so a tester can spot + // strings that never went through L10NSharp (still plain English), truncation + // (missing "]") and layout that can't cope with longer translations. + // Note that while the pseudo-locale is selected, the "Get Name Dynamically" + // demo below no longer harvests its string into the English XLIFF: pseudo + // lookups return before the collection step. Exercise that demo in English. + LocalizationManager.OfferPseudoLocalization = true; + // Your installer should have a folder where you place the localization files you're shipping with the program var directoryOfInstalledLocFiles = "../../../LocalizationFilesFromInstaller"; Directory.CreateDirectory(directoryOfInstalledLocFiles);