Skip to content

Fix Traditional Chinese label generator crash - #1728

Merged
tankerkiller125 merged 1 commit into
sysadminsmedia:mainfrom
justadityaraj:fix/1684-traditional-chinese-labels
Sep 11, 2026
Merged

tankerkiller125 merged 1 commit into
sysadminsmedia:mainfrom
justadityaraj:fix/1684-traditional-chinese-labels

Conversation

@justadityaraj

@justadityaraj justadityaraj commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • bug

Context

The Traditional Chinese label generator cannot open because the first rich-text tip contains unescaped HTML markup that IntlMessageFormat parses as an invalid ICU tag. Once that parser error is removed, the following bold tip also expects a missing rich-text formatter and fails during formatting.

Changes

  • Escape the anchor and bold tags as literal ICU content, matching the established markup convention used by the other label-generator messages.
  • Add a regression test that formats all three Traditional Chinese label-generator tips.

User impact

Users whose locale is zh-TW can open /reports/label-generator instead of receiving a 500 error. The Avery link and emphasized guidance continue to render as HTML.

Before

Traditional Chinese label generator showing INVALID_TAG

After

Traditional Chinese label generator rendering successfully

Which issue(s) this PR fixes:

Fixes #1684

Verification

  • pnpm exec vitest --run --config ./test/vitest.config.ts locales/zh-TW.test.ts --no-file-parallelism — passes (1 test).
  • pnpm run lint:ci and pnpm run lint:fix — pass.
  • pnpm run build — passes and prerenders the label-generator route.
  • task go:lint — passes with 0 issues.
  • task swag --force plus TypeScript API generation — pass with no generated diff.
  • Built and ran Homebox locally in demo mode, logged in with a Chromium context configured for zh-TW, and verified the report renders with one functional Avery link.
  • pnpm exec nuxi typecheck --noEmit — still reports the existing type errors present on current main; none point to the changed locale or test.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8ace43bc-8b50-49ab-93b1-7dd2083bbaca

📥 Commits

Reviewing files that changed from the base of the PR and between 21b3975 and 465489b.

📒 Files selected for processing (2)
  • frontend/locales/zh-TW.json
  • frontend/locales/zh-TW.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Summary by CodeRabbit

  • Bug Fixes

    • Corrected formatting for embedded links and emphasized text in Traditional Chinese label-generator tips.
  • Tests

    • Added validation to ensure Traditional Chinese label-generator tips parse and display correctly.

Walkthrough

The Traditional Chinese label-generator tips now escape embedded HTML tags correctly. A Vitest test validates that three tips parse with IntlMessageFormat using the zh-TW locale.

Changes

Traditional Chinese label-generator messages

Layer / File(s) Summary
Escape and validate label-generator tips
frontend/locales/zh-TW.json, frontend/locales/zh-TW.test.ts
tip_1 and tip_2 now quote embedded HTML tags for i18n escaping. The test validates parsing for three label-generator tips.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 46548

Traditional Chinese users can open the label generator without ICU tag parsing failures while the link and emphasized guidance continue to render as intended. The targeted message parsing coverage supports merge readiness.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the fix for the Traditional Chinese label generator crash, which is the main change in the pull request.
Description check ✅ Passed The description identifies the bug, explains the implementation, states user impact, references issue #1684, and documents verification steps. The Verification section provides the required testing in…
Linked Issues check ✅ Passed The changes address issue #1684 by escaping the invalid ICU markup in the Traditional Chinese label-generator messages and adding a regression test for all three tips. The stated user outcome is suppo…
Out of Scope Changes check ✅ Passed The pull request changes only the affected Traditional Chinese locale strings and adds targeted regression coverage. These changes are directly related to issue #1684. No unrelated or security-sensiti…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Tags now rest inside quoted light
Chinese tips parse clean and bright
ICU finds a steady way
Tests keep errors far away
Labels bloom without delay

Comment @coderabbitai help to get the list of available commands.

@tankerkiller125
tankerkiller125 merged commit 0ad87b3 into sysadminsmedia:main Sep 11, 2026
21 of 22 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.

/reports/label-generator returns "500. INVALID_TAG" when browser language is Traditional Chinese

2 participants