Skip to content

fix: Prevent Chrome Translate from corrupting Tibetan unit titles - #16

Merged
choeying-10 merged 1 commit into
wbc-ulmo1-stagefrom
fix/tibetan-unit-title-chrome-translate
Aug 11, 2026
Merged

fix: Prevent Chrome Translate from corrupting Tibetan unit titles#16
choeying-10 merged 1 commit into
wbc-ulmo1-stagefrom
fix/tibetan-unit-title-chrome-translate

Conversation

@choeying-10

Copy link
Copy Markdown

Summary

  • Chrome Translate to Chinese (Traditional) corrupts Tibetan complex-script shaping in the unit header title. Account language (zh_HK) is unrelated.
  • Detect Tibetan characters (U+0F00–U+0FFF) in unit.title and, only then, mark the unit <h3> with notranslate, translate="no", and lang="bo" so Chrome skips translating that heading.
  • Non-Tibetan titles stay unchanged and remain browser-translatable. App/account i18n is unaffected.

@choeying-10
choeying-10 requested a review from 10kalden August 11, 2026 06:05
@choeying-10 choeying-10 self-assigned this Aug 11, 2026
@choeying-10 choeying-10 changed the title Prevent Chrome Translate from corrupting Tibetan unit titles fix: Prevent Chrome Translate from corrupting Tibetan unit titles Aug 11, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@choeying-10
choeying-10 force-pushed the fix/tibetan-unit-title-chrome-translate branch from f859b7b to 40482d0 Compare August 11, 2026 06:10

@yogeshbhagatcode yogeshbhagatcode left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some test got failed:

Image Can you please check and see if there is anything concerning?

Comment on lines -29 to +37
<h3 className="h3 mb-0">{unit.title}</h3>
<h3
className={hasTibetan ? 'h3 mb-0 notranslate' : 'h3 mb-0'}
{...(hasTibetan ? { lang: 'bo', translate: 'no' } : {})}
>
{unit.title}
</h3>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test with different possible scenarios to make sure this fix can work in all the cases.
And it would be nice if you could list the scenarios that you test.

@choeying-10

Copy link
Copy Markdown
Author

Some test got failed:

Image Can you please check and see if there is anything concerning?

those are test files of older PRs. not related to this current PR.
and to test the solution:

  • first i was checking how the problem happened in the first place. Tried changing language preferences to zh_HK from our own webuddhist platform but nothing made the title error like the one user faced.
  • I tried it in all environments (both staging and production from both admin accounts and learners/users account)
  • later when i tried the googles translate. then the bug appeared for the translation to chinese(traditional)
  • so we fixed that issue and tested out in my local and saw the fix is properly solved.

@choeying-10
choeying-10 merged commit f3cecbf into wbc-ulmo1-stage Aug 11, 2026
3 of 4 checks passed
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.

2 participants