Skip to content

Conversation

@ThyMinimalDev
Copy link
Contributor

@ThyMinimalDev ThyMinimalDev commented Jan 13, 2026

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 function t("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, causing currentUser?.locale to be undefined and defaulting to English ("en").

Fix #2: Added an optional userLocale parameter to getEventTypeById and pass the authenticated user's locale from ctx.user.locale in the tRPC handler.

Updates since last revision

Visual Demo

Before (from user's screenshot - group labels not translated):
before

After: Group labels and location options should now display in the user's locale (e.g., "En personne" in French).
Screenshot 2026-01-13 at 10 17 34

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - no documentation changes needed.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Test 1: Regular event types

  1. Set the browser/app language to French
  2. Navigate to a personal event-type settings
  3. Open the location dropdown
  4. Verify the group labels are translated (e.g., "En personne")

Test 2: Team/Round-robin event types

  1. Set the browser/app language to French
  2. Navigate to a team event-type settings (round-robin or collective)
  3. Open the location dropdown
  4. Verify all group labels AND individual location options are translated

Checklist

  • I have read the contributing guide
  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Human Review Checklist

  • Verify the fix works in the preview deployment with French locale for both regular and team event types
  • The formatting changes (import reordering, indentation, @ts-ignore@ts-expect-error) are from biome linting and are safe

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

sean-brydon
sean-brydon previously approved these changes Jan 13, 2026
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]>
@pull-request-size pull-request-size bot added size/M and removed size/L labels Jan 13, 2026
@github-actions github-actions bot added the 🐛 bug Something isn't working label Jan 13, 2026
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 13, 2026
@ThyMinimalDev ThyMinimalDev marked this pull request as ready for review January 13, 2026 08:16
@ThyMinimalDev ThyMinimalDev requested a review from a team as a code owner January 13, 2026 08:17
@graphite-app graphite-app bot added foundation core area: core, team members only labels Jan 13, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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

@github-actions
Copy link
Contributor

E2E results are ready!

@ThyMinimalDev ThyMinimalDev changed the title fix: translate location dropdown group labels in event-type settings fix: translate location dropdown group labels and options in event-type settings Jan 13, 2026
@ThyMinimalDev ThyMinimalDev enabled auto-merge (squash) January 13, 2026 08:39
@ThyMinimalDev ThyMinimalDev added this to the v6.1 milestone Jan 13, 2026
isTrpcCall?: boolean;
isUserOrganizationAdmin: boolean;
currentOrganizationId: number | null;
userLocale?: string | null;
Copy link
Contributor

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?

Copy link
Contributor

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'

Copy link
Contributor Author

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

@vercel vercel bot temporarily deployed to Preview – cal-companion January 13, 2026 10:36 Inactive
@ThyMinimalDev ThyMinimalDev merged commit 0b37520 into main Jan 14, 2026
45 checks passed
@ThyMinimalDev ThyMinimalDev deleted the devin/fix-location-select-translations-1768288430 branch January 14, 2026 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working core area: core, team members only ready-for-e2e size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The getIntegrations function runs repeatedly due to state polling

6 participants