Ask the language chooser, not LibPalaso, whether a sign language name is custom (BL-16760) - #8238
Ask the language chooser, not LibPalaso, whether a sign language name is custom (BL-16760)#8238andrew-polk wants to merge 1 commit into
Conversation
|
| Filename | Overview |
|---|---|
| src/BloomExe/web/controllers/LanguageChangeEventArgs.cs | Clarifies the existing IsCustomName contract without changing its implementation. |
| src/BloomExe/web/controllers/PublishApi.cs | Aligns Publish sign-language persistence with the chooser contract and existing Collection Settings handlers. |
| src/BloomTests/web/controllers/LanguageChangeEventArgsTests.cs | Replaces divergence-pinning coverage with regression cases for untouched and deliberately customized mzc names. |
Reviews (2): Last reviewed commit: "Ask the language chooser, not LibPalaso,..." | Re-trigger Greptile
|
[Claude Opus 5] Consulted Devin on 2026-08-26 up to commit |
a954e61 to
7a195de
Compare
b4ff503 to
02011dc
Compare
02011dc to
a5cbae8
Compare
|
[Claude Opus 5] Consulted Devin on 2026-08-26 up to commit |
a5cbae8 to
d6a7c9b
Compare
… is custom (BL-16760) Choosing a sign language from the Publish tab recorded the language's own name in the collection settings as though the user had typed it. PublishApi decided this by setting the writing system's Tag -- whose setter derives Name through LibPalaso -- and then comparing that derived name against the chooser's DesiredName. That predates the new language chooser: when this code was written LanguageChangeEventArgs had no DefaultName to compare against, and be89265 carried the workaround across verbatim. LibPalaso and the chooser do not always agree; for mzc, LibPalaso says "Madagascar Sign Language" and the chooser says "Malagasy Sign Language", so an untouched name came out custom. Use args.IsCustomName, which compares only the two names the chooser sent, as all four Collection Settings sites already do. Verified in a running Bloom: picking Malagasy Sign Language from the Publish tab now writes SignLanguageIsCustomName=false, and typing "Madagascar Sign Language" over it writes true (that one used to come out false). LanguageChangeEventArgsTests' PublishApiRule_AndIsCustomName_CanDisagreeForTheSameSelection existed so this unification could not happen silently; it is replaced by two tests that pin the agreed answer in both directions, using the real mzc names. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
d6a7c9b to
0932145
Compare
Problem
Choosing a sign language from the Publish tab can record the language's own name in the
collection settings as though the user had typed a custom name for it. Choosing the very same
language from Collection Settings records it correctly.
SignLanguageIsCustomNameis Bloom'srecord of "the user deliberately gave this language this name, so never replace it with a
looked-up one", so setting it when nothing was typed is simply wrong data. The error also runs the
other way: a name the user really did type is recorded as not custom whenever it happens to
match LibPalaso's name for the tag.
Cause
PublishApidecided the question by setting the writing system'sTag— whose setter derivesNamethrough LibPalaso — and then comparing that derived name against the chooser'sDesiredName. That predates the new language chooser: when the code was writtenLanguageChangeEventArgshad noDefaultNameto compare against, andbe892652bcarried theworkaround across verbatim. LibPalaso and the chooser do not always agree; for
mzcLibPalasosays "Madagascar Sign Language" and the chooser says "Malagasy Sign Language".
Fix
PublishApi's sign-language handler now asksargs.IsCustomName, which compares only the twonames the chooser itself sent — the same rule all four Collection Settings sites already use.
<remarks>onLanguageChangeEventArgs.IsCustomNameno longer describe the divergence asintentional; it now says this is the only rule a caller should use, and why.
LanguageChangeEventArgsTestsloses the test that deliberately pinned the divergence and gainstwo that pin the agreed answer in both directions, using the real
mzcnames.Verified in a running Bloom: picking Malagasy Sign Language from the Publish tab now writes
SignLanguageIsCustomName=false, and typing "Madagascar Sign Language" over it writestrue(that case used to come out
false).(Depends on
LanguageChangeEventArgs.IsCustomNamefrom #8236, now cherry-picked ontoVersion6.5, so this is a single commit on top of it.)Ref: https://issues.bloomlibrary.org/youtrack/issue/BL-16760
Devin review
This change is