refactor: update i18n keys to match effectiveReason values (#27381)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Eunjae LeeandDevin AI authored and GitHub committed 2026-01-29 14:16:12 +00:00
1 parent 447a0289d6
commit 18049bc1d6
3 files changed
+16 -19

No files matched your search

@@ -55,7 +55,7 @@ function createTeamBlockedWarningFn(
return (feature: NormalizedFeature): string | null => {
const blockingState = blockingStateMap.get(feature.slug);
if (blockingState?.orgState === "disabled") {
return t("feature_blocked_by_org_warning");
return t("feature_org_disabled");
}
return null;
};
@@ -41,22 +41,18 @@ function normalizeUserFeatures(data: UserFeatureData[] | undefined): NormalizedF
}));
}
const WARNING_REASONS: Set<string> = new Set([
"feature_org_disabled",
"feature_all_teams_disabled",
"feature_any_team_disabled",
"feature_no_explicit_enablement",
"feature_user_only_not_allowed",
]);
function createUserBlockedWarningFn(t: TFunction): (feature: NormalizedFeature) => string | null {
return (feature: NormalizedFeature): string | null => {
if (!feature.effectiveReason) return null;
switch (feature.effectiveReason) {
case "feature_org_disabled":
return t("feature_blocked_by_org_warning");
case "feature_all_teams_disabled":
case "feature_any_team_disabled":
return t("feature_blocked_by_team_warning");
case "feature_no_explicit_enablement":
return t("feature_no_explicit_enablement_warning");
case "feature_user_only_not_allowed":
return t("feature_user_only_not_allowed_warning");
default:
return null;
}
if (!feature.effectiveReason || !WARNING_REASONS.has(feature.effectiveReason)) return null;
return t(feature.effectiveReason);
};
}
@@ -4502,10 +4502,11 @@
"auto_opt_in_experimental_description_personal": "Automatically opt into new experimental features, unless disabled by your team or organization",
"auto_opt_in_experimental_description_team": "Automatically opt team members into new experimental features, unless configured by the organization or opted out by members",
"auto_opt_in_experimental_description_org": "Automatically opt organization members into new experimental features, unless configured at team or user level",
"feature_blocked_by_team_warning": "This feature is disabled by your team.",
"feature_blocked_by_org_warning": "This feature is disabled by your organization.",
"feature_no_explicit_enablement_warning": "Turn it on for yourself, or ask your team or organization admin to enable it for everyone.",
"feature_user_only_not_allowed_warning": "This feature needs approval from your team or organization.",
"feature_org_disabled": "This feature is disabled by your organization.",
"feature_all_teams_disabled": "This feature is disabled by your team.",
"feature_any_team_disabled": "This feature is disabled by your team.",
"feature_no_explicit_enablement": "Turn it on for yourself, or ask your team or organization admin to enable it for everyone.",
"feature_user_only_not_allowed": "This feature needs approval from your team or organization.",
"no_opt_in_features_available": "No opt-in features are currently available",
"enabled_via_auto_opt_in": "Enabled via auto opt-in",
"account_already_exists_please_login": "An account with this email already exists. Please log in to accept the invitation.",