Files
twenty/packages
Sonarly Claude Code 5bec5c33ff fix: respect standard object label overrides for non-English locales
https://sonarly.com/issue/14771?type=bug

When a user renames a standard object (e.g., "People" → "Contacts"), the custom name is only displayed when the UI language is English. For all other locales, the i18n-translated default name is shown instead, ignoring the user's customization.

Fix: Removed the `safeLocale === SOURCE_LOCALE` / `locale === SOURCE_LOCALE` guard from the direct override check in both `resolveObjectMetadataStandardOverride` and `resolveFieldMetadataStandardOverride`.

Previously, when a user renamed a standard object (e.g., "People" → "Contacts"), the rename was stored in `standardOverrides.labelSingular` but only returned when the locale was English (`SOURCE_LOCALE`). For any other locale, the code skipped the user's override and fell through to the i18n auto-translation of the original default name.

The fix makes the direct override check locale-independent, so user renames are respected regardless of the UI language. The priority order is now:

1. Per-locale translation overrides (`standardOverrides.translations[locale]`) — highest priority, allows per-language customization
2. Direct overrides (`standardOverrides[labelKey]`) — the user's rename, applies to ALL locales
3. i18n auto-translation of the default label — fallback

Also cleaned up the unused `SOURCE_LOCALE` import from the field metadata util, and updated both test files to assert the corrected behavior (direct overrides should be used for non-English locales).
2026-03-14 22:23:34 +00:00
..