Skip to content

Offer "Pseudo-English" (qps-ploc) as a UI language for i18n testing (BL-16748) - #8283

Open
andrew-polk wants to merge 1 commit into
masterfrom
BL-16748-pseudo-english
Open

Offer "Pseudo-English" (qps-ploc) as a UI language for i18n testing (BL-16748)#8283
andrew-polk wants to merge 1 commit into
masterfrom
BL-16748-pseudo-english

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Problem

We have no way to see which of Bloom's on-screen strings actually go through localization. A string someone hard-coded, a placeholder that got mangled, a label the layout clips once it grows — all of it looks perfectly fine in English, and only surfaces when a translator or a user in another language hits it.

What the PR does

On the developer and alpha channels, the UI Language menu now offers Pseudo-English (i18n test). L10NSharp 10.1.0-beta0001 pseudolocalizes every lookup for the standard qps-ploc pseudo-locale by transforming the live English at lookup time — each vowel doubled and accented, the whole string bracketed, so Title Missing becomes [Tîitlée Mîissîing]. A tester can then read the problems straight off the screen: plain English means the string was never internationalized, a visible {0} or %0 means a broken placeholder, a missing ] means truncation, brackets mid-sentence mean the sentence is concatenated at runtime, and clipped layout means we can't cope with the ~30–40% growth real translations bring. No qps-* translation files exist or are ever written.

  • Program.SetUpLocalization turns the locale on for the developer and alpha channels only, and GetDesiredUiLanguage refuses a stored qps-ploc on a channel that doesn't offer it — otherwise a setting carried over from an alpha would leave a release user with a mangled UI and no menu entry to escape it.
  • WorkspaceView names the locale itself (Palaso's language-name lookup has nothing useful to say about a pseudo-locale) and puts it last in the menu rather than sorting it among real languages.
  • I18NApi pseudolocalizes the English fallback it returns for ids that aren't in the English XLIFF. Without this those come back as plain English and are indistinguishable from hard-coded text, which defeats the exercise.
  • The locale is excluded from the two places where the list of available localizations feeds book data rather than the UI: the pre-translated content TranslationGroupManager writes into a new book, and the hint-bubble language chooser.
  • DistFiles/localization/README.md documents that the locale is runtime-derived, that no qps-* XLF should ever exist, and which surfaces stay plain English on purpose (the whole-file localizations — template readmes, help pages, xmatter descriptions) so the tester's rule stays exact.
  • Bloom's workspace tabs carry a data-workspace-tab attribute so automation can find them without matching the visible English label, which breaks under this locale and under any real localization.

Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16748

Devin review


This change is Reviewable

@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds the L10NSharp qps-ploc pseudo-locale as a developer/alpha-only UI language for finding internationalization and layout defects.

  • Gates pseudo-localization by release channel and normalizes carried-over settings to English on unsupported channels.
  • Adds pseudo-locale naming, menu placement, and fallback-string transformation.
  • Excludes the pseudo-locale from book-content translation generation and hint-language authoring.
  • Adds language-independent workspace-tab automation selectors, documentation, and focused tests.

Important Files Changed

Filename Overview
src/BloomExe/Program.cs Configures pseudo-localization before localization-manager initialization and safely falls back to English on channels where it is unavailable.
src/BloomExe/Workspace/WorkspaceView.cs Adds a stable pseudo-locale label and places it last in the language menu while preserving existing selection behavior.
src/BloomExe/web/I18NApi.cs Applies pseudo-localization to English fallback responses that bypass normal L10NSharp lookups, while excluding numeric IDs.
src/BloomExe/Book/TranslationGroupManager.cs Prevents the testing-only pseudo-locale from generating persisted translated content in books.
src/BloomExe/web/controllers/CommonApi.cs Excludes qps-ploc from the language chooser used to author persistent hint content.
src/BloomBrowserUI/react_components/TopBar/TopBar.tsx Adds a stable language-independent data attribute to workspace tabs for automation.
.github/skills/bloom-automation/switchWorkspaceTab.mjs Prefers the new stable workspace-tab selector while retaining legacy label-based fallbacks.
src/BloomTests/Workspace/PseudoLocalizationTests.cs Covers pseudo-locale naming/completeness and non-development channel gating, though not the I18N fallback branches.
src/BloomExe/BloomExe.csproj Upgrades L10NSharp to the beta version providing runtime pseudo-localization support.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." | Re-trigger Greptile

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5 (1M context) during preflight] Consulted Devin on 2026-09-02 18:29 UTC up to commit c64f5ade54ef2a5c3c2a23bc14a8d658319b37d7.

Clean: no bugs, no Investigate flags, no informational items. Nothing to mirror.

…BL-16748)

We have no way to see which of Bloom's on-screen strings actually go
through localization. A string someone hard-coded, a placeholder that got
mangled, a label the layout clips once it grows -- all of it looks fine in
English, and only surfaces when a translator or a user in another
language hits it.

So on the developer and alpha channels the UI Language menu now offers
"Pseudo-English (i18n test)". L10NSharp 10.1.0-beta0001 pseudolocalizes
every lookup for the standard qps-ploc pseudo-locale, transforming the
live English at lookup time -- each vowel doubled and accented, the whole
string bracketed, so "Title Missing" becomes "[Tîitlée Mîissîing]". A
tester then reads the problems straight off the screen: plain English
means the string was never internationalized, a visible {0} or %0 means a
broken placeholder, a missing "]" means truncation, brackets mid-sentence
mean the sentence is concatenated at runtime, and clipped layout means we
cannot cope with the ~30-40% growth real translations bring. No qps-*
translation files exist or are ever written.

- Program.SetUpLocalization turns the locale on for the developer and
  alpha channels only, and GetDesiredUiLanguage refuses a stored qps-ploc
  on a channel that does not offer it -- otherwise a setting carried over
  from an alpha would leave a release user with a mangled UI and no menu
  entry to escape it.
- WorkspaceView names the locale itself (Palaso's language-name lookup
  has nothing useful to say about a pseudo-locale) and puts it last in the
  menu rather than sorting it among real languages.
- I18NApi pseudolocalizes the English fallback it returns for ids that are
  not in the English XLIFF. Without this those come back as plain English
  and are indistinguishable from hard-coded text, which defeats the
  exercise.
- The locale is excluded from the two places where the list of available
  localizations feeds *book data* rather than the UI: the pre-translated
  content TranslationGroupManager writes into a new book, and the
  hint-bubble language chooser.
- DistFiles/localization/README.md documents that the locale is
  runtime-derived, that no qps-* XLF should ever exist, and which surfaces
  stay plain English on purpose (the whole-file localizations -- template
  readmes, help pages, xmatter descriptions) so the tester's rule stays
  exact.
- Bloom's workspace tabs carry a data-workspace-tab attribute so
  automation can find them without matching the visible English label,
  which breaks under this locale and under any real localization.

Verified end to end in a running Bloom against the released package: the
menu entry, the WinForms chrome and dialogs, the React UI, template and
page labels, the toolbox and hint bubbles all transform, while book
content, book titles, the collection name and language data stay plain.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@andrew-polk
andrew-polk force-pushed the BL-16748-pseudo-english branch from c64f5ad to a436f8e Compare September 2, 2026 22:15
@andrew-polk
andrew-polk marked this pull request as ready for review September 2, 2026 22:16
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.

1 participant