-
Notifications
You must be signed in to change notification settings - Fork 11.6k
fix: translate location dropdown group labels and options in event-type settings #26784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: translate location dropdown group labels and options in event-type settings #26784
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
For team event types, the current user might not be in eventType.users, causing translations to default to English. This fix queries the user's locale directly from the database when not found in the event type users. Co-Authored-By: [email protected] <[email protected]>
Per PR feedback, pass the authenticated user's locale as an optional parameter to getEventTypeById instead of making an extra database call. The locale is passed from ctx.user.locale in the tRPC handler. Co-Authored-By: [email protected] <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 7 files
E2E results are ready! |
| isTrpcCall?: boolean; | ||
| isUserOrganizationAdmin: boolean; | ||
| currentOrganizationId: number | null; | ||
| userLocale?: string | null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this optional and nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set the default locale to 'en'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not required, comes from authenticated user
What does this PR do?
Fixes the location dropdown group labels not being translated in event-type settings. The group labels like "Conferencing", "in person", and "Other" were showing in English even when the UI was set to French.
Root cause #1: The category value
"in person"(with space) didn't match any translation key. The translation functiont("in person")was returning the key itself instead of the translated value.Fix #1: Changed the category value from
"in person"to"in_person_category"and added the corresponding translation keys for English and French.Root cause #2: For team/round-robin event types, the current user might not be in
eventType.users, causingcurrentUser?.localeto beundefinedand defaulting to English ("en").Fix #2: Added an optional
userLocaleparameter togetEventTypeByIdand pass the authenticated user's locale fromctx.user.localein the tRPC handler.Updates since last revision
ctx.user.localeVisual Demo
Before (from user's screenshot - group labels not translated):

After: Group labels and location options should now display in the user's locale (e.g., "En personne" in French).

Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
Test 1: Regular event types
Test 2: Team/Round-robin event types
Checklist
Human Review Checklist
@ts-ignore→@ts-expect-error) are from biome linting and are safe