Skip to content

Ask the language chooser, not LibPalaso, whether a sign language name is custom (BL-16760) - #8238

Open
andrew-polk wants to merge 1 commit into
Version6.5from
BL-16760-sign-language-custom-name
Open

Ask the language chooser, not LibPalaso, whether a sign language name is custom (BL-16760)#8238
andrew-polk wants to merge 1 commit into
Version6.5from
BL-16760-sign-language-custom-name

Conversation

@andrew-polk

@andrew-polk andrew-polk commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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. SignLanguageIsCustomName is Bloom's
record 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

PublishApi decided the question 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 the code was written
LanguageChangeEventArgs had no DefaultName to compare against, and be892652b 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".

Fix

  • PublishApi's sign-language handler now asks args.IsCustomName, which compares only the two
    names the chooser itself sent — the same rule all four Collection Settings sites already use.
  • The <remarks> on LanguageChangeEventArgs.IsCustomName no longer describe the divergence as
    intentional; it now says this is the only rule a caller should use, and why.
  • LanguageChangeEventArgsTests loses the test that deliberately pinned the divergence and gains
    two that pin the agreed answer in both directions, using the real mzc names.

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 case used to come out false).

(Depends on LanguageChangeEventArgs.IsCustomName from #8236, now cherry-picked onto
Version6.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 Reviewable

@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes the Publish tab use the language chooser’s own custom-name decision instead of recomputing it through LibPalaso.

  • Passes LanguageChangeEventArgs.IsCustomName to the sign-language writing system.
  • Clarifies that chooser-provided default and desired names are authoritative.
  • Adds regression coverage for both directions of the mzc naming disagreement.

Important Files Changed

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

@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5] Consulted Devin on 2026-08-26 up to commit b4ff50359ecc618759d7bb067cc011e493a475c7. Clean: no Bugs and no Investigate flags. One Informational item ("Sign-language handler now matches the dialog") — an observation, not an action item, so not mirrored as a thread.

@andrew-polk
andrew-polk force-pushed the language-chooser-data-mapping-tests branch from a954e61 to 7a195de Compare August 26, 2026 20:39
@andrew-polk
andrew-polk force-pushed the BL-16760-sign-language-custom-name branch from b4ff503 to 02011dc Compare August 26, 2026 20:40
Base automatically changed from language-chooser-data-mapping-tests to master August 26, 2026 21:13
@andrew-polk
andrew-polk force-pushed the BL-16760-sign-language-custom-name branch from 02011dc to a5cbae8 Compare August 26, 2026 21:15
@andrew-polk

Copy link
Copy Markdown
Contributor Author

[Claude Opus 5] Consulted Devin on 2026-08-26 up to commit a5cbae864 (rebased onto master after #8236 merged). Clean: no Bugs and no Investigate flags. One Informational item ("Sign-language handler now matches the dialog") — an observation, not an action item.

@andrew-polk
andrew-polk marked this pull request as ready for review August 26, 2026 21:25
@andrew-polk
andrew-polk changed the base branch from master to Version6.5 August 26, 2026 21:57
@andrew-polk
andrew-polk changed the base branch from Version6.5 to master August 26, 2026 21:57
@andrew-polk
andrew-polk force-pushed the BL-16760-sign-language-custom-name branch from a5cbae8 to d6a7c9b Compare August 26, 2026 22:01
@andrew-polk
andrew-polk changed the base branch from master to Version6.5 August 26, 2026 22:01
… 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>
@andrew-polk
andrew-polk force-pushed the BL-16760-sign-language-custom-name branch from d6a7c9b to 0932145 Compare August 26, 2026 22:06
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