fix(thread): pass i18n values via correct prop name (#6141)#6175
Open
Zeffut wants to merge 1 commit into
Open
Conversation
ConversationThread used :message-values="..." which doesn't match any
declared prop on IntlFormatted (it declares values, camelCase). The
{projectTitle} placeholder inside the <project-title> slot was therefore
undefined, causing intl-messageformat to throw and the catch branch to
return the raw message with literal <project-title>...</project-title>
tags rendered on screen.
Fix: rename :message-values to :values. All other IntlFormatted callers
in the monorepo already use :values; this was the only outlier.
Closes modrinth#6141.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
Pull request changelogAppAddedChangedDeprecatedRemovedFixedSecurityWebsiteAddedChangedDeprecatedRemovedFixedSecurityHostingAddedChangedDeprecatedRemovedFixedSecurity |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the project resubmission modal description rendering literal <project-title>{projectTitle}</project-title> text by passing ICU interpolation values to IntlFormatted via the correct prop name (values), aligning with the IntlFormatted component API and existing usage elsewhere.
Changes:
- Update
ConversationThread.vueto bind i18n interpolation data with:values(instead of the non-existent:message-values) forIntlFormatted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #6141. The project resubmission modal was rendering literal
<project-title>{projectTitle}</project-title>text instead of the project name.Root cause
packages/ui/src/components/base/IntlFormatted.vuedeclares its value-binding prop asvalues(camelCase). The callerapps/frontend/src/components/ui/thread/ConversationThread.vuewas passing values under a non-existent prop name:Because
:message-valuesdoes not bind to any declared prop,props.valueswasundefinedinsideIntlFormatted. The<project-title>slot handler was still registered, but the inner{projectTitle}placeholder had no value, sointl-messageformatthrewThe intl string context variable "projectTitle" was not provided. Thecatchbranch returned the raw message and Vue rendered the literal tags shown in the issue screenshot.Fix
Single-line change: rename
:message-valuesto:valuesinConversationThread.vue. All other<IntlFormatted>callers in the monorepo (e.g.apps/frontend/src/pages/auth/authorize.vue,apps/app-frontend/src/components/ui/modal/ModpackAlreadyInstalledModal.vue) already use the canonical:values=binding; this file was the only outlier.The translations themselves are correct in all 13 locales that define this key; no translation changes are needed.
Test plan
<project title>to be reviewed again by the moderators." with the real project title (and the title styled via the slot template).intl-messageformatabout a missing context variable.Closes #6141.