fix: preserve user-customized object/field names across locale changes#19067
Closed
jnMetaCode wants to merge 1 commit intotwentyhq:mainfrom
Closed
fix: preserve user-customized object/field names across locale changes#19067jnMetaCode wants to merge 1 commit intotwentyhq:mainfrom
jnMetaCode wants to merge 1 commit intotwentyhq:mainfrom
Conversation
User-customized names (stored as direct standardOverrides) were being overridden by i18n translations when switching UI language. This changes the priority order so direct overrides always take precedence over locale-specific translations and auto i18n translations. For field metadata, the direct override was previously only applied when locale matched SOURCE_LOCALE (English), meaning customizations were completely ignored in non-English locales. Fixes twentyhq#18950
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Contributor
Welcome!
Hello there, congrats on your first PR! We're excited to have you contributing to this project. |
Author
|
Closing this PR. Apologies for the noise — I'll take more care to ensure quality and proper testing before submitting future contributions. |
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
standardOverrides(user customizations) always take precedence over locale-specific translations and auto i18n translationsSOURCE_LOCALE-only restriction that was preventing customizations from being applied in non-English localesRoot Cause
In
resolveObjectMetadataStandardOverrideandresolveFieldMetadataStandardOverride, the priority order was:standardOverrides.translations[locale](locale-specific translations)standardOverrides[labelKey](user customizations)For field metadata, the direct override check (step 2) was additionally gated behind
locale === SOURCE_LOCALE, meaning user customizations were completely ignored in non-English locales.The fix reorders the priority to:
standardOverrides[labelKey](user customizations)standardOverrides.translations[locale](locale-specific translations)This ensures that when a user renames "Company" to "ASTF", that name persists regardless of the active UI locale.
Test plan
resolve-object-metadata-standard-override.util.spec.tsresolve-field-metadata-standard-override.util.spec.tsFixes #18950