@wildo-ai/saas-frontend-lib 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/companion-exports.d.ts +1 -1
- package/dist/esm/companion-exports.d.ts.map +1 -1
- package/dist/esm/companion-exports.js +1 -1
- package/dist/esm/companion-exports.js.map +1 -1
- package/dist/esm/components/ai-elements/decision/approval.d.ts +13 -1
- package/dist/esm/components/ai-elements/decision/approval.d.ts.map +1 -1
- package/dist/esm/components/ai-elements/decision/approval.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +12 -7
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.labels.js +3 -0
- package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/execution-plan.js +1 -1
- package/dist/esm/components/flows-actors/execution-plan.js.map +1 -1
- package/dist/esm/components/flows-actors/task-memory.js +1 -1
- package/dist/esm/components/flows-actors/task-memory.js.map +1 -1
- package/dist/esm/components/form/automated/generated-relationship-field.hooks.d.ts +1 -1
- package/dist/esm/components/form/controls/number/slider.d.ts +1 -1
- package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts +1 -1
- package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.d.ts.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.js +66 -17
- package/dist/esm/components/form/fields/form-field-file.js.map +1 -1
- package/dist/esm/components/form/fields/form-field-file.labels.js +2 -2
- package/dist/esm/components/form/fields/form-field-file.labels.js.map +1 -1
- package/dist/esm/components/form/form-field-types.d.ts +20 -0
- package/dist/esm/components/form/form-field-types.d.ts.map +1 -1
- package/dist/esm/components/form/form-field-types.js.map +1 -1
- package/dist/esm/components/navigation/NavigationItemBadge.d.ts +7 -1
- package/dist/esm/components/navigation/NavigationItemBadge.d.ts.map +1 -1
- package/dist/esm/components/navigation/NavigationItemBadge.js +29 -1
- package/dist/esm/components/navigation/NavigationItemBadge.js.map +1 -1
- package/dist/esm/components/navigation/menu-bar.d.ts +1 -1
- package/dist/esm/components/overlays/containers/OverlayContainer.d.ts.map +1 -1
- package/dist/esm/components/overlays/containers/OverlayContainer.js +36 -9
- package/dist/esm/components/overlays/containers/OverlayContainer.js.map +1 -1
- package/dist/esm/components/overlays/floating/context-menu.d.ts +1 -1
- package/dist/esm/components/overlays/floating/dropdown-menu.d.ts +1 -1
- package/dist/esm/components/resources/ResourceLayout_FilterChips.js +1 -1
- package/dist/esm/components/resources/ResourceLayout_FilterChips.js.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts +12 -0
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts.map +1 -1
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js +13 -1
- package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +106 -49
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +311 -109
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.d.ts.map +1 -1
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js +32 -2
- package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js.map +1 -1
- package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
- package/dist/esm/components/settings/SettingsHub.js +30 -6
- package/dist/esm/components/settings/SettingsHub.js.map +1 -1
- package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts.map +1 -1
- package/dist/esm/components/views/onboarding-view/OnboardingView.js +9 -2
- package/dist/esm/components/views/onboarding-view/OnboardingView.js.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts +16 -0
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js +17 -0
- package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js.map +1 -1
- package/dist/esm/core/automated-layout/default-layout-generator.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/automated-layout/default-layout-generator.frontend.utils.js +3 -2
- package/dist/esm/core/automated-layout/default-layout-generator.frontend.utils.js.map +1 -1
- package/dist/esm/core/billing/billing-launcher.js +1 -1
- package/dist/esm/core/billing/billing-launcher.js.map +1 -1
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts +64 -4
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js +76 -4
- package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js.map +1 -1
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts +8 -0
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts.map +1 -1
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js +1 -0
- package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js.map +1 -1
- package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +8 -8
- package/dist/esm/core/config/composite-view.schemas.d.ts +4 -4
- package/dist/esm/core/config/engine-settings-destinations.d.ts +0 -69
- package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
- package/dist/esm/core/config/engine-settings-destinations.js +35 -74
- package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +10 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/config/settings-hub.frontend.schemas.js +9 -0
- package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
- package/dist/esm/core/config/useSettingsHubConfig.d.ts.map +1 -1
- package/dist/esm/core/config/useSettingsHubConfig.js +8 -1
- package/dist/esm/core/config/useSettingsHubConfig.js.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.d.ts +4 -4
- package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts +12 -1
- package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts.map +1 -1
- package/dist/esm/core/external-providers/ProviderFilePickerHost.js +15 -2
- package/dist/esm/core/external-providers/ProviderFilePickerHost.js.map +1 -1
- package/dist/esm/core/external-providers/provider-file-selection.frontend.utils.d.ts +1 -2
- package/dist/esm/core/external-providers/provider-file-selection.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/external-providers/provider-file-selection.frontend.utils.js.map +1 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +6 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
- package/dist/esm/core/flows-actors/FlowsActorsContext.js +10 -2
- package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
- package/dist/esm/core/i18n/I18nContext.d.ts +23 -0
- package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
- package/dist/esm/core/i18n/I18nContext.js +6 -1
- package/dist/esm/core/i18n/I18nContext.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +75 -2
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +52 -0
- package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts +3 -2
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js +57 -4
- package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/ResourceReadCacheBridge.d.ts.map +1 -1
- package/dist/esm/core/resources/ResourceReadCacheBridge.js +130 -37
- package/dist/esm/core/resources/ResourceReadCacheBridge.js.map +1 -1
- package/dist/esm/core/resources/resources.frontend.schemas.d.ts +2 -2
- package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/runtime/start-application.frontend.service.js +17 -9
- package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.js +61 -5
- package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"I18nContext.js","sourceRoot":"","sources":["../../../../src/core/i18n/I18nContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,QAAQ,EAAa,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AACrG,OAAO,EACL,cAAc,EAAyB,iBAAiB,EAAE,iBAAiB,EAC3D,iBAAiB,EAA0B,aAAa,EACzC,uBAAuB,EACtD,mBAAmB,GAEpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mFAAmF,CAAC;AAC7H,OAAO,EAAE,yBAAyB,EAAE,MAAM,2DAA2D,CAAC;AACtG,OAAO,EAAE,cAAc,EA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;QACvB,kBAAkB;QAClB,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,eAAe;QACf,gBAAgB;QAChB,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,uBAAuB;QACvB,qBAAqB;QACrB,UAAU;QACV,gBAAgB;QAChB,eAAe;QACf,UAAU;QACV,eAAe;QACf,oBAAoB;QACpB,kBAAkB;QAClB,eAAe;QACf,eAAe;QACf,aAAa;QACb,kBAAkB;QAClB,KAAK;QACL,2BAA2B;QAC3B,UAAU;QACV,UAAU;QACV,cAAc;QACd,YAAY;QACZ,wBAAwB;QACxB,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,YAAY,EAAE,oBAAoB;QAClC,YAAY;QACZ,oBAAoB;QACpB,mBAAmB;KACpB,CAAC;IAEF,OAAO,CACL,KAAC,iBAAiB,IAAC,GAAG,EAAE,GAAG,YACzB,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAC/B,QAAQ,GACY,GACL,CACrB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { createContext, useState, ReactNode, useEffect, useMemo, useRef, useCallback, useContext } from 'react';\nimport { DirectionProvider } from '@radix-ui/react-direction';\nimport { LOCAL_STORAGE_KEYS } from '~wildo-frontend-lib/core/commons/local-storage.frontend.schemas';\nimport {\n LabellingTypes, FrontendComponentType, AvailableLanguage, LANGUAGE_INFO_MAP,\n SystemEnumName, SYSTEM_ENUM_NAMES, DateFormat, TimeFormat, TextDirection,\n type RegionalFormattingConfig, RegionalFormattingUtils,\n EAGER_I18N_SECTIONS,\n NavigationViewLabelFamily,\n} from '@wildo-ai/presets-components-models';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { MainContextInitComponents } from '~wildo-frontend-lib/core/runtime/runtime.frontend.schemas';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { ErrorContext } from '~wildo-frontend-lib/core/errors/ErrorContext';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { FrontendEvents, type FrontendEventPayloads } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { LoadingTier, AppLoadingIdentifier } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { envLoader } from '~wildo-frontend-lib/core/runtime/env-variable-loader.frontend.service';\nimport {\n OrganizationLanguagePreferences,\n OrganizationRegionalPreferences,\n UserLanguagePreferences,\n UserPreferences,\n type ActivationCriterion,\n ActivationCriterionType,\n interpolateLabelParams,\n} from '@wildo-ai/saas-models';\nimport { resolveRegionalFormatting } from './regional-preference-resolution.frontend.utils';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\n\n/**\n * Internationalization Context\n * Manages language selection and translations\n *\n * INTEGRATION WITH APPLICATION MAIN CONTEXT:\n *\n * This context integrates with ApplicationMainContext initialization system.\n * It automatically detects when app config is ready and loads translations.\n * Marks MainContextInitComponents.I18N as initialized when complete.\n *\n * Language Management:\n * - Effective language resolves from app config, user preferences,\n * organization policy, localStorage, and browser detection.\n * - Translations load automatically when app config is ready.\n * - Missing active-locale keys fall back through the configured fallback language.\n * - Uses ErrorContext for error handling and real backend translations.\n */\n\nexport interface Translation {\n [key: string]: string | Translation;\n}\n\nexport { TextDirection } from '@wildo-ai/presets-components-models';\n\nexport interface I18nContextType {\n // State\n currentLanguage: AvailableLanguage;\n /** Text direction derived from current language (LANGUAGE_INFO_MAP). Use for RTL layout. */\n dir: TextDirection;\n translations: Translation;\n isLoading: boolean;\n availableLanguages: AvailableLanguage[];\n\n // Language config flags (from appConfig.appPreferences.languages)\n enableLanguageSwitcher: boolean;\n allowUserOverride: boolean;\n\n // Preferences (synced from UserOrgsContext via events)\n languagePreferences: UserLanguagePreferences | null;\n regionalPreferences: UserPreferences['regional'] | null;\n\n // Actions\n changeLanguage: (language: AvailableLanguage) => Promise<void>;\n loadTranslations: (language: AvailableLanguage) => Promise<void>;\n\n // Helpers\n t: (key: string, params?: Record<string, string | number>) => string;\n getLanguageName: (language: AvailableLanguage) => string;\n isLanguageSupported: (language: string) => boolean;\n\n // Preference getters\n getLanguagePreferences: () => UserLanguagePreferences | null;\n getRegionalPreferences: () => UserPreferences['regional'] | null;\n\n // Labelling helpers (structured keys)\n tResourceHeader : ( resource: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tResourceEmptyState : (resource: string, key: 'title' | 'description' | 'primaryActionLabel' | 'secondaryActionLabel', params?: Record<string, string | number>) => string;\n tResourceOperation : (resource: string, operation: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tResourceFieldDisplay : (resource: string, fieldPath: string, key: 'label' | 'description' | 'tooltip', params?: Record<string, string | number>) => string;\n tResourceFieldEdit : (resource: string, fieldPath: string, key: 'label' | 'description' | 'placeholder' | 'tooltip', params?: Record<string, string | number>) => string;\n tResourceFieldEnumValue : (resource: string, fieldPath: string, enumValue: string) => string;\n tErrorValidation : (zodIssueCode: string, ref: string, params?: Record<string, string | number>) => string;\n tComponent : (componentType: FrontendComponentType, key: string, params?: Record<string, string | number>) => string;\n tErrorMessage : (errorRef: string, key?: string, params?: Record<string, string | number>) => string;\n /** Resolve error guidance label: `errors_guidance.{guidanceKey}.{field}` — returns empty string when missing */\n tErrorGuidance : (guidanceKey: string, field: string, params?: Record<string, string | number>) => string;\n tNotificationCustom : (notificationRef: string, key?: string, params?: Record<string, string | number>) => string;\n tSystemEnum : (enumName: SystemEnumName, enumValue: string) => string;\n\n // Resource layout labels\n tResourceSection : (resource: string, sectionRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tResourceWizardStep : (resource: string, stepRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n\n // Sidebar section labels (dynamic, based on configured sections)\n tSidebarSection : (sectionRef: string, key?: 'title' | 'description', params?: Record<string, string | number>) => string;\n // Settings Hub category/section labels (dynamic, registry-driven). Fall back\n // to the authored label string when no translation is present.\n tSettingsHubCategory : (categoryRef: string, fallbackLabel: string) => string;\n tSettingsHubSection : (sectionRef: string, fallbackLabel: string) => string;\n tCompositeView : (translationRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tCompositeViewSection : (translationRef: string, sectionRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tView : (family: NavigationViewLabelFamily, translationRef: string, key: string, params?: Record<string, string | number>) => string;\n\n // Guidance helpers\n tGuidanceFlow: (flowRef: string, key: string, params?: Record<string, string | number>) => string;\n tGuidanceElement: (flowRef: string, elementRef: string, key: string, params?: Record<string, string | number>) => string | undefined;\n tGuidanceTourStep: (flowRef: string, elementRef: string, stepRef: string, key: string, params?: Record<string, string | number>) => string | undefined;\n tGuidanceSurveyQuestion: (flowRef: string, elementRef: string, questionId: string, key: string, params?: Record<string, string | number>) => string | undefined;\n makeTrGuidanceElement: (flowRef: string, elementRef: string) => (key: string, params?: Record<string, string | number>) => string | undefined;\n\n // Milestone helpers\n tMilestone: (milestoneRef: string, key: string, params?: Record<string, string | number>) => string;\n tMilestoneReward: (milestoneRef: string, key: string, params?: Record<string, string | number>) => string;\n makeTrMilestone: (milestoneRef: string) => (key: string, params?: Record<string, string | number>) => string;\n\n // Lifecycle helpers\n tLifecycle: (key: string, params?: Record<string, string | number>) => string;\n tLifecycleStage: (stage: string) => string;\n /** Resolve activation criterion label from its source domain (milestone title or guidance flow title) */\n tActivationCriterion: (criterion: ActivationCriterion) => string;\n /** Resolve shared milestone category label: milestones.categories.{category}.label */\n tMilestoneCategory: (category: string) => string;\n\n // Billing helpers\n tBillingProduct: (productKey: string, subKey: 'name' | 'description' | 'tagline') => string;\n tBillingFeature: (featureKey: string, subKey: 'label' | 'description') => string;\n tBillingLimit: (limitKey: string, subKey: 'label' | 'description' | 'unit') => string;\n tBillingCreditPool: (poolKey: string, subKey: 'name' | 'description' | 'unit') => string;\n\n // Role helpers\n /**\n * Resolve role label from `roles.<roleRef>.<label|description>`.\n * Mirrors the labelling-policy shape in `LabellingPolicy[ROLES]` and the\n * shared `tBilling*` precedent: returns the humanized roleRef when the\n * `label` key is missing and an empty string when `description` is missing.\n * `roleRef` here is the bi-scoped key (e.g. `app.OWNER`) used by the\n * `RoleSpecification` registry, matching what backend i18n collection emits.\n */\n tRole: (roleKey: string, subKey: 'label' | 'description') => string;\n\n // Regional formatting (absorbed from ComponentsLabellingContext)\n resolvedRegionalPreferences: RegionalFormattingConfig;\n formatDate: (value: Date | string | number) => string;\n formatTime: (value: Date | string | number) => string;\n formatDateTime: (value: Date | string | number) => string;\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n\n // Component translation utilities\n hasComponentTranslations: (componentType: FrontendComponentType) => boolean;\n getComponentKeys: (componentType: FrontendComponentType) => string[];\n\n /**\n * Request translation sub-trees by dot-path key(s).\n * Language-aware (uses currentLanguage), cached, deduplicated.\n * Already-loaded keys are skipped. In-flight keys are coalesced.\n * Resolves when ALL requested keys are loaded and merged into `translations`.\n *\n * @example\n * requestKeys('components.low_level_button');\n * requestKeys(['components.low_level_button', 'resources.todos']);\n */\n requestKeys: (keys: string | string[]) => Promise<void>;\n\n /** Check whether a dot-path key has been loaded (present in cache for the current language). */\n isKeyLoaded: (key: string) => boolean;\n\n /**\n * Is this key SETTLED — loaded, or failed and not coming?\n *\n * What a READINESS gate must ask. `isKeyLoaded` answers \"can I read a value\" and is right for a\n * lookup; a surface deciding whether to keep showing a skeleton needs to know that waiting longer\n * will not help. A failed bundle answers no to the first and yes to this, which is the difference\n * between a form that renders with missing labels and one that is a skeleton forever.\n */\n isKeySettled: (key: string) => boolean;\n\n /** Full lifecycle status of a key: loaded, pending (in-flight), or not-requested. */\n getKeyStatus: (key: string) => 'loaded' | 'pending' | 'not-requested';\n\n /** Convenience: request component translations by FrontendComponentType. */\n requestComponentKeys: (componentType: FrontendComponentType | FrontendComponentType[]) => Promise<void>;\n\n /** Convenience: request resource translations by resource type name. */\n requestResourceKeys: (resourceType: string | string[]) => Promise<void>;\n\n // Curried resource helpers (two-step usage in components)\n makeTrResourceHeader : (resource: string ) => (key?: 'title' | 'description', params?: Record<string, string | number>) => string;\n makeTrResourceEmptyState : (resource: string) => (key?: 'title' | 'description' | 'primaryActionLabel' | 'secondaryActionLabel', params?: Record<string, string | number>) => string;\n makeTrResourceOperation : (resource: string) => (operation: string, key?: 'title', params?: Record<string, string | number>) => string;\n makeTrResourceFieldDisplay : (resource: string) => (fieldPath: string, key?: 'label' | 'tooltip', params?: Record<string, string | number>) => string;\n makeTrResourceFieldEdit : (resource: string) => (fieldPath: string, key?: 'label' | 'placeholder' | 'tooltip', params?: Record<string, string | number>) => string;\n makeTrResourceFieldEnum : (resource: string) => (fieldPath: string, enumValue: string) => string;\n makeTrErrorMessage : ( errorRef: string) => (key?: string, params?: Record<string, string | number>) => string;\n makeTrErrorGuidance : (guidanceKey: string) => (field: string, params?: Record<string, string | number>) => string;\n makeTrNotificationCustom : ( notificationRef: string) => (key?: string, params?: Record<string, string | number>) => string;\n makeTrErrorValidation : ( zodIssueCode: string) => (ref: string, params?: Record<string, string | number>) => string;\n makeTrComponent : ( componentType: FrontendComponentType) => (key: string, params?: Record<string, string | number>) => string;\n makeTrSystemEnum : (enumName: SystemEnumName) => (enumValue: string) => string;\n}\n\n/**\n * What an unresolved catalogue label renders as — the RAW KEY, never words invented from it.\n *\n * These keys name things an operator authored (a billing product, a feature, a limit, a credit\n * pool, a role, a milestone category), and until 2026-09-08 a missing label was replaced by a\n * humanizer: `'ai_assistant'` became `'Ai Assistant'`, in English, in every locale. It read as a\n * finished surface, so nobody ever added the label — the whole defect #420 records. It was also\n * wrong on the cases it could not see (`GDPR` -> `Gdpr`, `EUR` -> `Eur`), because which all-caps\n * token is an acronym is not knowable from the string.\n *\n * The key itself is the honest rendering: visible, greppable, obviously not a label, and identical\n * in every locale because it is not a translation. It is what `t()` already returns for an\n * unresolved key, so this is the surrounding convention rather than a new one.\n *\n * It is only ever reached AFTER labels have settled — surfaces gate on `useI18n().isReady`, which\n * settles on a failed bundle as well as a loaded one, so a key is never flashed during the load.\n */\nfunction unresolvedLabel(key: string): string {\n return key;\n}\n\n/**\n * I18n Context\n * Exported for use in separate hook file (Fast Refresh compatibility)\n * @internal - Use useI18n() hook instead of accessing this directly\n */\nexport const I18nContext: React.Context<I18nContextType | undefined> = createContext<I18nContextType | undefined>(undefined);\nconst allAvailableLanguages = Object.values(AvailableLanguage);\nconst replayPendingLazyKeys = new Set<string>();\n\nexport const I18nProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const isDebugging = false;\n const { appConfig, markComponentInitialized, isInitialized: appIsInitialized, logger } = useApplication();\n const errorContext = useContext(ErrorContext);\n const { on, emit } = useEventBus();\n\n // Extract language configuration from appConfig\n const languageConfig = appConfig?.appPreferences?.languages;\n const configDefaultLanguage = languageConfig?.defaultLanguage ?? AvailableLanguage.EN;\n const configEnabledLanguages = languageConfig?.enabledLanguages ?? allAvailableLanguages;\n const configFallbackLanguage = languageConfig?.fallbackLanguage ?? configDefaultLanguage;\n const configAutoDetect = languageConfig?.autoDetectFromBrowser ?? true;\n const configAllowUserOverride = languageConfig?.allowUserOverride ?? true;\n const configAllowOrganizationOverride = languageConfig?.allowOrganizationOverride ?? true;\n const configEnableLanguageSwitcher = languageConfig?.enableLanguageSwitcher ?? true;\n\n const [currentLanguage, setCurrentLanguage] = useState<AvailableLanguage>(configDefaultLanguage);\n const currentLanguageRef = useRef<AvailableLanguage>(configDefaultLanguage);\n const [translations, setTranslations] = useState<Translation>({});\n const [isLoading, setIsLoading] = useState(false);\n /**\n * Bumped when a key SETTLES as failed, purely to re-render.\n *\n * `failedKeysRef` is a ref, so recording a failure changes nothing a consumer can observe: the\n * success path re-renders through `setTranslations`, and without this the failure path had no\n * state update at all — readiness stayed false until something else happened to re-render, which\n * is indistinguishable from the hang this fixes. A counter rather than exposing the set, because\n * the set is read through `isKeySettled` and nothing should depend on its contents.\n */\n const [failedKeysVersion, setFailedKeysVersion] = useState(0);\n\n // Preferences state (synced from UserOrgsContext via events)\n const [languagePreferences, setLanguagePreferences] = useState<UserLanguagePreferences | null>(null);\n const [organizationLanguagePreferences, setOrganizationLanguagePreferences] = useState<OrganizationLanguagePreferences | null>(null);\n const [regionalPreferences, setRegionalPreferences] = useState<UserPreferences['regional'] | null>(null);\n /**\n * The tenant's regional answer — the layer BENEATH the member's own (#410).\n *\n * Held separately rather than merged into `regionalPreferences` on arrival, because merging\n * would destroy the distinction the resolution depends on: once the two are one object, nothing\n * downstream can tell a member's explicit `UTC` from a tenant's, and a member could never be\n * seen to have overridden anything.\n */\n const [organizationRegionalPreferences, setOrganizationRegionalPreferences] =\n useState<OrganizationRegionalPreferences | null>(null);\n\n const logDebug = logger.debugByType('I18nContext');\n logger.setDebugTypeLogging('I18nContext', isDebugging);\n\n const reportError = useCallback((error: unknown, customMessage: string, additionalContext?: Record<string, unknown>) => {\n if (errorContext) {\n errorContext.handleError(error, customMessage, additionalContext);\n return;\n }\n\n logger.error(customMessage, {\n originalError: error instanceof Error ? error.message : String(error),\n ...additionalContext,\n });\n }, [errorContext, logger]);\n\n const getPolicyAvailableLanguages = useCallback((\n orgPreferences: OrganizationLanguagePreferences | null = organizationLanguagePreferences,\n ): AvailableLanguage[] => {\n if (!configAllowOrganizationOverride || !orgPreferences) {\n return configEnabledLanguages;\n }\n\n const scopedLanguages = orgPreferences.supportedLanguages\n .filter((language): language is AvailableLanguage => configEnabledLanguages.includes(language));\n\n if (configEnabledLanguages.includes(orgPreferences.primaryLanguage) && !scopedLanguages.includes(orgPreferences.primaryLanguage)) {\n scopedLanguages.unshift(orgPreferences.primaryLanguage);\n }\n\n return scopedLanguages.length > 0 ? [...new Set(scopedLanguages)] : configEnabledLanguages;\n }, [configAllowOrganizationOverride, configEnabledLanguages, organizationLanguagePreferences]);\n\n const resolveEffectiveLanguage = useCallback((options?: {\n userPreferences?: UserLanguagePreferences | null;\n organizationPreferences?: OrganizationLanguagePreferences | null;\n savedLanguage?: AvailableLanguage | null;\n browserLanguage?: AvailableLanguage | null;\n }): AvailableLanguage => {\n const userPreferences = options?.userPreferences ?? languagePreferences;\n const organizationPreferences = configAllowOrganizationOverride\n ? (options?.organizationPreferences ?? organizationLanguagePreferences)\n : null;\n const availableLanguages = getPolicyAvailableLanguages(organizationPreferences);\n const supportsLanguage = (language: AvailableLanguage | null | undefined): language is AvailableLanguage =>\n !!language && availableLanguages.includes(language);\n const resolvedOrganizationPrimary = supportsLanguage(organizationPreferences?.primaryLanguage)\n ? organizationPreferences!.primaryLanguage\n : null;\n\n if (\n resolvedOrganizationPrimary\n && (\n organizationPreferences?.enforceForAllMembers\n || organizationPreferences?.allowUserOverride === false\n || userPreferences?.useOrganizationDefault === true\n )\n ) {\n return resolvedOrganizationPrimary;\n }\n\n if (configAllowUserOverride && supportsLanguage(userPreferences?.primaryLanguage)) {\n return userPreferences!.primaryLanguage;\n }\n\n if (configAllowUserOverride && supportsLanguage(options?.savedLanguage)) {\n return options!.savedLanguage!;\n }\n\n const shouldAutoDetect = configAllowUserOverride && (userPreferences?.autoDetect ?? configAutoDetect);\n if (shouldAutoDetect && supportsLanguage(options?.browserLanguage)) {\n return options!.browserLanguage!;\n }\n\n if (resolvedOrganizationPrimary) {\n return resolvedOrganizationPrimary;\n }\n\n if (supportsLanguage(configDefaultLanguage)) {\n return configDefaultLanguage;\n }\n\n return availableLanguages[0] ?? configDefaultLanguage;\n }, [\n configAllowOrganizationOverride,\n configAllowUserOverride,\n configAutoDetect,\n configDefaultLanguage,\n getPolicyAvailableLanguages,\n languagePreferences,\n organizationLanguagePreferences,\n ]);\n\n const effectiveAllowUserOverride = useMemo(() => {\n if (!configAllowUserOverride) {\n return false;\n }\n\n if (!configAllowOrganizationOverride || !organizationLanguagePreferences) {\n return true;\n }\n\n if (organizationLanguagePreferences.enforceForAllMembers) {\n return false;\n }\n\n if (!organizationLanguagePreferences.allowUserOverride) {\n return false;\n }\n\n if (languagePreferences?.useOrganizationDefault) {\n return false;\n }\n\n return true;\n }, [\n configAllowOrganizationOverride,\n configAllowUserOverride,\n languagePreferences?.useOrganizationDefault,\n organizationLanguagePreferences,\n ]);\n\n\n // Guards to prevent duplicate API calls\n const loadingLanguageRef = useRef<AvailableLanguage | null>(null);\n const loadedLanguagesRef = useRef<Set<AvailableLanguage>>(new Set());\n const isInitializedRef = useRef<boolean>(false);\n\n // --- Per-key lazy loading state ---\n /** Keys that have been fetched and merged for the current language. */\n const loadedKeysRef = useRef<Set<string>>(new Set());\n /**\n * In-flight key requests: key path → Promise.\n * Allows deduplication: if two components request the same key simultaneously,\n * the second one joins the first's pending promise instead of firing a new API call.\n */\n const pendingKeysRef = useRef<Map<string, Promise<void>>>(new Map());\n /**\n * Keys whose fetch FAILED, so readiness can settle without them.\n *\n * Deliberately separate from `loadedKeysRef`. A failed key is SETTLED — nothing is still in\n * flight, so a surface gating on `isReady` must proceed — but it is not LOADED, so a later\n * `requestKeys` retries it rather than skipping it as already present. Collapsing the two into\n * one set would buy simplicity and lose the retry.\n *\n * Before this existed, a failed fetch removed the key from `pendingKeysRef` and never added it\n * anywhere, so `isKeyImplicitlyLoaded` stayed false FOREVER and `isReady` never resolved. Any\n * surface gating on it — `AutomatedForm` renders a skeleton until `isReady` — was a PERMANENT\n * skeleton after one failed request. The form's own comment named the risk and avoided it by\n * gating on the component bundle only, which is why this had not bitten yet.\n */\n const failedKeysRef = useRef<Set<string>>(new Set());\n /**\n * Micro-batch timer. Calls to `requestKeys` within this window are coalesced\n * into a single API request to avoid per-component HTTP chatter.\n */\n const batchTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const batchQueueRef = useRef<{ keys: string[]; resolve: () => void; reject: (err: unknown) => void }[]>([]);\n /**\n * Legacy flag — kept `false` to activate per-component lazy loading.\n * With eager-core loading, `loadTranslations` only fetches `EAGER_I18N_SECTIONS`\n * and marks each section individually in `loadedKeysRef`. The microbatch system\n * handles all other sections via `requestKeys`.\n * Reset on language change.\n */\n const fullLoadCompletedRef = useRef<boolean>(false);\n\n const applyResolvedLanguage = useCallback((language: AvailableLanguage, options?: { persist?: boolean }): void => {\n if (language === currentLanguageRef.current) {\n if (options?.persist !== false) {\n localStorage.setItem(LOCAL_STORAGE_KEYS.LANGUAGE, language);\n }\n document.documentElement.lang = language;\n return;\n }\n\n if (batchTimerRef.current !== null) {\n clearTimeout(batchTimerRef.current);\n batchTimerRef.current = null;\n }\n batchQueueRef.current.forEach(b => b.resolve());\n batchQueueRef.current = [];\n loadedKeysRef.current.clear();\n pendingKeysRef.current.clear();\n fullLoadCompletedRef.current = false;\n loadedLanguagesRef.current.clear();\n setTranslations({});\n\n currentLanguageRef.current = language;\n setCurrentLanguage(language);\n\n if (options?.persist !== false) {\n localStorage.setItem(LOCAL_STORAGE_KEYS.LANGUAGE, language);\n }\n document.documentElement.lang = language;\n }, []);\n\n // Initialize language on mount (respects appConfig language preferences)\n useEffect(() => {\n const savedLanguage = localStorage.getItem(LOCAL_STORAGE_KEYS.LANGUAGE) as AvailableLanguage | null;\n const browserLanguage = navigator.language.split('-')[0] as AvailableLanguage;\n const initialLanguage = resolveEffectiveLanguage({\n savedLanguage,\n browserLanguage,\n });\n\n applyResolvedLanguage(initialLanguage);\n }, [applyResolvedLanguage, resolveEffectiveLanguage]);\n\n // Load translations when app config is ready and language is set\n useEffect(() => {\n logDebug('useEffect triggered', { appIsInitialized, currentLanguage, isCurrentlyLoading: loadingLanguageRef.current, alreadyLoaded: loadedLanguagesRef.current.has(currentLanguage), isInitialized: isInitializedRef.current });\n\n if (appIsInitialized && currentLanguage) {\n logDebug(`Attempting to load translations for ${currentLanguage} (triggered by useEffect)`);\n loadTranslations(currentLanguage);\n }\n }, [appIsInitialized, currentLanguage]);\n\n // Cleanup batch timer and resolve dangling promises on unmount\n useEffect(() => {\n return () => {\n if (batchTimerRef.current !== null) {\n clearTimeout(batchTimerRef.current);\n batchTimerRef.current = null;\n }\n batchQueueRef.current.forEach(b => b.resolve());\n batchQueueRef.current = [];\n };\n }, []);\n\n const getLanguageName = (language: AvailableLanguage, native: boolean = true): string => {\n const languageInfo = LANGUAGE_INFO_MAP[language];\n if (!languageInfo)\n return language;\n\n return native\n ? languageInfo.nativeName\n : languageInfo.name;\n };\n\n const isLanguageSupported = (language: string): boolean => {\n return getPolicyAvailableLanguages().includes(language as AvailableLanguage);\n };\n\n\n const changeLanguage = async (language: AvailableLanguage): Promise<void> => {\n if (language === currentLanguageRef.current) return;\n\n if (!effectiveAllowUserOverride) {\n logDebug('Language change blocked — effective user override is disabled', {\n configAllowUserOverride,\n configAllowOrganizationOverride,\n useOrganizationDefault: languagePreferences?.useOrganizationDefault,\n organizationLanguagePreferences,\n });\n return;\n }\n\n if (!isLanguageSupported(language)) {\n logDebug(`Language change blocked — ${language} is not in enabledLanguages`);\n return;\n }\n\n logDebug(`Language change requested: ${currentLanguage} → ${language}`);\n applyResolvedLanguage(language);\n };\n\n const mergeLabelPayloads = (payloads: Translation[]): Translation => {\n return payloads.reduce<Translation>((merged, payload) => deepMergeTranslations(merged, payload), {});\n };\n\n const shouldLoadFallbackLayer = (language: AvailableLanguage): boolean => {\n return configFallbackLanguage !== language;\n };\n\n const fetchEagerLabelsWithFallback = async (language: AvailableLanguage, sections: string[]): Promise<Translation> => {\n const httpClient = getManualCallsHttpClient();\n\n if (!shouldLoadFallbackLayer(language)) {\n const response = await httpClient.getI18nLabels(language, sections);\n return response.labels;\n }\n\n const [fallbackResponse, response] = await Promise.all([\n httpClient.getI18nLabels(configFallbackLanguage, sections),\n httpClient.getI18nLabels(language, sections),\n ]);\n\n return deepMergeTranslations(fallbackResponse.labels, response.labels);\n };\n\n const fetchLazyLabelsWithFallback = async (language: AvailableLanguage, chunks: string[][]): Promise<Translation> => {\n const httpClient = getManualCallsHttpClient();\n\n if (!shouldLoadFallbackLayer(language)) {\n /*\n * Pre-caught for the same reason as the dual-language branch below: `Promise.all` settles on\n * the FIRST rejection, so when several chunks fail — which is what a labels endpoint being\n * down looks like — every loser's rejection floats to the window unhandled. The `await` still\n * rejects; the `.catch` only marks each request as observed.\n */\n const chunkRequests = chunks.map(chunk => httpClient.getI18nLabelsByKeys(language, chunk));\n chunkRequests.forEach(request => request.catch(() => undefined));\n const responses = await Promise.all(chunkRequests);\n return mergeLabelPayloads(responses.map((response) => response.labels));\n }\n\n /*\n * Held in locals and pre-caught, because `Promise.all` settles on the FIRST rejection and\n * leaves the other branch's rejection with no handler — an unhandled promise rejection at the\n * window whenever BOTH languages fail, which is the ordinary case when the labels endpoint is\n * down. The `await` below still rejects exactly as before; the `.catch` only marks each branch\n * as observed so the loser does not float.\n */\n const fallbackChunkRequests = chunks.map(chunk => httpClient.getI18nLabelsByKeys(configFallbackLanguage, chunk));\n const primaryChunkRequests = chunks.map(chunk => httpClient.getI18nLabelsByKeys(language, chunk));\n [...fallbackChunkRequests, ...primaryChunkRequests].forEach(request => request.catch(() => undefined));\n const fallbackRequest = Promise.all(fallbackChunkRequests);\n const primaryRequest = Promise.all(primaryChunkRequests);\n fallbackRequest.catch(() => undefined);\n primaryRequest.catch(() => undefined);\n\n const [fallbackResponses, responses] = await Promise.all([fallbackRequest, primaryRequest]);\n\n return deepMergeTranslations(\n mergeLabelPayloads(fallbackResponses.map((response) => response.labels)),\n mergeLabelPayloads(responses.map((response) => response.labels)),\n );\n };\n\n // Listen to preference changes from UserOrgsContext\n useEffect(() => {\n const unsubscribe = on(FrontendEvents.USER_PREFERENCES_CHANGED, (payload: FrontendEventPayloads[FrontendEvents.USER_PREFERENCES_CHANGED]) => {\n const includesLanguagePreferences = Object.prototype.hasOwnProperty.call(payload, 'languagePreferences');\n const includesOrganizationLanguagePreferences = Object.prototype.hasOwnProperty.call(payload, 'organizationLanguagePreferences');\n\n const nextLanguagePreferences = includesLanguagePreferences\n ? (payload.languagePreferences ?? null)\n : languagePreferences;\n const nextOrganizationLanguagePreferences = includesOrganizationLanguagePreferences\n ? (payload.organizationLanguagePreferences ?? null)\n : organizationLanguagePreferences;\n\n if (includesLanguagePreferences) {\n setLanguagePreferences(nextLanguagePreferences);\n }\n\n if (includesOrganizationLanguagePreferences) {\n setOrganizationLanguagePreferences(nextOrganizationLanguagePreferences);\n }\n\n if (includesLanguagePreferences || includesOrganizationLanguagePreferences) {\n const savedLanguage = localStorage.getItem(LOCAL_STORAGE_KEYS.LANGUAGE) as AvailableLanguage | null;\n const browserLanguage = navigator.language.split('-')[0] as AvailableLanguage;\n const resolvedLanguage = resolveEffectiveLanguage({\n userPreferences: nextLanguagePreferences,\n organizationPreferences: nextOrganizationLanguagePreferences,\n savedLanguage,\n browserLanguage,\n });\n\n logDebug('Applying effective language from UserOrgsContext event', {\n resolvedLanguage,\n userPrimaryLanguage: nextLanguagePreferences?.primaryLanguage,\n useOrganizationDefault: nextLanguagePreferences?.useOrganizationDefault,\n organizationPrimaryLanguage: nextOrganizationLanguagePreferences?.primaryLanguage,\n organizationEnforced: nextOrganizationLanguagePreferences?.enforceForAllMembers,\n });\n\n applyResolvedLanguage(resolvedLanguage);\n }\n\n // Store regional preferences\n if (Object.prototype.hasOwnProperty.call(payload, 'regionalPreferences')) {\n setRegionalPreferences(payload.regionalPreferences ?? null);\n logDebug('Regional preferences updated from UserOrgsContext event', {\n locale: payload.regionalPreferences?.locale,\n timezone: payload.regionalPreferences?.timezone,\n });\n }\n\n // Store the tenant's regional defaults, which sit beneath the member's own\n if (Object.prototype.hasOwnProperty.call(payload, 'organizationRegionalPreferences')) {\n setOrganizationRegionalPreferences(payload.organizationRegionalPreferences ?? null);\n logDebug('Organization regional preferences updated from UserOrgsContext event', {\n locale: payload.organizationRegionalPreferences?.locale,\n timezone: payload.organizationRegionalPreferences?.timezone,\n });\n }\n });\n\n return unsubscribe;\n }, [\n applyResolvedLanguage,\n languagePreferences,\n logDebug,\n on,\n organizationLanguagePreferences,\n resolveEffectiveLanguage,\n ]);\n\n // Preference getters\n const getLanguagePreferences = useCallback((): UserLanguagePreferences | null => {\n return languagePreferences;\n }, [languagePreferences]);\n\n const getRegionalPreferences = useCallback((): UserPreferences['regional'] | null => {\n return regionalPreferences;\n }, [regionalPreferences]);\n\n // -------------------------------------------------------\n // Per-key lazy loading\n // -------------------------------------------------------\n\n /**\n * Deep-merge `source` into `target`, returning a new object.\n * String leaves in `source` overwrite `target`; nested objects are merged recursively.\n */\n const deepMergeTranslations = (target: Translation, source: Translation): Translation => {\n const result: Translation = { ...target };\n for (const key of Object.keys(source)) {\n const sv = source[key];\n const tv = result[key];\n if (typeof sv === 'object' && sv !== null && typeof tv === 'object' && tv !== null) {\n result[key] = deepMergeTranslations(tv as Translation, sv as Translation);\n } else {\n result[key] = sv;\n }\n }\n return result;\n };\n\n /**\n * Check if a key is implicitly loaded because an ancestor key was already fetched.\n * E.g. if `components.my_widget` is loaded, then `components.my_widget.label` is\n * implicitly loaded (it's a sub-path of an already-fetched tree).\n * Also: if `components` was loaded, then `components.my_widget` is implicitly loaded.\n */\n const isKeyImplicitlyLoaded = (key: string): boolean => {\n if (fullLoadCompletedRef.current) return true;\n if (loadedKeysRef.current.has(key)) return true;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n if (loadedKeysRef.current.has(ancestor)) return true;\n }\n\n return false;\n };\n\n /**\n * Is this key SETTLED — loaded, or failed and not coming?\n *\n * The question a readiness gate asks. `isKeyImplicitlyLoaded` answers \"can I read a value\",\n * which is a different question and the right one for a lookup; a UI waiting to render needs to\n * know that waiting longer will not help. A failed key answers no to the first and yes to this.\n */\n const isKeySettled = (key: string): boolean => {\n if (isKeyImplicitlyLoaded(key)) return true;\n if (failedKeysRef.current.has(key)) return true;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n if (failedKeysRef.current.has(ancestor)) return true;\n }\n\n return false;\n };\n\n /** Same ancestor check but against `pendingKeysRef`. */\n const isKeyImplicitlyPending = (key: string): boolean => {\n if (pendingKeysRef.current.has(key)) return true;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n if (pendingKeysRef.current.has(ancestor)) return true;\n }\n\n return false;\n };\n\n /**\n * Flush the micro-batch queue: collect all queued keys, fire one API call,\n * deep-merge the result, resolve all pending promises.\n */\n const flushBatch = async (): Promise<void> => {\n const batch = batchQueueRef.current;\n batchQueueRef.current = [];\n batchTimerRef.current = null;\n\n if (batch.length === 0) return;\n\n if (fullLoadCompletedRef.current) {\n batch.forEach(b => b.resolve());\n return;\n }\n\n const allKeys = [...new Set(batch.flatMap(b => b.keys))];\n const missing = allKeys.filter(k => !isKeyImplicitlyLoaded(k));\n\n logDebug(`flushBatch allKeys=[${allKeys.join(', ')}] missing=[${missing.join(', ')}]`);\n\n if (missing.length === 0) {\n batch.forEach(b => b.resolve());\n return;\n }\n\n const language = currentLanguageRef.current;\n logDebug('Flushing lazy i18n batch', { keys: missing, language });\n\n const MAX_KEYS_PER_REQUEST = 30;\n const chunks: string[][] = [];\n for (let i = 0; i < missing.length; i += MAX_KEYS_PER_REQUEST) {\n chunks.push(missing.slice(i, i + MAX_KEYS_PER_REQUEST));\n }\n\n try {\n logDebug(`getI18nLabelsByKeys language=${language} chunks=${chunks.map(chunk => `[${chunk.join(', ')}]`).join(', ')}`);\n const merged = await fetchLazyLabelsWithFallback(language, chunks);\n\n if (language !== currentLanguageRef.current) {\n logDebug('Discarding stale lazy i18n response', { fetchedFor: language, currentLanguage: currentLanguageRef.current });\n batch.forEach(b => b.resolve());\n return;\n }\n\n setTranslations(prev => deepMergeTranslations(prev, merged));\n\n for (const key of missing) {\n loadedKeysRef.current.add(key);\n pendingKeysRef.current.delete(key);\n replayPendingLazyKeys.delete(key);\n }\n\n batch.forEach(b => b.resolve());\n } catch (error) {\n for (const key of missing) {\n pendingKeysRef.current.delete(key);\n // SETTLED, not loaded. Readiness resolves so no surface waits forever on a bundle that is\n // not coming; the key stays out of `loadedKeysRef`, so a later request retries it and a\n // lookup still reports the label as missing rather than inventing one.\n failedKeysRef.current.add(key);\n }\n // The ref alone is invisible to React — see `failedKeysVersion`.\n setFailedKeysVersion(version => version + 1);\n batch.forEach(b => b.reject(error));\n reportError(error, `Failed to load translation keys: ${missing.join(', ')}`, { keys: missing, language });\n }\n };\n\n /**\n * Find the pending promise for a key, checking the key itself then its ancestors.\n * Returns the promise if the key (or an ancestor) is in-flight, undefined otherwise.\n */\n const findPendingPromise = (key: string): Promise<void> | undefined => {\n const direct = pendingKeysRef.current.get(key);\n if (direct) return direct;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n const ancestorPromise = pendingKeysRef.current.get(ancestor);\n if (ancestorPromise) return ancestorPromise;\n }\n\n return undefined;\n };\n\n const requestKeys = useCallback((keys: string | string[]): Promise<void> => {\n if (fullLoadCompletedRef.current) return Promise.resolve();\n\n const keyArray = typeof keys === 'string' ? [keys] : keys;\n const needed = keyArray.filter(k => !isKeyImplicitlyLoaded(k));\n\n logDebug(`requestKeys keyArray=[${keyArray.join(', ')}] needed=[${needed.join(', ')}]`);\n\n if (needed.length === 0) return Promise.resolve();\n\n const alreadyPending = needed.filter(k => isKeyImplicitlyPending(k));\n const brandNew = needed.filter(k => !isKeyImplicitlyPending(k));\n\n logDebug(`requestKeys pending=[${alreadyPending.join(', ')}] brandNew=[${brandNew.join(', ')}]`);\n\n for (const key of brandNew) {\n replayPendingLazyKeys.add(key);\n }\n\n if (brandNew.length === 0) {\n return Promise.all(alreadyPending.map(k => findPendingPromise(k)!)).then(() => {});\n }\n\n const promise = new Promise<void>((resolve, reject) => {\n batchQueueRef.current.push({ keys: brandNew, resolve, reject });\n\n if (batchTimerRef.current === null) {\n batchTimerRef.current = setTimeout(flushBatch, 16);\n }\n });\n\n /*\n * The STORED copies are observed here, and that is not defensive tidying.\n *\n * This one promise is stored under every requested key and handed to later callers by\n * `findPendingPromise`. When the batch rejects, each of those copies is a rejected promise that\n * nobody necessarily awaits — a caller that fired and forgot, or a key whose only waiter has\n * unmounted — so a failed bundle floated one unhandled rejection per key to the window. The\n * `await` paths still see the rejection; this only marks it observed.\n */\n promise.catch(() => undefined);\n\n for (const k of brandNew) {\n pendingKeysRef.current.set(k, promise);\n }\n\n if (envLoader.isDevelopment()) {\n logDebug(`DEV immediate lazy flush [${brandNew.join(', ')}]`);\n void flushBatch();\n }\n\n if (alreadyPending.length > 0) {\n const pendingPromises = alreadyPending.map(k => findPendingPromise(k)!);\n return Promise.all([promise, ...pendingPromises]).then(() => {});\n }\n\n return promise;\n }, [currentLanguage, reportError]);\n\n useEffect(() => {\n if (replayPendingLazyKeys.size === 0) return;\n const keys = Array.from(replayPendingLazyKeys);\n logDebug(`Replaying pending lazy keys after remount [${keys.join(', ')}]`);\n /*\n * Fire-and-forget, so the rejection has to be observed HERE. A replay whose bundle is down\n * rejects with nobody awaiting it, which reaches the window as an unhandled rejection — noise\n * that says nothing, because the failure is already recorded by `flushBatch` (the keys enter\n * `failedKeysRef`, readiness settles, and the error is reported once).\n */\n void requestKeys(keys).catch(() => undefined);\n }, [requestKeys]);\n\n const isKeyLoaded = useCallback((key: string): boolean => {\n return isKeyImplicitlyLoaded(key);\n }, []);\n\n const isKeySettledCallback = useCallback((key: string): boolean => {\n return isKeySettled(key);\n }, []);\n\n const getKeyStatus = useCallback((key: string): 'loaded' | 'pending' | 'not-requested' => {\n if (isKeyImplicitlyLoaded(key)) return 'loaded';\n if (isKeyImplicitlyPending(key)) return 'pending';\n return 'not-requested';\n }, []);\n\n const requestComponentKeys = useCallback((componentType: FrontendComponentType | FrontendComponentType[]): Promise<void> => {\n const types = Array.isArray(componentType) ? componentType : [componentType];\n return requestKeys(types.map(ct => `${LabellingTypes.COMPONENTS}.${ct}`));\n }, [requestKeys]);\n\n const requestResourceKeys = useCallback((resourceType: string | string[]): Promise<void> => {\n const types = Array.isArray(resourceType) ? resourceType : [resourceType];\n return requestKeys(types.map(rt => `${LabellingTypes.RESOURCES}.${rt}`));\n }, [requestKeys]);\n\n // -------------------------------------------------------\n\n const loadTranslations = async (language: AvailableLanguage): Promise<void> => {\n\n if (!appIsInitialized) {\n logDebug('Waiting for app config to be ready before loading translations');\n return;\n }\n\n if (loadingLanguageRef.current === language) {\n logDebug(`Already loading translations for ${language}, skipping duplicate call`);\n return;\n }\n\n if (loadedLanguagesRef.current.has(language)) {\n logDebug(`Translations for ${language} already loaded, skipping duplicate call`);\n return;\n }\n\n const loadingIdentifier = isInitializedRef.current\n ? AppLoadingIdentifier.I18N_LANGUAGE_CHANGE\n : AppLoadingIdentifier.INIT_I18N;\n logDebug(`Starting translation loading for ${language}`);\n loadingLanguageRef.current = language;\n setIsLoading(true);\n\n emit(FrontendEvents.LOADING_CUSTOM_START, {\n identifier: loadingIdentifier,\n data: { language },\n tier: LoadingTier.APPLICATION,\n });\n\n try {\n\n const responseLabels = await fetchEagerLabelsWithFallback(\n language,\n EAGER_I18N_SECTIONS as string[],\n );\n\n if (language !== currentLanguageRef.current) {\n logDebug('Discarding stale translation response', { fetchedFor: language, currentLanguage: currentLanguageRef.current });\n return;\n }\n\n // Deep-merge, not replace. During language change, lazy batch requests\n // (via useI18n deps effects) may resolve concurrently with this eager\n // load. Using replace would wipe lazy data that arrived first.\n setTranslations(prev => deepMergeTranslations(prev, responseLabels));\n\n loadedLanguagesRef.current.add(language);\n\n for (const section of EAGER_I18N_SECTIONS) {\n loadedKeysRef.current.add(section);\n }\n\n // Do NOT set fullLoadCompletedRef.current = true.\n // With fullLoadCompleted = false, requestKeys no longer short-circuits,\n // isKeyLoaded returns false for unloaded sections, and the microbatch\n // system becomes the primary loader for per-component translations.\n\n logDebug('Eager i18n sections loaded', {\n language,\n sections: EAGER_I18N_SECTIONS,\n fallbackLanguage: shouldLoadFallbackLayer(language) ? configFallbackLanguage : undefined,\n });\n\n if (!isInitializedRef.current) {\n isInitializedRef.current = true;\n markComponentInitialized(MainContextInitComponents.I18N);\n }\n\n } catch (error) {\n reportError(error, `Failed to load translations for language: ${language}`, { language });\n loadedKeysRef.current.clear();\n pendingKeysRef.current.clear();\n setTranslations({});\n\n } finally {\n loadingLanguageRef.current = null;\n setIsLoading(false);\n\n emit(FrontendEvents.LOADING_CUSTOM_END, {\n identifier: loadingIdentifier,\n data: { language },\n tier: LoadingTier.APPLICATION,\n });\n }\n };\n\n const t = (key: string, params?: Record<string, string | number>): string => {\n const keys = key.split('.');\n let value: any = translations;\n\n // Navigate through nested translation object\n for (const k of keys) {\n value = value?.[k];\n if (value === undefined) break;\n }\n\n const result = typeof value === 'string' ? value : key;\n\n // Canonical single-brace `{param}` substitution shared with the backend\n // label/email interpolator. NOTE: this previously matched DOUBLE braces\n // (`{{param}}`), which never matched any content (every locale file and the\n // generator emit single braces) — so no frontend param ever interpolated.\n // Do NOT reintroduce a local replace loop here; the one contract lives in\n // `interpolateLabelParams`.\n return interpolateLabelParams(result, params);\n };\n\n // ------------------------------\n // Labelling-based helper builders\n // ------------------------------\n\n const tResourceHeader: I18nContextType['tResourceHeader'] = (resource, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.header.${key}`;\n return t(base, params);\n };\n\n const tResourceEmptyState: I18nContextType['tResourceEmptyState'] = (resource, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.emptyState.${key}`;\n const result = t(base, params);\n // Return empty string when translation is missing (key path returned as-is) so callers can fall back gracefully\n if (result === base) return '';\n return result;\n };\n\n const tResourceOperation: I18nContextType['tResourceOperation'] = (resource, operation, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.operations.${operation}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n const tResourceFieldDisplay: I18nContextType['tResourceFieldDisplay'] = (resource, fieldPath, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.fields.${fieldPath}.display.${key}`;\n const result = t(base, params);\n // Fallback: if translation not found, return formatted field name for 'label', empty for description/tooltip\n if (result === base) {\n return key === 'label' ? AutomatedLayoutFrontendUtils.unresolvedFieldLabel(fieldPath) : '';\n }\n return result;\n };\n\n const tResourceFieldEdit: I18nContextType['tResourceFieldEdit'] = (resource, fieldPath, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.fields.${fieldPath}.edit.${key}`;\n const result = t(base, params);\n // Fallback: if translation not found, return formatted field name for 'label', empty for description/placeholder/tooltip\n if (result === base) {\n return key === 'label' ? AutomatedLayoutFrontendUtils.unresolvedFieldLabel(fieldPath) : '';\n }\n return result;\n };\n\n const tResourceFieldEnumValue: I18nContextType['tResourceFieldEnumValue'] = (resource, fieldPath, enumValue) => {\n // 1. Try resource-field-specific label (allows per-resource overrides)\n const resourceKey = `${LabellingTypes.RESOURCES}.${resource}.fields.${fieldPath}.enum.${enumValue}`;\n const resourceResult = t(resourceKey);\n if (resourceResult !== resourceKey) return resourceResult;\n\n // 2. Auto-cascade: when resource-field key is missing, check system enum labels.\n // Backend skips generating per-resource keys for system enum fields, so the\n // resource key will be missing → we transparently resolve via system_enums.\n for (const enumName of SYSTEM_ENUM_NAMES) {\n const systemKey = `${LabellingTypes.SYSTEM_ENUMS}.${enumName}.${enumValue}`;\n const systemResult = t(systemKey);\n if (systemResult !== systemKey) return systemResult;\n }\n\n // 3. Fallback to raw enum value\n return enumValue;\n };\n\n const tErrorValidation: I18nContextType['tErrorValidation'] = (zodIssueCode, ref, params) => {\n const base = `${LabellingTypes.ERRORS_VALIDATION}.${zodIssueCode}.${ref}`;\n return t(base, params);\n };\n\n const tComponent: I18nContextType['tComponent'] = (componentType, key, params) => {\n const base = `${LabellingTypes.COMPONENTS}.${componentType}.${key}`;\n return t(base, params);\n };\n\n const tErrorMessage: I18nContextType['tErrorMessage'] = (errorRef, key = 'msg', params) => {\n const base = `${LabellingTypes.ERRORS_MESSAGES}.${errorRef}.${key}`;\n return t(base, params);\n };\n\n /**\n * Resolve error guidance label from `errors_guidance.{guidanceKey}.{field}`.\n * Returns empty string when the label is missing (unlike `t` which returns the key path).\n */\n const tErrorGuidance: I18nContextType['tErrorGuidance'] = (guidanceKey, field, params) => {\n const base = `${LabellingTypes.ERRORS_GUIDANCE}.${guidanceKey}.${field}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n const tNotificationCustom: I18nContextType['tNotificationCustom'] = (notificationRef, key = 'msg', params) => {\n const base = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${notificationRef}.${key}`;\n return t(base, params);\n };\n\n const tSystemEnum: I18nContextType['tSystemEnum'] = (enumName, enumValue) => {\n const base = `${LabellingTypes.SYSTEM_ENUMS}.${enumName}.${enumValue}`;\n const result = t(base);\n // If translation not found, fallback to enum value\n return result === base ? enumValue : result;\n };\n\n // Resource layout labels.\n // Path: resources.{resourceType}.sections.{sectionRef}.{title|description}\n const tResourceSection: I18nContextType['tResourceSection'] = (resource, sectionRef, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.sections.${sectionRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // Path: resources.{resourceType}.wizardSteps.{stepRef}.{title|description}\n const tResourceWizardStep: I18nContextType['tResourceWizardStep'] = (resource, stepRef, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.wizardSteps.${stepRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // Path: sidebar_sections.{sectionRef}.{title|description}\n // Falls back to sectionRef if translation not found\n const tSidebarSection: I18nContextType['tSidebarSection'] = (sectionRef, key = 'title', params) => {\n const base = `${LabellingTypes.SIDEBAR_SECTIONS}.${sectionRef}.${key}`;\n const result = t(base, params);\n // If translation not found, fallback to humanized section ref\n return result === base ? sectionRef.charAt(0).toUpperCase() + sectionRef.slice(1).replace(/_/g, ' ') : result;\n };\n\n // Path: settings_hub.categories.{categoryRef}.label — falls back to the\n // authored label (the registry's own string) when no translation exists, so\n // the rail reads correctly before the companion generates the bundle.\n const tSettingsHubCategory: I18nContextType['tSettingsHubCategory'] = (categoryRef, fallbackLabel) => {\n const base = `${LabellingTypes.SETTINGS_HUB}.categories.${categoryRef}.label`;\n const result = t(base);\n return result === base ? fallbackLabel : result;\n };\n\n // Path: settings_hub.sections.{sectionRef}.label — same authored-label fallback.\n const tSettingsHubSection: I18nContextType['tSettingsHubSection'] = (sectionRef, fallbackLabel) => {\n const base = `${LabellingTypes.SETTINGS_HUB}.sections.${sectionRef}.label`;\n const result = t(base);\n return result === base ? fallbackLabel : result;\n };\n\n const tCompositeView: I18nContextType['tCompositeView'] = (\n translationRef,\n key,\n params,\n ) => {\n const base = `${LabellingTypes.COMPOSITE_VIEWS}.${translationRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n const tCompositeViewSection: I18nContextType['tCompositeViewSection'] = (\n translationRef,\n sectionRef,\n key,\n params,\n ) => {\n const base = `${LabellingTypes.COMPOSITE_VIEWS}.${translationRef}.sections.${sectionRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // `key` accepts ANY view-local label ref, not just 'title' | 'description'.\n // Framework chrome resolves title/description; custom views (e.g. a resource-\n // owned EXECUTION view) declare their own refs that the labelling pipeline\n // generates under `views.{family}.{translationRef}.{ref}`. Missing keys return\n // '' (caller decides the fallback), same contract as before.\n const tView: I18nContextType['tView'] = (\n family,\n translationRef,\n key,\n params,\n ) => {\n const base = `${LabellingTypes.VIEWS}.${family}.${translationRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // ------------------------------\n // Guidance helpers\n // ------------------------------\n\n const tGuidanceFlow: I18nContextType['tGuidanceFlow'] = (flowRef, key, params) =>\n t(`guidance.${flowRef}.${key}`, params);\n\n const tGuidanceElement: I18nContextType['tGuidanceElement'] = (flowRef, elementRef, key, params) => {\n const fullKey = `guidance.${flowRef}.elements.${elementRef}.${key}`;\n const result = t(fullKey, params);\n return result === fullKey ? undefined : result;\n };\n\n const tGuidanceTourStep: I18nContextType['tGuidanceTourStep'] = (flowRef, elementRef, stepRef, key, params) => {\n const fullKey = `guidance.${flowRef}.elements.${elementRef}.tour_steps.${stepRef}.${key}`;\n const result = t(fullKey, params);\n return result === fullKey ? undefined : result;\n };\n\n const tGuidanceSurveyQuestion: I18nContextType['tGuidanceSurveyQuestion'] = (flowRef, elementRef, questionId, key, params) => {\n const fullKey = `guidance.${flowRef}.elements.${elementRef}.survey_questions.${questionId}.${key}`;\n const result = t(fullKey, params);\n return result === fullKey ? undefined : result;\n };\n\n const makeTrGuidanceElement: I18nContextType['makeTrGuidanceElement'] = (flowRef, elementRef) =>\n (key, params) => tGuidanceElement(flowRef, elementRef, key, params);\n\n // ------------------------------\n // Milestone helpers\n // ------------------------------\n\n const tMilestone: I18nContextType['tMilestone'] = (milestoneRef, key, params) =>\n t(`milestones.${milestoneRef}.${key}`, params);\n\n const tMilestoneReward: I18nContextType['tMilestoneReward'] = (milestoneRef, key, params) =>\n t(`milestones.${milestoneRef}.reward.${key}`, params);\n\n const makeTrMilestone: I18nContextType['makeTrMilestone'] = (milestoneRef) =>\n (key, params) => tMilestone(milestoneRef, key, params);\n\n // ------------------------------\n // Lifecycle helpers\n // ------------------------------\n\n const tLifecycle: I18nContextType['tLifecycle'] = (key, params) =>\n t(`lifecycle.${key}`, params);\n\n const tLifecycleStage: I18nContextType['tLifecycleStage'] = (stage) =>\n t(`lifecycle.stage.${stage}.label`);\n\n const tActivationCriterion: I18nContextType['tActivationCriterion'] = (criterion) => {\n switch (criterion.criterionType) {\n case ActivationCriterionType.MILESTONE:\n return tMilestone(criterion.milestoneRef, 'title');\n case ActivationCriterionType.GUIDANCE_COMPLETED:\n return tGuidanceFlow(criterion.guidanceFlowRef, 'title');\n }\n };\n\n const tMilestoneCategory: I18nContextType['tMilestoneCategory'] = (category) => {\n const base = `${LabellingTypes.MILESTONES}.categories.${category}.label`;\n const result = t(base);\n return result === base ? unresolvedLabel(category) : result;\n };\n\n // ------------------------------\n // Billing helpers\n // ------------------------------\n\n const tBillingProduct: I18nContextType['tBillingProduct'] = (productKey, subKey) => {\n const base = `${LabellingTypes.BILLING_PRODUCTS}.${productKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'name' ? unresolvedLabel(productKey) : '') : result;\n };\n\n const tBillingFeature: I18nContextType['tBillingFeature'] = (featureKey, subKey) => {\n const base = `${LabellingTypes.BILLING_FEATURES}.${featureKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'label' ? unresolvedLabel(featureKey) : '') : result;\n };\n\n const tBillingLimit: I18nContextType['tBillingLimit'] = (limitKey, subKey) => {\n const base = `${LabellingTypes.BILLING_LIMITS}.${limitKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'label' ? unresolvedLabel(limitKey) : '') : result;\n };\n\n const tBillingCreditPool: I18nContextType['tBillingCreditPool'] = (poolKey, subKey) => {\n const base = `${LabellingTypes.BILLING_CREDIT_POOLS}.${poolKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'name' ? unresolvedLabel(poolKey) : '') : result;\n };\n\n // ------------------------------\n // Role helpers\n // ------------------------------\n\n const tRole: I18nContextType['tRole'] = (roleKey, subKey) => {\n const base = `${LabellingTypes.ROLES}.${roleKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'label' ? unresolvedLabel(roleKey) : '') : result;\n };\n\n // ------------------------------\n // Curried resource helpers\n // ------------------------------\n\n const makeTrResourceHeader: I18nContextType['makeTrResourceHeader'] = (resource) => (key = 'title', params) => {\n return tResourceHeader(resource, key, params);\n };\n\n const makeTrResourceEmptyState: I18nContextType['makeTrResourceEmptyState'] = (resource) => (key = 'title', params) => {\n return tResourceEmptyState(resource, key, params);\n };\n\n const makeTrResourceOperation: I18nContextType['makeTrResourceOperation'] = (resource) => (operation, key = 'title', params) => {\n return tResourceOperation(resource, operation, key, params);\n };\n\n const makeTrResourceFieldDisplay: I18nContextType['makeTrResourceFieldDisplay'] = (resource) => (fieldPath, key = 'label', params) => {\n return tResourceFieldDisplay(resource, fieldPath, key, params);\n };\n\n // Back-compat alias removed; use makeTrResourceFieldEdit instead\n\n const makeTrResourceFieldEnum: I18nContextType['makeTrResourceFieldEnum'] = (resource) => (fieldPath, enumValue) => {\n return tResourceFieldEnumValue(resource, fieldPath, enumValue);\n };\n\n // ------------------------------\n // Curried helpers for other LabellingTypes\n // ------------------------------\n\n const makeTrErrorMessage: I18nContextType['makeTrErrorMessage'] = (errorRef) => (key = 'msg', params) => {\n return tErrorMessage(errorRef, key, params);\n };\n\n const makeTrErrorGuidance: I18nContextType['makeTrErrorGuidance'] = (guidanceKey) => (field, params) => {\n return tErrorGuidance(guidanceKey, field, params);\n };\n\n const makeTrNotificationCustom: I18nContextType['makeTrNotificationCustom'] = (notificationRef) => (key = 'msg', params) => {\n return tNotificationCustom(notificationRef, key, params);\n };\n\n const makeTrErrorValidation: I18nContextType['makeTrErrorValidation'] = (zodIssueCode) => (ref, params) => {\n return tErrorValidation(zodIssueCode, ref, params);\n };\n\n const makeTrComponent: I18nContextType['makeTrComponent'] = (componentType) => (key, params) => {\n return tComponent(componentType, key, params);\n };\n\n const makeTrResourceFieldEdit: I18nContextType['makeTrResourceFieldEdit'] = (resource) => (fieldPath, key = 'label', params) => {\n return tResourceFieldEdit(resource, fieldPath, key, params);\n };\n\n const makeTrSystemEnum: I18nContextType['makeTrSystemEnum'] = (enumName) => (enumValue) => {\n return tSystemEnum(enumName, enumValue);\n };\n\n // Text direction from current language (for RTL layout)\n const dir = useMemo<TextDirection>(() => {\n const info = LANGUAGE_INFO_MAP[currentLanguage];\n return info?.direction ?? TextDirection.LTR;\n }, [currentLanguage]);\n\n useEffect(() => {\n document.documentElement.dir = dir;\n }, [dir]);\n\n /**\n * Regional formatting (absorbed from ComponentsLabellingContext), resolved\n * MEMBER -> ORGANIZATION -> FRAMEWORK, per field (#410).\n *\n * The precedence itself lives in `resolveRegionalFormatting`, which carries the reasoning and the\n * pins. Keeping it out of this `useMemo` body is deliberate: it is the one part of this that a\n * test can hold still while the React plumbing around it changes.\n */\n const resolvedRegionalPreferences = useMemo<RegionalFormattingConfig>(\n () => resolveRegionalFormatting(regionalPreferences, organizationRegionalPreferences, currentLanguage),\n [regionalPreferences, organizationRegionalPreferences, currentLanguage],\n );\n\n const formatDate = useCallback((value: Date | string | number): string =>\n RegionalFormattingUtils.formatDate(value, resolvedRegionalPreferences), [resolvedRegionalPreferences]);\n\n const formatTime = useCallback((value: Date | string | number): string =>\n RegionalFormattingUtils.formatTime(value, resolvedRegionalPreferences), [resolvedRegionalPreferences]);\n\n const formatDateTime = useCallback((value: Date | string | number): string =>\n RegionalFormattingUtils.formatDateTime(value, resolvedRegionalPreferences), [resolvedRegionalPreferences]);\n\n const formatNumber = useCallback((value: number, options?: Intl.NumberFormatOptions): string =>\n RegionalFormattingUtils.formatNumber(value, resolvedRegionalPreferences, options), [resolvedRegionalPreferences]);\n\n const hasComponentTranslations = useCallback((componentType: FrontendComponentType): boolean => {\n const componentPath = `${LabellingTypes.COMPONENTS}.${componentType}`;\n const keys = componentPath.split('.');\n let value: any = translations;\n for (const k of keys) {\n value = value?.[k];\n if (value === undefined) return false;\n }\n return typeof value === 'object' && value !== null && Object.keys(value).length > 0;\n }, [translations]);\n\n const getComponentKeys = useCallback((componentType: FrontendComponentType): string[] => {\n const componentPath = `${LabellingTypes.COMPONENTS}.${componentType}`;\n const keys = componentPath.split('.');\n let value: any = translations;\n for (const k of keys) {\n value = value?.[k];\n if (value === undefined) return [];\n }\n return typeof value === 'object' && value !== null ? Object.keys(value) : [];\n }, [translations]);\n\n const value: I18nContextType = {\n // State\n currentLanguage,\n dir,\n translations,\n isLoading,\n availableLanguages: getPolicyAvailableLanguages(),\n\n // Language config flags\n enableLanguageSwitcher: configEnableLanguageSwitcher,\n allowUserOverride: effectiveAllowUserOverride,\n\n // Preferences\n languagePreferences,\n regionalPreferences,\n\n // Actions\n changeLanguage,\n loadTranslations,\n\n // Helpers\n t,\n getLanguageName,\n isLanguageSupported,\n\n // Preference getters\n getLanguagePreferences,\n getRegionalPreferences,\n tResourceHeader,\n tResourceEmptyState,\n tResourceOperation,\n tResourceFieldDisplay,\n tResourceFieldEdit,\n tResourceFieldEnumValue,\n tErrorValidation,\n tComponent,\n tErrorMessage,\n tErrorGuidance,\n tNotificationCustom,\n tSystemEnum,\n tResourceSection,\n tResourceWizardStep,\n tSidebarSection,\n tSettingsHubCategory,\n tSettingsHubSection,\n tCompositeView,\n tCompositeViewSection,\n tView,\n makeTrResourceHeader,\n makeTrResourceEmptyState,\n makeTrResourceOperation,\n makeTrResourceFieldDisplay,\n makeTrResourceFieldEnum,\n makeTrResourceFieldEdit,\n makeTrErrorMessage,\n makeTrErrorGuidance,\n makeTrNotificationCustom,\n makeTrErrorValidation,\n makeTrComponent,\n makeTrSystemEnum,\n tGuidanceFlow,\n tGuidanceElement,\n tGuidanceTourStep,\n tGuidanceSurveyQuestion,\n makeTrGuidanceElement,\n tMilestone,\n tMilestoneReward,\n makeTrMilestone,\n tLifecycle,\n tLifecycleStage,\n tActivationCriterion,\n tMilestoneCategory,\n tBillingProduct,\n tBillingFeature,\n tBillingLimit,\n tBillingCreditPool,\n tRole,\n resolvedRegionalPreferences,\n formatDate,\n formatTime,\n formatDateTime,\n formatNumber,\n hasComponentTranslations,\n getComponentKeys,\n requestKeys,\n isKeyLoaded,\n isKeySettled: isKeySettledCallback,\n getKeyStatus,\n requestComponentKeys,\n requestResourceKeys,\n };\n\n return (\n <DirectionProvider dir={dir}>\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n </DirectionProvider>\n );\n};\n\n// useI18n hook is now in separate file: ./useI18n.ts\n// This separation is required for React Fast Refresh compatibility\n\n/*\nUsage examples\n--------------\n\nBasic\nconst { t } = useI18n();\nt('resources.todos.title');\n\nDirect helpers (non-curried)\nconst {\n tResourceHeader,\n tResourceEmptyState,\n tResourceOperation,\n tResourceFieldDisplay,\n tResourceFieldEdit,\n tResourceFieldEnumValue,\n tErrorValidation,\n tComponent,\n tErrorMessage,\n tNotificationCustom,\n tSystemEnum,\n} = useI18n();\n\n// Resources\ntResourceHeader('todos', 'title');\ntResourceEmptyState('todos', 'title');\ntResourceOperation('todos', 'create', 'title');\ntResourceFieldDisplay('todos', 'description', 'label');\ntResourceFieldEdit('todos', 'description', 'placeholder');\ntResourceFieldEnumValue('todos', 'status', 'pending');\n\n// Components\ntComponent('LOW_LEVEL_BUTTON', 'label');\n\n// Errors validation\ntErrorValidation('invalid_string', 'msg', { validation: 'email' });\n\n// Errors messages\ntErrorMessage('authentication'); // defaults to 'msg'\ntErrorMessage('authentication', 'msg');\n\n// Notifications custom\ntNotificationCustom('A_TEMP_REF'); // defaults to 'msg'\ntNotificationCustom('A_TEMP_REF', 'msg');\n\n// System enums (global application-scope enums)\ntSystemEnum(SystemEnumName.AVAILABLE_LANGUAGE, 'en');\ntSystemEnum(SystemEnumName.COMMON_TIMEZONE, 'America/New_York');\ntSystemEnum(SystemEnumName.AVAILABLE_CURRENCY, 'USD');\ntSystemEnum(SystemEnumName.AVAILABLE_COUNTRY, 'US');\ntSystemEnum(SystemEnumName.MONTH, 'JANUARY');\n\n// Sidebar sections (dynamic, based on configured contentSections)\n// Translation keys are dynamically populated based on config\nconst { tSidebarSection } = useI18n();\ntSidebarSection('main'); // defaults to 'title' -> \"Main\"\ntSidebarSection('main', 'title'); // \"Main\"\ntSidebarSection('main', 'description'); // \"Main navigation items\"\ntSidebarSection('tools'); // \"Tools\"\ntSidebarSection('my_custom_section'); // Falls back to \"My custom section\" if not translated\n\nCurried helpers (two-step)\nconst {\n makeTrResourceHeader,\n makeTrResourceOperation,\n makeTrResourceFieldDisplay,\n makeTrResourceFieldEdit,\n makeTrResourceFieldEnum,\n makeTrErrorMessage,\n makeTrNotificationCustom,\n makeTrErrorValidation,\n makeTrComponent,\n makeTrSystemEnum,\n} = useI18n();\n\n// Resources\nconst trTodosHeader = makeTrResourceHeader('todos');\ntrTodosHeader(); // defaults to 'title'\ntrTodosHeader('description');\n\nconst trTodosOp = makeTrResourceOperation('todos');\ntrTodosOp('create'); // defaults to 'title'\n\nconst trTodosDisplay = makeTrResourceFieldDisplay('todos');\ntrTodosDisplay('description'); // defaults to 'label'\n\nconst trTodosEdit = makeTrResourceFieldEdit('todos');\ntrTodosEdit('description'); // defaults to 'label'\ntrTodosEdit('description', 'placeholder');\ntrTodosEdit('description', 'tooltip');\n\nconst trTodosEnum = makeTrResourceFieldEnum('todos');\ntrTodosEnum('status', 'pending');\n\n// Errors messages\nconst trErrAuth = makeTrErrorMessage('authentication');\ntrErrAuth(); // defaults to 'msg'\n\n// Notifications custom\nconst trNotif = makeTrNotificationCustom('A_TEMP_REF');\ntrNotif(); // defaults to 'msg'\n\n// Errors validation\nconst trInvalidString = makeTrErrorValidation('invalid_string');\ntrInvalidString('msg', { validation: 'email' });\n\n// Components\nconst trButton = makeTrComponent('LOW_LEVEL_BUTTON');\ntrButton('label');\n\n// System enums (curried)\nconst trLanguage = makeTrSystemEnum(SystemEnumName.AVAILABLE_LANGUAGE);\ntrLanguage('en'); // 'English'\ntrLanguage('fr'); // 'French'\n\nconst trTimezone = makeTrSystemEnum(SystemEnumName.COMMON_TIMEZONE);\ntrTimezone('America/New_York'); // 'Eastern Time'\n\nconst trMonth = makeTrSystemEnum(SystemEnumName.MONTH);\ntrMonth('JANUARY'); // 'January'\n*/\n"]}
|
|
1
|
+
{"version":3,"file":"I18nContext.js","sourceRoot":"","sources":["../../../../src/core/i18n/I18nContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,QAAQ,EAAa,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACvH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AACrG,OAAO,EACL,cAAc,EAAyB,iBAAiB,EAAE,iBAAiB,EAC3D,iBAAiB,EAA0B,aAAa,EACzC,uBAAuB,EACtD,mBAAmB,GAEpB,MAAM,qCAAqC,CAAC;AA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BAAoB;QACpB,mBAAmB;QACnB,cAAc;QACd,qBAAqB;QACrB,KAAK;QACL,oBAAoB;QACpB,wBAAwB;QACxB,uBAAuB;QACvB,0BAA0B;QAC1B,uBAAuB;QACvB,uBAAuB;QACvB,kBAAkB;QAClB,mBAAmB;QACnB,wBAAwB;QACxB,qBAAqB;QACrB,eAAe;QACf,gBAAgB;QAChB,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,uBAAuB;QACvB,qBAAqB;QACrB,UAAU;QACV,gBAAgB;QAChB,eAAe;QACf,UAAU;QACV,eAAe;QACf,oBAAoB;QACpB,kBAAkB;QAClB,eAAe;QACf,eAAe;QACf,aAAa;QACb,kBAAkB;QAClB,KAAK;QACL,2BAA2B;QAC3B,UAAU;QACV,UAAU;QACV,cAAc;QACd,YAAY;QACZ,wBAAwB;QACxB,gBAAgB;QAChB,WAAW;QACX,WAAW;QACX,YAAY,EAAE,oBAAoB;QAClC,YAAY;QACZ,oBAAoB;QACpB,mBAAmB;KACpB,CAAC;IAEF,OAAO,CACL,KAAC,iBAAiB,IAAC,GAAG,EAAE,GAAG,YACzB,KAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAC/B,QAAQ,GACY,GACL,CACrB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { createContext, useState, ReactNode, useEffect, useMemo, useRef, useCallback, useContext } from 'react';\nimport { DirectionProvider } from '@radix-ui/react-direction';\nimport { LOCAL_STORAGE_KEYS } from '~wildo-frontend-lib/core/commons/local-storage.frontend.schemas';\nimport {\n LabellingTypes, FrontendComponentType, AvailableLanguage, LANGUAGE_INFO_MAP,\n SystemEnumName, SYSTEM_ENUM_NAMES, DateFormat, TimeFormat, TextDirection,\n type RegionalFormattingConfig, RegionalFormattingUtils,\n EAGER_I18N_SECTIONS,\n NavigationViewLabelFamily,\n} from '@wildo-ai/presets-components-models';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport { MainContextInitComponents } from '~wildo-frontend-lib/core/runtime/runtime.frontend.schemas';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { ErrorContext } from '~wildo-frontend-lib/core/errors/ErrorContext';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { FrontendEvents, type FrontendEventPayloads } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { LoadingTier, AppLoadingIdentifier } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { envLoader } from '~wildo-frontend-lib/core/runtime/env-variable-loader.frontend.service';\nimport {\n OrganizationLanguagePreferences,\n OrganizationRegionalPreferences,\n UserLanguagePreferences,\n UserPreferences,\n type ActivationCriterion,\n ActivationCriterionType,\n interpolateLabelParams,\n} from '@wildo-ai/saas-models';\nimport { resolveRegionalFormatting } from './regional-preference-resolution.frontend.utils';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\n\n/**\n * Internationalization Context\n * Manages language selection and translations\n *\n * INTEGRATION WITH APPLICATION MAIN CONTEXT:\n *\n * This context integrates with ApplicationMainContext initialization system.\n * It automatically detects when app config is ready and loads translations.\n * Marks MainContextInitComponents.I18N as initialized when complete.\n *\n * Language Management:\n * - Effective language resolves from app config, user preferences,\n * organization policy, localStorage, and browser detection.\n * - Translations load automatically when app config is ready.\n * - Missing active-locale keys fall back through the configured fallback language.\n * - Uses ErrorContext for error handling and real backend translations.\n */\n\nexport interface Translation {\n [key: string]: string | Translation;\n}\n\nexport { TextDirection } from '@wildo-ai/presets-components-models';\n\nexport interface I18nContextType {\n // State\n currentLanguage: AvailableLanguage;\n /** Text direction derived from current language (LANGUAGE_INFO_MAP). Use for RTL layout. */\n dir: TextDirection;\n translations: Translation;\n isLoading: boolean;\n availableLanguages: AvailableLanguage[];\n\n // Language config flags (from appConfig.appPreferences.languages)\n enableLanguageSwitcher: boolean;\n allowUserOverride: boolean;\n\n // Preferences (synced from UserOrgsContext via events)\n languagePreferences: UserLanguagePreferences | null;\n regionalPreferences: UserPreferences['regional'] | null;\n\n // Actions\n changeLanguage: (language: AvailableLanguage) => Promise<void>;\n loadTranslations: (language: AvailableLanguage) => Promise<void>;\n\n // Helpers\n t: (key: string, params?: Record<string, string | number>) => string;\n getLanguageName: (language: AvailableLanguage) => string;\n isLanguageSupported: (language: string) => boolean;\n\n // Preference getters\n getLanguagePreferences: () => UserLanguagePreferences | null;\n getRegionalPreferences: () => UserPreferences['regional'] | null;\n\n // Labelling helpers (structured keys)\n tResourceHeader : ( resource: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tResourceEmptyState : (resource: string, key: 'title' | 'description' | 'primaryActionLabel' | 'secondaryActionLabel', params?: Record<string, string | number>) => string;\n tResourceOperation : (resource: string, operation: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tResourceFieldDisplay : (resource: string, fieldPath: string, key: 'label' | 'description' | 'tooltip', params?: Record<string, string | number>) => string;\n tResourceFieldEdit : (resource: string, fieldPath: string, key: 'label' | 'description' | 'placeholder' | 'tooltip', params?: Record<string, string | number>) => string;\n tResourceFieldEnumValue : (resource: string, fieldPath: string, enumValue: string) => string;\n tErrorValidation : (zodIssueCode: string, ref: string, params?: Record<string, string | number>) => string;\n tComponent : (componentType: FrontendComponentType, key: string, params?: Record<string, string | number>) => string;\n tErrorMessage : (errorRef: string, key?: string, params?: Record<string, string | number>) => string;\n /** Resolve error guidance label: `errors_guidance.{guidanceKey}.{field}` — returns empty string when missing */\n tErrorGuidance : (guidanceKey: string, field: string, params?: Record<string, string | number>) => string;\n tNotificationCustom : (notificationRef: string, key?: string, params?: Record<string, string | number>) => string;\n tSystemEnum : (enumName: SystemEnumName, enumValue: string) => string;\n\n // Resource layout labels\n tResourceSection : (resource: string, sectionRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tResourceWizardStep : (resource: string, stepRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n\n // Sidebar section labels (dynamic, based on configured sections)\n tSidebarSection : (sectionRef: string, key?: 'title' | 'description', params?: Record<string, string | number>) => string;\n // Settings Hub category/section labels (dynamic, registry-driven). Fall back\n // to the authored label string when no translation is present.\n tSettingsHubCategory : (categoryRef: string, fallbackLabel: string) => string;\n tSettingsHubSection : (sectionRef: string, fallbackLabel: string) => string;\n tCompositeView : (translationRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tCompositeViewSection : (translationRef: string, sectionRef: string, key: 'title' | 'description', params?: Record<string, string | number>) => string;\n tView : (family: NavigationViewLabelFamily, translationRef: string, key: string, params?: Record<string, string | number>) => string;\n\n // Guidance helpers\n tGuidanceFlow: (flowRef: string, key: string, params?: Record<string, string | number>) => string;\n tGuidanceElement: (flowRef: string, elementRef: string, key: string, params?: Record<string, string | number>) => string | undefined;\n tGuidanceTourStep: (flowRef: string, elementRef: string, stepRef: string, key: string, params?: Record<string, string | number>) => string | undefined;\n tGuidanceSurveyQuestion: (flowRef: string, elementRef: string, questionId: string, key: string, params?: Record<string, string | number>) => string | undefined;\n makeTrGuidanceElement: (flowRef: string, elementRef: string) => (key: string, params?: Record<string, string | number>) => string | undefined;\n\n // Milestone helpers\n tMilestone: (milestoneRef: string, key: string, params?: Record<string, string | number>) => string;\n tMilestoneReward: (milestoneRef: string, key: string, params?: Record<string, string | number>) => string;\n makeTrMilestone: (milestoneRef: string) => (key: string, params?: Record<string, string | number>) => string;\n\n // Lifecycle helpers\n tLifecycle: (key: string, params?: Record<string, string | number>) => string;\n tLifecycleStage: (stage: string) => string;\n /** Resolve activation criterion label from its source domain (milestone title or guidance flow title) */\n tActivationCriterion: (criterion: ActivationCriterion) => string;\n /** Resolve shared milestone category label: milestones.categories.{category}.label */\n tMilestoneCategory: (category: string) => string;\n\n // Billing helpers\n tBillingProduct: (productKey: string, subKey: 'name' | 'description' | 'tagline') => string;\n tBillingFeature: (featureKey: string, subKey: 'label' | 'description') => string;\n tBillingLimit: (limitKey: string, subKey: 'label' | 'description' | 'unit') => string;\n tBillingCreditPool: (poolKey: string, subKey: 'name' | 'description' | 'unit') => string;\n\n // Role helpers\n /**\n * Resolve role label from `roles.<roleRef>.<label|description>`.\n * Mirrors the labelling-policy shape in `LabellingPolicy[ROLES]` and the\n * shared `tBilling*` precedent: returns the humanized roleRef when the\n * `label` key is missing and an empty string when `description` is missing.\n * `roleRef` here is the bi-scoped key (e.g. `app.OWNER`) used by the\n * `RoleSpecification` registry, matching what backend i18n collection emits.\n */\n tRole: (roleKey: string, subKey: 'label' | 'description') => string;\n\n // Regional formatting (absorbed from ComponentsLabellingContext)\n resolvedRegionalPreferences: RegionalFormattingConfig;\n formatDate: (value: Date | string | number) => string;\n formatTime: (value: Date | string | number) => string;\n formatDateTime: (value: Date | string | number) => string;\n formatNumber: (value: number, options?: Intl.NumberFormatOptions) => string;\n\n // Component translation utilities\n hasComponentTranslations: (componentType: FrontendComponentType) => boolean;\n getComponentKeys: (componentType: FrontendComponentType) => string[];\n\n /**\n * Request translation sub-trees by dot-path key(s).\n * Language-aware (uses currentLanguage), cached, deduplicated.\n * Already-loaded keys are skipped. In-flight keys are coalesced.\n * Resolves when ALL requested keys are loaded and merged into `translations`.\n *\n * @example\n * requestKeys('components.low_level_button');\n * requestKeys(['components.low_level_button', 'resources.todos']);\n */\n requestKeys: (keys: string | string[]) => Promise<void>;\n\n /** Check whether a dot-path key has been loaded (present in cache for the current language). */\n isKeyLoaded: (key: string) => boolean;\n\n /**\n * Is this key SETTLED — loaded, or failed and not coming?\n *\n * What a READINESS gate must ask. `isKeyLoaded` answers \"can I read a value\" and is right for a\n * lookup; a surface deciding whether to keep showing a skeleton needs to know that waiting longer\n * will not help. A failed bundle answers no to the first and yes to this, which is the difference\n * between a form that renders with missing labels and one that is a skeleton forever.\n */\n isKeySettled: (key: string) => boolean;\n\n /** Full lifecycle status of a key: loaded, pending (in-flight), or not-requested. */\n getKeyStatus: (key: string) => 'loaded' | 'pending' | 'not-requested';\n\n /** Convenience: request component translations by FrontendComponentType. */\n requestComponentKeys: (componentType: FrontendComponentType | FrontendComponentType[]) => Promise<void>;\n\n /** Convenience: request resource translations by resource type name. */\n requestResourceKeys: (resourceType: string | string[]) => Promise<void>;\n\n // Curried resource helpers (two-step usage in components)\n makeTrResourceHeader : (resource: string ) => (key?: 'title' | 'description', params?: Record<string, string | number>) => string;\n makeTrResourceEmptyState : (resource: string) => (key?: 'title' | 'description' | 'primaryActionLabel' | 'secondaryActionLabel', params?: Record<string, string | number>) => string;\n makeTrResourceOperation : (resource: string) => (operation: string, key?: 'title', params?: Record<string, string | number>) => string;\n makeTrResourceFieldDisplay : (resource: string) => (fieldPath: string, key?: 'label' | 'tooltip', params?: Record<string, string | number>) => string;\n makeTrResourceFieldEdit : (resource: string) => (fieldPath: string, key?: 'label' | 'placeholder' | 'tooltip', params?: Record<string, string | number>) => string;\n makeTrResourceFieldEnum : (resource: string) => (fieldPath: string, enumValue: string) => string;\n makeTrErrorMessage : ( errorRef: string) => (key?: string, params?: Record<string, string | number>) => string;\n makeTrErrorGuidance : (guidanceKey: string) => (field: string, params?: Record<string, string | number>) => string;\n makeTrNotificationCustom : ( notificationRef: string) => (key?: string, params?: Record<string, string | number>) => string;\n makeTrErrorValidation : ( zodIssueCode: string) => (ref: string, params?: Record<string, string | number>) => string;\n makeTrComponent : ( componentType: FrontendComponentType) => (key: string, params?: Record<string, string | number>) => string;\n makeTrSystemEnum : (enumName: SystemEnumName) => (enumValue: string) => string;\n}\n\n/**\n * What an unresolved catalogue label renders as — the RAW KEY, never words invented from it.\n *\n * These keys name things an operator authored (a billing product, a feature, a limit, a credit\n * pool, a role, a milestone category), and until 2026-09-08 a missing label was replaced by a\n * humanizer: `'ai_assistant'` became `'Ai Assistant'`, in English, in every locale. It read as a\n * finished surface, so nobody ever added the label — the whole defect #420 records. It was also\n * wrong on the cases it could not see (`GDPR` -> `Gdpr`, `EUR` -> `Eur`), because which all-caps\n * token is an acronym is not knowable from the string.\n *\n * The key itself is the honest rendering: visible, greppable, obviously not a label, and identical\n * in every locale because it is not a translation. It is what `t()` already returns for an\n * unresolved key, so this is the surrounding convention rather than a new one.\n *\n * It is only ever reached AFTER labels have settled — surfaces gate on `useI18n().isReady`, which\n * settles on a failed bundle as well as a loaded one, so a key is never flashed during the load.\n *\n * EXPORTED so the convention has one home. A second surface outside this module needs it —\n * `NavigationItemBadge`, whose accessible name falls back to a badge identity — and an inlined\n * `?? someKey` there would be the same decision taken twice, in a place where nothing records that\n * it IS a decision. Callers outside this file should reach it through the package root.\n */\nexport function unresolvedLabel(key: string): string {\n return key;\n}\n\n/**\n * I18n Context\n * Exported for use in separate hook file (Fast Refresh compatibility)\n * @internal - Use useI18n() hook instead of accessing this directly\n */\nexport const I18nContext: React.Context<I18nContextType | undefined> = createContext<I18nContextType | undefined>(undefined);\nconst allAvailableLanguages = Object.values(AvailableLanguage);\nconst replayPendingLazyKeys = new Set<string>();\n\nexport const I18nProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const isDebugging = false;\n const { appConfig, markComponentInitialized, isInitialized: appIsInitialized, logger } = useApplication();\n const errorContext = useContext(ErrorContext);\n const { on, emit } = useEventBus();\n\n // Extract language configuration from appConfig\n const languageConfig = appConfig?.appPreferences?.languages;\n const configDefaultLanguage = languageConfig?.defaultLanguage ?? AvailableLanguage.EN;\n const configEnabledLanguages = languageConfig?.enabledLanguages ?? allAvailableLanguages;\n const configFallbackLanguage = languageConfig?.fallbackLanguage ?? configDefaultLanguage;\n const configAutoDetect = languageConfig?.autoDetectFromBrowser ?? true;\n const configAllowUserOverride = languageConfig?.allowUserOverride ?? true;\n const configAllowOrganizationOverride = languageConfig?.allowOrganizationOverride ?? true;\n const configEnableLanguageSwitcher = languageConfig?.enableLanguageSwitcher ?? true;\n\n const [currentLanguage, setCurrentLanguage] = useState<AvailableLanguage>(configDefaultLanguage);\n const currentLanguageRef = useRef<AvailableLanguage>(configDefaultLanguage);\n const [translations, setTranslations] = useState<Translation>({});\n const [isLoading, setIsLoading] = useState(false);\n /**\n * Bumped when a key SETTLES as failed, purely to re-render.\n *\n * `failedKeysRef` is a ref, so recording a failure changes nothing a consumer can observe: the\n * success path re-renders through `setTranslations`, and without this the failure path had no\n * state update at all — readiness stayed false until something else happened to re-render, which\n * is indistinguishable from the hang this fixes. A counter rather than exposing the set, because\n * the set is read through `isKeySettled` and nothing should depend on its contents.\n */\n const [failedKeysVersion, setFailedKeysVersion] = useState(0);\n\n // Preferences state (synced from UserOrgsContext via events)\n const [languagePreferences, setLanguagePreferences] = useState<UserLanguagePreferences | null>(null);\n const [organizationLanguagePreferences, setOrganizationLanguagePreferences] = useState<OrganizationLanguagePreferences | null>(null);\n const [regionalPreferences, setRegionalPreferences] = useState<UserPreferences['regional'] | null>(null);\n /**\n * The tenant's regional answer — the layer BENEATH the member's own (#410).\n *\n * Held separately rather than merged into `regionalPreferences` on arrival, because merging\n * would destroy the distinction the resolution depends on: once the two are one object, nothing\n * downstream can tell a member's explicit `UTC` from a tenant's, and a member could never be\n * seen to have overridden anything.\n */\n const [organizationRegionalPreferences, setOrganizationRegionalPreferences] =\n useState<OrganizationRegionalPreferences | null>(null);\n\n const logDebug = logger.debugByType('I18nContext');\n logger.setDebugTypeLogging('I18nContext', isDebugging);\n\n const reportError = useCallback((error: unknown, customMessage: string, additionalContext?: Record<string, unknown>) => {\n if (errorContext) {\n errorContext.handleError(error, customMessage, additionalContext);\n return;\n }\n\n logger.error(customMessage, {\n originalError: error instanceof Error ? error.message : String(error),\n ...additionalContext,\n });\n }, [errorContext, logger]);\n\n const getPolicyAvailableLanguages = useCallback((\n orgPreferences: OrganizationLanguagePreferences | null = organizationLanguagePreferences,\n ): AvailableLanguage[] => {\n if (!configAllowOrganizationOverride || !orgPreferences) {\n return configEnabledLanguages;\n }\n\n const scopedLanguages = orgPreferences.supportedLanguages\n .filter((language): language is AvailableLanguage => configEnabledLanguages.includes(language));\n\n if (configEnabledLanguages.includes(orgPreferences.primaryLanguage) && !scopedLanguages.includes(orgPreferences.primaryLanguage)) {\n scopedLanguages.unshift(orgPreferences.primaryLanguage);\n }\n\n return scopedLanguages.length > 0 ? [...new Set(scopedLanguages)] : configEnabledLanguages;\n }, [configAllowOrganizationOverride, configEnabledLanguages, organizationLanguagePreferences]);\n\n const resolveEffectiveLanguage = useCallback((options?: {\n userPreferences?: UserLanguagePreferences | null;\n organizationPreferences?: OrganizationLanguagePreferences | null;\n savedLanguage?: AvailableLanguage | null;\n browserLanguage?: AvailableLanguage | null;\n }): AvailableLanguage => {\n const userPreferences = options?.userPreferences ?? languagePreferences;\n const organizationPreferences = configAllowOrganizationOverride\n ? (options?.organizationPreferences ?? organizationLanguagePreferences)\n : null;\n const availableLanguages = getPolicyAvailableLanguages(organizationPreferences);\n const supportsLanguage = (language: AvailableLanguage | null | undefined): language is AvailableLanguage =>\n !!language && availableLanguages.includes(language);\n const resolvedOrganizationPrimary = supportsLanguage(organizationPreferences?.primaryLanguage)\n ? organizationPreferences!.primaryLanguage\n : null;\n\n if (\n resolvedOrganizationPrimary\n && (\n organizationPreferences?.enforceForAllMembers\n || organizationPreferences?.allowUserOverride === false\n || userPreferences?.useOrganizationDefault === true\n )\n ) {\n return resolvedOrganizationPrimary;\n }\n\n if (configAllowUserOverride && supportsLanguage(userPreferences?.primaryLanguage)) {\n return userPreferences!.primaryLanguage;\n }\n\n if (configAllowUserOverride && supportsLanguage(options?.savedLanguage)) {\n return options!.savedLanguage!;\n }\n\n const shouldAutoDetect = configAllowUserOverride && (userPreferences?.autoDetect ?? configAutoDetect);\n if (shouldAutoDetect && supportsLanguage(options?.browserLanguage)) {\n return options!.browserLanguage!;\n }\n\n if (resolvedOrganizationPrimary) {\n return resolvedOrganizationPrimary;\n }\n\n if (supportsLanguage(configDefaultLanguage)) {\n return configDefaultLanguage;\n }\n\n return availableLanguages[0] ?? configDefaultLanguage;\n }, [\n configAllowOrganizationOverride,\n configAllowUserOverride,\n configAutoDetect,\n configDefaultLanguage,\n getPolicyAvailableLanguages,\n languagePreferences,\n organizationLanguagePreferences,\n ]);\n\n const effectiveAllowUserOverride = useMemo(() => {\n if (!configAllowUserOverride) {\n return false;\n }\n\n if (!configAllowOrganizationOverride || !organizationLanguagePreferences) {\n return true;\n }\n\n if (organizationLanguagePreferences.enforceForAllMembers) {\n return false;\n }\n\n if (!organizationLanguagePreferences.allowUserOverride) {\n return false;\n }\n\n if (languagePreferences?.useOrganizationDefault) {\n return false;\n }\n\n return true;\n }, [\n configAllowOrganizationOverride,\n configAllowUserOverride,\n languagePreferences?.useOrganizationDefault,\n organizationLanguagePreferences,\n ]);\n\n\n // Guards to prevent duplicate API calls\n const loadingLanguageRef = useRef<AvailableLanguage | null>(null);\n const loadedLanguagesRef = useRef<Set<AvailableLanguage>>(new Set());\n const isInitializedRef = useRef<boolean>(false);\n\n // --- Per-key lazy loading state ---\n /** Keys that have been fetched and merged for the current language. */\n const loadedKeysRef = useRef<Set<string>>(new Set());\n /**\n * In-flight key requests: key path → Promise.\n * Allows deduplication: if two components request the same key simultaneously,\n * the second one joins the first's pending promise instead of firing a new API call.\n */\n const pendingKeysRef = useRef<Map<string, Promise<void>>>(new Map());\n /**\n * Keys whose fetch FAILED, so readiness can settle without them.\n *\n * Deliberately separate from `loadedKeysRef`. A failed key is SETTLED — nothing is still in\n * flight, so a surface gating on `isReady` must proceed — but it is not LOADED, so a later\n * `requestKeys` retries it rather than skipping it as already present. Collapsing the two into\n * one set would buy simplicity and lose the retry.\n *\n * Before this existed, a failed fetch removed the key from `pendingKeysRef` and never added it\n * anywhere, so `isKeyImplicitlyLoaded` stayed false FOREVER and `isReady` never resolved. Any\n * surface gating on it — `AutomatedForm` renders a skeleton until `isReady` — was a PERMANENT\n * skeleton after one failed request. The form's own comment named the risk and avoided it by\n * gating on the component bundle only, which is why this had not bitten yet.\n */\n const failedKeysRef = useRef<Set<string>>(new Set());\n /**\n * Micro-batch timer. Calls to `requestKeys` within this window are coalesced\n * into a single API request to avoid per-component HTTP chatter.\n */\n const batchTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const batchQueueRef = useRef<{ keys: string[]; resolve: () => void; reject: (err: unknown) => void }[]>([]);\n /**\n * Legacy flag — kept `false` to activate per-component lazy loading.\n * With eager-core loading, `loadTranslations` only fetches `EAGER_I18N_SECTIONS`\n * and marks each section individually in `loadedKeysRef`. The microbatch system\n * handles all other sections via `requestKeys`.\n * Reset on language change.\n */\n const fullLoadCompletedRef = useRef<boolean>(false);\n\n const applyResolvedLanguage = useCallback((language: AvailableLanguage, options?: { persist?: boolean }): void => {\n if (language === currentLanguageRef.current) {\n if (options?.persist !== false) {\n localStorage.setItem(LOCAL_STORAGE_KEYS.LANGUAGE, language);\n }\n document.documentElement.lang = language;\n return;\n }\n\n if (batchTimerRef.current !== null) {\n clearTimeout(batchTimerRef.current);\n batchTimerRef.current = null;\n }\n batchQueueRef.current.forEach(b => b.resolve());\n batchQueueRef.current = [];\n loadedKeysRef.current.clear();\n pendingKeysRef.current.clear();\n fullLoadCompletedRef.current = false;\n loadedLanguagesRef.current.clear();\n setTranslations({});\n\n currentLanguageRef.current = language;\n setCurrentLanguage(language);\n\n if (options?.persist !== false) {\n localStorage.setItem(LOCAL_STORAGE_KEYS.LANGUAGE, language);\n }\n document.documentElement.lang = language;\n }, []);\n\n // Initialize language on mount (respects appConfig language preferences)\n useEffect(() => {\n const savedLanguage = localStorage.getItem(LOCAL_STORAGE_KEYS.LANGUAGE) as AvailableLanguage | null;\n const browserLanguage = navigator.language.split('-')[0] as AvailableLanguage;\n const initialLanguage = resolveEffectiveLanguage({\n savedLanguage,\n browserLanguage,\n });\n\n applyResolvedLanguage(initialLanguage);\n }, [applyResolvedLanguage, resolveEffectiveLanguage]);\n\n // Load translations when app config is ready and language is set\n useEffect(() => {\n logDebug('useEffect triggered', { appIsInitialized, currentLanguage, isCurrentlyLoading: loadingLanguageRef.current, alreadyLoaded: loadedLanguagesRef.current.has(currentLanguage), isInitialized: isInitializedRef.current });\n\n if (appIsInitialized && currentLanguage) {\n logDebug(`Attempting to load translations for ${currentLanguage} (triggered by useEffect)`);\n loadTranslations(currentLanguage);\n }\n }, [appIsInitialized, currentLanguage]);\n\n // Cleanup batch timer and resolve dangling promises on unmount\n useEffect(() => {\n return () => {\n if (batchTimerRef.current !== null) {\n clearTimeout(batchTimerRef.current);\n batchTimerRef.current = null;\n }\n batchQueueRef.current.forEach(b => b.resolve());\n batchQueueRef.current = [];\n };\n }, []);\n\n const getLanguageName = (language: AvailableLanguage, native: boolean = true): string => {\n const languageInfo = LANGUAGE_INFO_MAP[language];\n if (!languageInfo)\n return language;\n\n return native\n ? languageInfo.nativeName\n : languageInfo.name;\n };\n\n const isLanguageSupported = (language: string): boolean => {\n return getPolicyAvailableLanguages().includes(language as AvailableLanguage);\n };\n\n\n const changeLanguage = async (language: AvailableLanguage): Promise<void> => {\n if (language === currentLanguageRef.current) return;\n\n if (!effectiveAllowUserOverride) {\n logDebug('Language change blocked — effective user override is disabled', {\n configAllowUserOverride,\n configAllowOrganizationOverride,\n useOrganizationDefault: languagePreferences?.useOrganizationDefault,\n organizationLanguagePreferences,\n });\n return;\n }\n\n if (!isLanguageSupported(language)) {\n logDebug(`Language change blocked — ${language} is not in enabledLanguages`);\n return;\n }\n\n logDebug(`Language change requested: ${currentLanguage} → ${language}`);\n applyResolvedLanguage(language);\n };\n\n const mergeLabelPayloads = (payloads: Translation[]): Translation => {\n return payloads.reduce<Translation>((merged, payload) => deepMergeTranslations(merged, payload), {});\n };\n\n const shouldLoadFallbackLayer = (language: AvailableLanguage): boolean => {\n return configFallbackLanguage !== language;\n };\n\n const fetchEagerLabelsWithFallback = async (language: AvailableLanguage, sections: string[]): Promise<Translation> => {\n const httpClient = getManualCallsHttpClient();\n\n if (!shouldLoadFallbackLayer(language)) {\n const response = await httpClient.getI18nLabels(language, sections);\n return response.labels;\n }\n\n const [fallbackResponse, response] = await Promise.all([\n httpClient.getI18nLabels(configFallbackLanguage, sections),\n httpClient.getI18nLabels(language, sections),\n ]);\n\n return deepMergeTranslations(fallbackResponse.labels, response.labels);\n };\n\n const fetchLazyLabelsWithFallback = async (language: AvailableLanguage, chunks: string[][]): Promise<Translation> => {\n const httpClient = getManualCallsHttpClient();\n\n if (!shouldLoadFallbackLayer(language)) {\n /*\n * Pre-caught for the same reason as the dual-language branch below: `Promise.all` settles on\n * the FIRST rejection, so when several chunks fail — which is what a labels endpoint being\n * down looks like — every loser's rejection floats to the window unhandled. The `await` still\n * rejects; the `.catch` only marks each request as observed.\n */\n const chunkRequests = chunks.map(chunk => httpClient.getI18nLabelsByKeys(language, chunk));\n chunkRequests.forEach(request => request.catch(() => undefined));\n const responses = await Promise.all(chunkRequests);\n return mergeLabelPayloads(responses.map((response) => response.labels));\n }\n\n /*\n * Held in locals and pre-caught, because `Promise.all` settles on the FIRST rejection and\n * leaves the other branch's rejection with no handler — an unhandled promise rejection at the\n * window whenever BOTH languages fail, which is the ordinary case when the labels endpoint is\n * down. The `await` below still rejects exactly as before; the `.catch` only marks each branch\n * as observed so the loser does not float.\n */\n const fallbackChunkRequests = chunks.map(chunk => httpClient.getI18nLabelsByKeys(configFallbackLanguage, chunk));\n const primaryChunkRequests = chunks.map(chunk => httpClient.getI18nLabelsByKeys(language, chunk));\n [...fallbackChunkRequests, ...primaryChunkRequests].forEach(request => request.catch(() => undefined));\n const fallbackRequest = Promise.all(fallbackChunkRequests);\n const primaryRequest = Promise.all(primaryChunkRequests);\n fallbackRequest.catch(() => undefined);\n primaryRequest.catch(() => undefined);\n\n const [fallbackResponses, responses] = await Promise.all([fallbackRequest, primaryRequest]);\n\n return deepMergeTranslations(\n mergeLabelPayloads(fallbackResponses.map((response) => response.labels)),\n mergeLabelPayloads(responses.map((response) => response.labels)),\n );\n };\n\n // Listen to preference changes from UserOrgsContext\n useEffect(() => {\n const unsubscribe = on(FrontendEvents.USER_PREFERENCES_CHANGED, (payload: FrontendEventPayloads[FrontendEvents.USER_PREFERENCES_CHANGED]) => {\n const includesLanguagePreferences = Object.prototype.hasOwnProperty.call(payload, 'languagePreferences');\n const includesOrganizationLanguagePreferences = Object.prototype.hasOwnProperty.call(payload, 'organizationLanguagePreferences');\n\n const nextLanguagePreferences = includesLanguagePreferences\n ? (payload.languagePreferences ?? null)\n : languagePreferences;\n const nextOrganizationLanguagePreferences = includesOrganizationLanguagePreferences\n ? (payload.organizationLanguagePreferences ?? null)\n : organizationLanguagePreferences;\n\n if (includesLanguagePreferences) {\n setLanguagePreferences(nextLanguagePreferences);\n }\n\n if (includesOrganizationLanguagePreferences) {\n setOrganizationLanguagePreferences(nextOrganizationLanguagePreferences);\n }\n\n if (includesLanguagePreferences || includesOrganizationLanguagePreferences) {\n const savedLanguage = localStorage.getItem(LOCAL_STORAGE_KEYS.LANGUAGE) as AvailableLanguage | null;\n const browserLanguage = navigator.language.split('-')[0] as AvailableLanguage;\n const resolvedLanguage = resolveEffectiveLanguage({\n userPreferences: nextLanguagePreferences,\n organizationPreferences: nextOrganizationLanguagePreferences,\n savedLanguage,\n browserLanguage,\n });\n\n logDebug('Applying effective language from UserOrgsContext event', {\n resolvedLanguage,\n userPrimaryLanguage: nextLanguagePreferences?.primaryLanguage,\n useOrganizationDefault: nextLanguagePreferences?.useOrganizationDefault,\n organizationPrimaryLanguage: nextOrganizationLanguagePreferences?.primaryLanguage,\n organizationEnforced: nextOrganizationLanguagePreferences?.enforceForAllMembers,\n });\n\n applyResolvedLanguage(resolvedLanguage);\n }\n\n // Store regional preferences\n if (Object.prototype.hasOwnProperty.call(payload, 'regionalPreferences')) {\n setRegionalPreferences(payload.regionalPreferences ?? null);\n logDebug('Regional preferences updated from UserOrgsContext event', {\n locale: payload.regionalPreferences?.locale,\n timezone: payload.regionalPreferences?.timezone,\n });\n }\n\n // Store the tenant's regional defaults, which sit beneath the member's own\n if (Object.prototype.hasOwnProperty.call(payload, 'organizationRegionalPreferences')) {\n setOrganizationRegionalPreferences(payload.organizationRegionalPreferences ?? null);\n logDebug('Organization regional preferences updated from UserOrgsContext event', {\n locale: payload.organizationRegionalPreferences?.locale,\n timezone: payload.organizationRegionalPreferences?.timezone,\n });\n }\n });\n\n return unsubscribe;\n }, [\n applyResolvedLanguage,\n languagePreferences,\n logDebug,\n on,\n organizationLanguagePreferences,\n resolveEffectiveLanguage,\n ]);\n\n // Preference getters\n const getLanguagePreferences = useCallback((): UserLanguagePreferences | null => {\n return languagePreferences;\n }, [languagePreferences]);\n\n const getRegionalPreferences = useCallback((): UserPreferences['regional'] | null => {\n return regionalPreferences;\n }, [regionalPreferences]);\n\n // -------------------------------------------------------\n // Per-key lazy loading\n // -------------------------------------------------------\n\n /**\n * Deep-merge `source` into `target`, returning a new object.\n * String leaves in `source` overwrite `target`; nested objects are merged recursively.\n */\n const deepMergeTranslations = (target: Translation, source: Translation): Translation => {\n const result: Translation = { ...target };\n for (const key of Object.keys(source)) {\n const sv = source[key];\n const tv = result[key];\n if (typeof sv === 'object' && sv !== null && typeof tv === 'object' && tv !== null) {\n result[key] = deepMergeTranslations(tv as Translation, sv as Translation);\n } else {\n result[key] = sv;\n }\n }\n return result;\n };\n\n /**\n * Check if a key is implicitly loaded because an ancestor key was already fetched.\n * E.g. if `components.my_widget` is loaded, then `components.my_widget.label` is\n * implicitly loaded (it's a sub-path of an already-fetched tree).\n * Also: if `components` was loaded, then `components.my_widget` is implicitly loaded.\n */\n const isKeyImplicitlyLoaded = (key: string): boolean => {\n if (fullLoadCompletedRef.current) return true;\n if (loadedKeysRef.current.has(key)) return true;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n if (loadedKeysRef.current.has(ancestor)) return true;\n }\n\n return false;\n };\n\n /**\n * Is this key SETTLED — loaded, or failed and not coming?\n *\n * The question a readiness gate asks. `isKeyImplicitlyLoaded` answers \"can I read a value\",\n * which is a different question and the right one for a lookup; a UI waiting to render needs to\n * know that waiting longer will not help. A failed key answers no to the first and yes to this.\n */\n const isKeySettled = (key: string): boolean => {\n if (isKeyImplicitlyLoaded(key)) return true;\n if (failedKeysRef.current.has(key)) return true;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n if (failedKeysRef.current.has(ancestor)) return true;\n }\n\n return false;\n };\n\n /** Same ancestor check but against `pendingKeysRef`. */\n const isKeyImplicitlyPending = (key: string): boolean => {\n if (pendingKeysRef.current.has(key)) return true;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n if (pendingKeysRef.current.has(ancestor)) return true;\n }\n\n return false;\n };\n\n /**\n * Flush the micro-batch queue: collect all queued keys, fire one API call,\n * deep-merge the result, resolve all pending promises.\n */\n const flushBatch = async (): Promise<void> => {\n const batch = batchQueueRef.current;\n batchQueueRef.current = [];\n batchTimerRef.current = null;\n\n if (batch.length === 0) return;\n\n if (fullLoadCompletedRef.current) {\n batch.forEach(b => b.resolve());\n return;\n }\n\n const allKeys = [...new Set(batch.flatMap(b => b.keys))];\n const missing = allKeys.filter(k => !isKeyImplicitlyLoaded(k));\n\n logDebug(`flushBatch allKeys=[${allKeys.join(', ')}] missing=[${missing.join(', ')}]`);\n\n if (missing.length === 0) {\n batch.forEach(b => b.resolve());\n return;\n }\n\n const language = currentLanguageRef.current;\n logDebug('Flushing lazy i18n batch', { keys: missing, language });\n\n const MAX_KEYS_PER_REQUEST = 30;\n const chunks: string[][] = [];\n for (let i = 0; i < missing.length; i += MAX_KEYS_PER_REQUEST) {\n chunks.push(missing.slice(i, i + MAX_KEYS_PER_REQUEST));\n }\n\n try {\n logDebug(`getI18nLabelsByKeys language=${language} chunks=${chunks.map(chunk => `[${chunk.join(', ')}]`).join(', ')}`);\n const merged = await fetchLazyLabelsWithFallback(language, chunks);\n\n if (language !== currentLanguageRef.current) {\n logDebug('Discarding stale lazy i18n response', { fetchedFor: language, currentLanguage: currentLanguageRef.current });\n batch.forEach(b => b.resolve());\n return;\n }\n\n setTranslations(prev => deepMergeTranslations(prev, merged));\n\n for (const key of missing) {\n loadedKeysRef.current.add(key);\n pendingKeysRef.current.delete(key);\n replayPendingLazyKeys.delete(key);\n }\n\n batch.forEach(b => b.resolve());\n } catch (error) {\n for (const key of missing) {\n pendingKeysRef.current.delete(key);\n // SETTLED, not loaded. Readiness resolves so no surface waits forever on a bundle that is\n // not coming; the key stays out of `loadedKeysRef`, so a later request retries it and a\n // lookup still reports the label as missing rather than inventing one.\n failedKeysRef.current.add(key);\n }\n // The ref alone is invisible to React — see `failedKeysVersion`.\n setFailedKeysVersion(version => version + 1);\n batch.forEach(b => b.reject(error));\n reportError(error, `Failed to load translation keys: ${missing.join(', ')}`, { keys: missing, language });\n }\n };\n\n /**\n * Find the pending promise for a key, checking the key itself then its ancestors.\n * Returns the promise if the key (or an ancestor) is in-flight, undefined otherwise.\n */\n const findPendingPromise = (key: string): Promise<void> | undefined => {\n const direct = pendingKeysRef.current.get(key);\n if (direct) return direct;\n\n const segments = key.split('.');\n for (let i = segments.length - 1; i >= 1; i--) {\n const ancestor = segments.slice(0, i).join('.');\n const ancestorPromise = pendingKeysRef.current.get(ancestor);\n if (ancestorPromise) return ancestorPromise;\n }\n\n return undefined;\n };\n\n const requestKeys = useCallback((keys: string | string[]): Promise<void> => {\n if (fullLoadCompletedRef.current) return Promise.resolve();\n\n const keyArray = typeof keys === 'string' ? [keys] : keys;\n const needed = keyArray.filter(k => !isKeyImplicitlyLoaded(k));\n\n logDebug(`requestKeys keyArray=[${keyArray.join(', ')}] needed=[${needed.join(', ')}]`);\n\n if (needed.length === 0) return Promise.resolve();\n\n const alreadyPending = needed.filter(k => isKeyImplicitlyPending(k));\n const brandNew = needed.filter(k => !isKeyImplicitlyPending(k));\n\n logDebug(`requestKeys pending=[${alreadyPending.join(', ')}] brandNew=[${brandNew.join(', ')}]`);\n\n for (const key of brandNew) {\n replayPendingLazyKeys.add(key);\n }\n\n if (brandNew.length === 0) {\n return Promise.all(alreadyPending.map(k => findPendingPromise(k)!)).then(() => {});\n }\n\n const promise = new Promise<void>((resolve, reject) => {\n batchQueueRef.current.push({ keys: brandNew, resolve, reject });\n\n if (batchTimerRef.current === null) {\n batchTimerRef.current = setTimeout(flushBatch, 16);\n }\n });\n\n /*\n * The STORED copies are observed here, and that is not defensive tidying.\n *\n * This one promise is stored under every requested key and handed to later callers by\n * `findPendingPromise`. When the batch rejects, each of those copies is a rejected promise that\n * nobody necessarily awaits — a caller that fired and forgot, or a key whose only waiter has\n * unmounted — so a failed bundle floated one unhandled rejection per key to the window. The\n * `await` paths still see the rejection; this only marks it observed.\n */\n promise.catch(() => undefined);\n\n for (const k of brandNew) {\n pendingKeysRef.current.set(k, promise);\n }\n\n if (envLoader.isDevelopment()) {\n logDebug(`DEV immediate lazy flush [${brandNew.join(', ')}]`);\n void flushBatch();\n }\n\n if (alreadyPending.length > 0) {\n const pendingPromises = alreadyPending.map(k => findPendingPromise(k)!);\n return Promise.all([promise, ...pendingPromises]).then(() => {});\n }\n\n return promise;\n }, [currentLanguage, reportError]);\n\n useEffect(() => {\n if (replayPendingLazyKeys.size === 0) return;\n const keys = Array.from(replayPendingLazyKeys);\n logDebug(`Replaying pending lazy keys after remount [${keys.join(', ')}]`);\n /*\n * Fire-and-forget, so the rejection has to be observed HERE. A replay whose bundle is down\n * rejects with nobody awaiting it, which reaches the window as an unhandled rejection — noise\n * that says nothing, because the failure is already recorded by `flushBatch` (the keys enter\n * `failedKeysRef`, readiness settles, and the error is reported once).\n */\n void requestKeys(keys).catch(() => undefined);\n }, [requestKeys]);\n\n const isKeyLoaded = useCallback((key: string): boolean => {\n return isKeyImplicitlyLoaded(key);\n }, []);\n\n const isKeySettledCallback = useCallback((key: string): boolean => {\n return isKeySettled(key);\n }, []);\n\n const getKeyStatus = useCallback((key: string): 'loaded' | 'pending' | 'not-requested' => {\n if (isKeyImplicitlyLoaded(key)) return 'loaded';\n if (isKeyImplicitlyPending(key)) return 'pending';\n return 'not-requested';\n }, []);\n\n const requestComponentKeys = useCallback((componentType: FrontendComponentType | FrontendComponentType[]): Promise<void> => {\n const types = Array.isArray(componentType) ? componentType : [componentType];\n return requestKeys(types.map(ct => `${LabellingTypes.COMPONENTS}.${ct}`));\n }, [requestKeys]);\n\n const requestResourceKeys = useCallback((resourceType: string | string[]): Promise<void> => {\n const types = Array.isArray(resourceType) ? resourceType : [resourceType];\n return requestKeys(types.map(rt => `${LabellingTypes.RESOURCES}.${rt}`));\n }, [requestKeys]);\n\n // -------------------------------------------------------\n\n const loadTranslations = async (language: AvailableLanguage): Promise<void> => {\n\n if (!appIsInitialized) {\n logDebug('Waiting for app config to be ready before loading translations');\n return;\n }\n\n if (loadingLanguageRef.current === language) {\n logDebug(`Already loading translations for ${language}, skipping duplicate call`);\n return;\n }\n\n if (loadedLanguagesRef.current.has(language)) {\n logDebug(`Translations for ${language} already loaded, skipping duplicate call`);\n return;\n }\n\n const loadingIdentifier = isInitializedRef.current\n ? AppLoadingIdentifier.I18N_LANGUAGE_CHANGE\n : AppLoadingIdentifier.INIT_I18N;\n logDebug(`Starting translation loading for ${language}`);\n loadingLanguageRef.current = language;\n setIsLoading(true);\n\n emit(FrontendEvents.LOADING_CUSTOM_START, {\n identifier: loadingIdentifier,\n data: { language },\n tier: LoadingTier.APPLICATION,\n });\n\n try {\n\n const responseLabels = await fetchEagerLabelsWithFallback(\n language,\n EAGER_I18N_SECTIONS as string[],\n );\n\n if (language !== currentLanguageRef.current) {\n logDebug('Discarding stale translation response', { fetchedFor: language, currentLanguage: currentLanguageRef.current });\n return;\n }\n\n // Deep-merge, not replace. During language change, lazy batch requests\n // (via useI18n deps effects) may resolve concurrently with this eager\n // load. Using replace would wipe lazy data that arrived first.\n setTranslations(prev => deepMergeTranslations(prev, responseLabels));\n\n loadedLanguagesRef.current.add(language);\n\n for (const section of EAGER_I18N_SECTIONS) {\n loadedKeysRef.current.add(section);\n }\n\n // Do NOT set fullLoadCompletedRef.current = true.\n // With fullLoadCompleted = false, requestKeys no longer short-circuits,\n // isKeyLoaded returns false for unloaded sections, and the microbatch\n // system becomes the primary loader for per-component translations.\n\n logDebug('Eager i18n sections loaded', {\n language,\n sections: EAGER_I18N_SECTIONS,\n fallbackLanguage: shouldLoadFallbackLayer(language) ? configFallbackLanguage : undefined,\n });\n\n if (!isInitializedRef.current) {\n isInitializedRef.current = true;\n markComponentInitialized(MainContextInitComponents.I18N);\n }\n\n } catch (error) {\n reportError(error, `Failed to load translations for language: ${language}`, { language });\n loadedKeysRef.current.clear();\n pendingKeysRef.current.clear();\n setTranslations({});\n\n } finally {\n loadingLanguageRef.current = null;\n setIsLoading(false);\n\n emit(FrontendEvents.LOADING_CUSTOM_END, {\n identifier: loadingIdentifier,\n data: { language },\n tier: LoadingTier.APPLICATION,\n });\n }\n };\n\n const t = (key: string, params?: Record<string, string | number>): string => {\n const keys = key.split('.');\n let value: any = translations;\n\n // Navigate through nested translation object\n for (const k of keys) {\n value = value?.[k];\n if (value === undefined) break;\n }\n\n const result = typeof value === 'string' ? value : key;\n\n // Canonical single-brace `{param}` substitution shared with the backend\n // label/email interpolator. NOTE: this previously matched DOUBLE braces\n // (`{{param}}`), which never matched any content (every locale file and the\n // generator emit single braces) — so no frontend param ever interpolated.\n // Do NOT reintroduce a local replace loop here; the one contract lives in\n // `interpolateLabelParams`.\n return interpolateLabelParams(result, params);\n };\n\n // ------------------------------\n // Labelling-based helper builders\n // ------------------------------\n\n const tResourceHeader: I18nContextType['tResourceHeader'] = (resource, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.header.${key}`;\n return t(base, params);\n };\n\n const tResourceEmptyState: I18nContextType['tResourceEmptyState'] = (resource, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.emptyState.${key}`;\n const result = t(base, params);\n // Return empty string when translation is missing (key path returned as-is) so callers can fall back gracefully\n if (result === base) return '';\n return result;\n };\n\n const tResourceOperation: I18nContextType['tResourceOperation'] = (resource, operation, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.operations.${operation}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n const tResourceFieldDisplay: I18nContextType['tResourceFieldDisplay'] = (resource, fieldPath, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.fields.${fieldPath}.display.${key}`;\n const result = t(base, params);\n // Fallback: if translation not found, return formatted field name for 'label', empty for description/tooltip\n if (result === base) {\n return key === 'label' ? AutomatedLayoutFrontendUtils.unresolvedFieldLabel(fieldPath) : '';\n }\n return result;\n };\n\n const tResourceFieldEdit: I18nContextType['tResourceFieldEdit'] = (resource, fieldPath, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.fields.${fieldPath}.edit.${key}`;\n const result = t(base, params);\n // Fallback: if translation not found, return formatted field name for 'label', empty for description/placeholder/tooltip\n if (result === base) {\n return key === 'label' ? AutomatedLayoutFrontendUtils.unresolvedFieldLabel(fieldPath) : '';\n }\n return result;\n };\n\n const tResourceFieldEnumValue: I18nContextType['tResourceFieldEnumValue'] = (resource, fieldPath, enumValue) => {\n // 1. Try resource-field-specific label (allows per-resource overrides)\n const resourceKey = `${LabellingTypes.RESOURCES}.${resource}.fields.${fieldPath}.enum.${enumValue}`;\n const resourceResult = t(resourceKey);\n if (resourceResult !== resourceKey) return resourceResult;\n\n // 2. Auto-cascade: when resource-field key is missing, check system enum labels.\n // Backend skips generating per-resource keys for system enum fields, so the\n // resource key will be missing → we transparently resolve via system_enums.\n for (const enumName of SYSTEM_ENUM_NAMES) {\n const systemKey = `${LabellingTypes.SYSTEM_ENUMS}.${enumName}.${enumValue}`;\n const systemResult = t(systemKey);\n if (systemResult !== systemKey) return systemResult;\n }\n\n // 3. Fallback to raw enum value\n return enumValue;\n };\n\n const tErrorValidation: I18nContextType['tErrorValidation'] = (zodIssueCode, ref, params) => {\n const base = `${LabellingTypes.ERRORS_VALIDATION}.${zodIssueCode}.${ref}`;\n return t(base, params);\n };\n\n const tComponent: I18nContextType['tComponent'] = (componentType, key, params) => {\n const base = `${LabellingTypes.COMPONENTS}.${componentType}.${key}`;\n return t(base, params);\n };\n\n const tErrorMessage: I18nContextType['tErrorMessage'] = (errorRef, key = 'msg', params) => {\n const base = `${LabellingTypes.ERRORS_MESSAGES}.${errorRef}.${key}`;\n return t(base, params);\n };\n\n /**\n * Resolve error guidance label from `errors_guidance.{guidanceKey}.{field}`.\n * Returns empty string when the label is missing (unlike `t` which returns the key path).\n */\n const tErrorGuidance: I18nContextType['tErrorGuidance'] = (guidanceKey, field, params) => {\n const base = `${LabellingTypes.ERRORS_GUIDANCE}.${guidanceKey}.${field}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n const tNotificationCustom: I18nContextType['tNotificationCustom'] = (notificationRef, key = 'msg', params) => {\n const base = `${LabellingTypes.NOTIFICATIONS_CUSTOM}.${notificationRef}.${key}`;\n return t(base, params);\n };\n\n const tSystemEnum: I18nContextType['tSystemEnum'] = (enumName, enumValue) => {\n const base = `${LabellingTypes.SYSTEM_ENUMS}.${enumName}.${enumValue}`;\n const result = t(base);\n // If translation not found, fallback to enum value\n return result === base ? enumValue : result;\n };\n\n // Resource layout labels.\n // Path: resources.{resourceType}.sections.{sectionRef}.{title|description}\n const tResourceSection: I18nContextType['tResourceSection'] = (resource, sectionRef, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.sections.${sectionRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // Path: resources.{resourceType}.wizardSteps.{stepRef}.{title|description}\n const tResourceWizardStep: I18nContextType['tResourceWizardStep'] = (resource, stepRef, key, params) => {\n const base = `${LabellingTypes.RESOURCES}.${resource}.wizardSteps.${stepRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // Path: sidebar_sections.{sectionRef}.{title|description}\n // Falls back to sectionRef if translation not found\n const tSidebarSection: I18nContextType['tSidebarSection'] = (sectionRef, key = 'title', params) => {\n const base = `${LabellingTypes.SIDEBAR_SECTIONS}.${sectionRef}.${key}`;\n const result = t(base, params);\n // If translation not found, fallback to humanized section ref\n return result === base ? sectionRef.charAt(0).toUpperCase() + sectionRef.slice(1).replace(/_/g, ' ') : result;\n };\n\n // Path: settings_hub.categories.{categoryRef}.label — falls back to the\n // authored label (the registry's own string) when no translation exists, so\n // the rail reads correctly before the companion generates the bundle.\n const tSettingsHubCategory: I18nContextType['tSettingsHubCategory'] = (categoryRef, fallbackLabel) => {\n const base = `${LabellingTypes.SETTINGS_HUB}.categories.${categoryRef}.label`;\n const result = t(base);\n return result === base ? fallbackLabel : result;\n };\n\n // Path: settings_hub.sections.{sectionRef}.label — same authored-label fallback.\n const tSettingsHubSection: I18nContextType['tSettingsHubSection'] = (sectionRef, fallbackLabel) => {\n const base = `${LabellingTypes.SETTINGS_HUB}.sections.${sectionRef}.label`;\n const result = t(base);\n return result === base ? fallbackLabel : result;\n };\n\n const tCompositeView: I18nContextType['tCompositeView'] = (\n translationRef,\n key,\n params,\n ) => {\n const base = `${LabellingTypes.COMPOSITE_VIEWS}.${translationRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n const tCompositeViewSection: I18nContextType['tCompositeViewSection'] = (\n translationRef,\n sectionRef,\n key,\n params,\n ) => {\n const base = `${LabellingTypes.COMPOSITE_VIEWS}.${translationRef}.sections.${sectionRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // `key` accepts ANY view-local label ref, not just 'title' | 'description'.\n // Framework chrome resolves title/description; custom views (e.g. a resource-\n // owned EXECUTION view) declare their own refs that the labelling pipeline\n // generates under `views.{family}.{translationRef}.{ref}`. Missing keys return\n // '' (caller decides the fallback), same contract as before.\n const tView: I18nContextType['tView'] = (\n family,\n translationRef,\n key,\n params,\n ) => {\n const base = `${LabellingTypes.VIEWS}.${family}.${translationRef}.${key}`;\n const result = t(base, params);\n return result === base ? '' : result;\n };\n\n // ------------------------------\n // Guidance helpers\n // ------------------------------\n\n const tGuidanceFlow: I18nContextType['tGuidanceFlow'] = (flowRef, key, params) =>\n t(`guidance.${flowRef}.${key}`, params);\n\n const tGuidanceElement: I18nContextType['tGuidanceElement'] = (flowRef, elementRef, key, params) => {\n const fullKey = `guidance.${flowRef}.elements.${elementRef}.${key}`;\n const result = t(fullKey, params);\n return result === fullKey ? undefined : result;\n };\n\n const tGuidanceTourStep: I18nContextType['tGuidanceTourStep'] = (flowRef, elementRef, stepRef, key, params) => {\n const fullKey = `guidance.${flowRef}.elements.${elementRef}.tour_steps.${stepRef}.${key}`;\n const result = t(fullKey, params);\n return result === fullKey ? undefined : result;\n };\n\n const tGuidanceSurveyQuestion: I18nContextType['tGuidanceSurveyQuestion'] = (flowRef, elementRef, questionId, key, params) => {\n const fullKey = `guidance.${flowRef}.elements.${elementRef}.survey_questions.${questionId}.${key}`;\n const result = t(fullKey, params);\n return result === fullKey ? undefined : result;\n };\n\n const makeTrGuidanceElement: I18nContextType['makeTrGuidanceElement'] = (flowRef, elementRef) =>\n (key, params) => tGuidanceElement(flowRef, elementRef, key, params);\n\n // ------------------------------\n // Milestone helpers\n // ------------------------------\n\n const tMilestone: I18nContextType['tMilestone'] = (milestoneRef, key, params) =>\n t(`milestones.${milestoneRef}.${key}`, params);\n\n const tMilestoneReward: I18nContextType['tMilestoneReward'] = (milestoneRef, key, params) =>\n t(`milestones.${milestoneRef}.reward.${key}`, params);\n\n const makeTrMilestone: I18nContextType['makeTrMilestone'] = (milestoneRef) =>\n (key, params) => tMilestone(milestoneRef, key, params);\n\n // ------------------------------\n // Lifecycle helpers\n // ------------------------------\n\n const tLifecycle: I18nContextType['tLifecycle'] = (key, params) =>\n t(`lifecycle.${key}`, params);\n\n const tLifecycleStage: I18nContextType['tLifecycleStage'] = (stage) =>\n t(`lifecycle.stage.${stage}.label`);\n\n const tActivationCriterion: I18nContextType['tActivationCriterion'] = (criterion) => {\n switch (criterion.criterionType) {\n case ActivationCriterionType.MILESTONE:\n return tMilestone(criterion.milestoneRef, 'title');\n case ActivationCriterionType.GUIDANCE_COMPLETED:\n return tGuidanceFlow(criterion.guidanceFlowRef, 'title');\n }\n };\n\n const tMilestoneCategory: I18nContextType['tMilestoneCategory'] = (category) => {\n const base = `${LabellingTypes.MILESTONES}.categories.${category}.label`;\n const result = t(base);\n return result === base ? unresolvedLabel(category) : result;\n };\n\n // ------------------------------\n // Billing helpers\n // ------------------------------\n\n const tBillingProduct: I18nContextType['tBillingProduct'] = (productKey, subKey) => {\n const base = `${LabellingTypes.BILLING_PRODUCTS}.${productKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'name' ? unresolvedLabel(productKey) : '') : result;\n };\n\n const tBillingFeature: I18nContextType['tBillingFeature'] = (featureKey, subKey) => {\n const base = `${LabellingTypes.BILLING_FEATURES}.${featureKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'label' ? unresolvedLabel(featureKey) : '') : result;\n };\n\n const tBillingLimit: I18nContextType['tBillingLimit'] = (limitKey, subKey) => {\n const base = `${LabellingTypes.BILLING_LIMITS}.${limitKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'label' ? unresolvedLabel(limitKey) : '') : result;\n };\n\n const tBillingCreditPool: I18nContextType['tBillingCreditPool'] = (poolKey, subKey) => {\n const base = `${LabellingTypes.BILLING_CREDIT_POOLS}.${poolKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'name' ? unresolvedLabel(poolKey) : '') : result;\n };\n\n // ------------------------------\n // Role helpers\n // ------------------------------\n\n const tRole: I18nContextType['tRole'] = (roleKey, subKey) => {\n const base = `${LabellingTypes.ROLES}.${roleKey}.${subKey}`;\n const result = t(base);\n return result === base ? (subKey === 'label' ? unresolvedLabel(roleKey) : '') : result;\n };\n\n // ------------------------------\n // Curried resource helpers\n // ------------------------------\n\n const makeTrResourceHeader: I18nContextType['makeTrResourceHeader'] = (resource) => (key = 'title', params) => {\n return tResourceHeader(resource, key, params);\n };\n\n const makeTrResourceEmptyState: I18nContextType['makeTrResourceEmptyState'] = (resource) => (key = 'title', params) => {\n return tResourceEmptyState(resource, key, params);\n };\n\n const makeTrResourceOperation: I18nContextType['makeTrResourceOperation'] = (resource) => (operation, key = 'title', params) => {\n return tResourceOperation(resource, operation, key, params);\n };\n\n const makeTrResourceFieldDisplay: I18nContextType['makeTrResourceFieldDisplay'] = (resource) => (fieldPath, key = 'label', params) => {\n return tResourceFieldDisplay(resource, fieldPath, key, params);\n };\n\n // Back-compat alias removed; use makeTrResourceFieldEdit instead\n\n const makeTrResourceFieldEnum: I18nContextType['makeTrResourceFieldEnum'] = (resource) => (fieldPath, enumValue) => {\n return tResourceFieldEnumValue(resource, fieldPath, enumValue);\n };\n\n // ------------------------------\n // Curried helpers for other LabellingTypes\n // ------------------------------\n\n const makeTrErrorMessage: I18nContextType['makeTrErrorMessage'] = (errorRef) => (key = 'msg', params) => {\n return tErrorMessage(errorRef, key, params);\n };\n\n const makeTrErrorGuidance: I18nContextType['makeTrErrorGuidance'] = (guidanceKey) => (field, params) => {\n return tErrorGuidance(guidanceKey, field, params);\n };\n\n const makeTrNotificationCustom: I18nContextType['makeTrNotificationCustom'] = (notificationRef) => (key = 'msg', params) => {\n return tNotificationCustom(notificationRef, key, params);\n };\n\n const makeTrErrorValidation: I18nContextType['makeTrErrorValidation'] = (zodIssueCode) => (ref, params) => {\n return tErrorValidation(zodIssueCode, ref, params);\n };\n\n const makeTrComponent: I18nContextType['makeTrComponent'] = (componentType) => (key, params) => {\n return tComponent(componentType, key, params);\n };\n\n const makeTrResourceFieldEdit: I18nContextType['makeTrResourceFieldEdit'] = (resource) => (fieldPath, key = 'label', params) => {\n return tResourceFieldEdit(resource, fieldPath, key, params);\n };\n\n const makeTrSystemEnum: I18nContextType['makeTrSystemEnum'] = (enumName) => (enumValue) => {\n return tSystemEnum(enumName, enumValue);\n };\n\n // Text direction from current language (for RTL layout)\n const dir = useMemo<TextDirection>(() => {\n const info = LANGUAGE_INFO_MAP[currentLanguage];\n return info?.direction ?? TextDirection.LTR;\n }, [currentLanguage]);\n\n useEffect(() => {\n document.documentElement.dir = dir;\n }, [dir]);\n\n /**\n * Regional formatting (absorbed from ComponentsLabellingContext), resolved\n * MEMBER -> ORGANIZATION -> FRAMEWORK, per field (#410).\n *\n * The precedence itself lives in `resolveRegionalFormatting`, which carries the reasoning and the\n * pins. Keeping it out of this `useMemo` body is deliberate: it is the one part of this that a\n * test can hold still while the React plumbing around it changes.\n */\n const resolvedRegionalPreferences = useMemo<RegionalFormattingConfig>(\n () => resolveRegionalFormatting(regionalPreferences, organizationRegionalPreferences, currentLanguage),\n [regionalPreferences, organizationRegionalPreferences, currentLanguage],\n );\n\n const formatDate = useCallback((value: Date | string | number): string =>\n RegionalFormattingUtils.formatDate(value, resolvedRegionalPreferences), [resolvedRegionalPreferences]);\n\n const formatTime = useCallback((value: Date | string | number): string =>\n RegionalFormattingUtils.formatTime(value, resolvedRegionalPreferences), [resolvedRegionalPreferences]);\n\n const formatDateTime = useCallback((value: Date | string | number): string =>\n RegionalFormattingUtils.formatDateTime(value, resolvedRegionalPreferences), [resolvedRegionalPreferences]);\n\n const formatNumber = useCallback((value: number, options?: Intl.NumberFormatOptions): string =>\n RegionalFormattingUtils.formatNumber(value, resolvedRegionalPreferences, options), [resolvedRegionalPreferences]);\n\n const hasComponentTranslations = useCallback((componentType: FrontendComponentType): boolean => {\n const componentPath = `${LabellingTypes.COMPONENTS}.${componentType}`;\n const keys = componentPath.split('.');\n let value: any = translations;\n for (const k of keys) {\n value = value?.[k];\n if (value === undefined) return false;\n }\n return typeof value === 'object' && value !== null && Object.keys(value).length > 0;\n }, [translations]);\n\n const getComponentKeys = useCallback((componentType: FrontendComponentType): string[] => {\n const componentPath = `${LabellingTypes.COMPONENTS}.${componentType}`;\n const keys = componentPath.split('.');\n let value: any = translations;\n for (const k of keys) {\n value = value?.[k];\n if (value === undefined) return [];\n }\n return typeof value === 'object' && value !== null ? Object.keys(value) : [];\n }, [translations]);\n\n const value: I18nContextType = {\n // State\n currentLanguage,\n dir,\n translations,\n isLoading,\n availableLanguages: getPolicyAvailableLanguages(),\n\n // Language config flags\n enableLanguageSwitcher: configEnableLanguageSwitcher,\n allowUserOverride: effectiveAllowUserOverride,\n\n // Preferences\n languagePreferences,\n regionalPreferences,\n\n // Actions\n changeLanguage,\n loadTranslations,\n\n // Helpers\n t,\n getLanguageName,\n isLanguageSupported,\n\n // Preference getters\n getLanguagePreferences,\n getRegionalPreferences,\n tResourceHeader,\n tResourceEmptyState,\n tResourceOperation,\n tResourceFieldDisplay,\n tResourceFieldEdit,\n tResourceFieldEnumValue,\n tErrorValidation,\n tComponent,\n tErrorMessage,\n tErrorGuidance,\n tNotificationCustom,\n tSystemEnum,\n tResourceSection,\n tResourceWizardStep,\n tSidebarSection,\n tSettingsHubCategory,\n tSettingsHubSection,\n tCompositeView,\n tCompositeViewSection,\n tView,\n makeTrResourceHeader,\n makeTrResourceEmptyState,\n makeTrResourceOperation,\n makeTrResourceFieldDisplay,\n makeTrResourceFieldEnum,\n makeTrResourceFieldEdit,\n makeTrErrorMessage,\n makeTrErrorGuidance,\n makeTrNotificationCustom,\n makeTrErrorValidation,\n makeTrComponent,\n makeTrSystemEnum,\n tGuidanceFlow,\n tGuidanceElement,\n tGuidanceTourStep,\n tGuidanceSurveyQuestion,\n makeTrGuidanceElement,\n tMilestone,\n tMilestoneReward,\n makeTrMilestone,\n tLifecycle,\n tLifecycleStage,\n tActivationCriterion,\n tMilestoneCategory,\n tBillingProduct,\n tBillingFeature,\n tBillingLimit,\n tBillingCreditPool,\n tRole,\n resolvedRegionalPreferences,\n formatDate,\n formatTime,\n formatDateTime,\n formatNumber,\n hasComponentTranslations,\n getComponentKeys,\n requestKeys,\n isKeyLoaded,\n isKeySettled: isKeySettledCallback,\n getKeyStatus,\n requestComponentKeys,\n requestResourceKeys,\n };\n\n return (\n <DirectionProvider dir={dir}>\n <I18nContext.Provider value={value}>\n {children}\n </I18nContext.Provider>\n </DirectionProvider>\n );\n};\n\n// useI18n hook is now in separate file: ./useI18n.ts\n// This separation is required for React Fast Refresh compatibility\n\n/*\nUsage examples\n--------------\n\nBasic\nconst { t } = useI18n();\nt('resources.todos.title');\n\nDirect helpers (non-curried)\nconst {\n tResourceHeader,\n tResourceEmptyState,\n tResourceOperation,\n tResourceFieldDisplay,\n tResourceFieldEdit,\n tResourceFieldEnumValue,\n tErrorValidation,\n tComponent,\n tErrorMessage,\n tNotificationCustom,\n tSystemEnum,\n} = useI18n();\n\n// Resources\ntResourceHeader('todos', 'title');\ntResourceEmptyState('todos', 'title');\ntResourceOperation('todos', 'create', 'title');\ntResourceFieldDisplay('todos', 'description', 'label');\ntResourceFieldEdit('todos', 'description', 'placeholder');\ntResourceFieldEnumValue('todos', 'status', 'pending');\n\n// Components\ntComponent('LOW_LEVEL_BUTTON', 'label');\n\n// Errors validation\ntErrorValidation('invalid_string', 'msg', { validation: 'email' });\n\n// Errors messages\ntErrorMessage('authentication'); // defaults to 'msg'\ntErrorMessage('authentication', 'msg');\n\n// Notifications custom\ntNotificationCustom('A_TEMP_REF'); // defaults to 'msg'\ntNotificationCustom('A_TEMP_REF', 'msg');\n\n// System enums (global application-scope enums)\ntSystemEnum(SystemEnumName.AVAILABLE_LANGUAGE, 'en');\ntSystemEnum(SystemEnumName.COMMON_TIMEZONE, 'America/New_York');\ntSystemEnum(SystemEnumName.AVAILABLE_CURRENCY, 'USD');\ntSystemEnum(SystemEnumName.AVAILABLE_COUNTRY, 'US');\ntSystemEnum(SystemEnumName.MONTH, 'JANUARY');\n\n// Sidebar sections (dynamic, based on configured contentSections)\n// Translation keys are dynamically populated based on config\nconst { tSidebarSection } = useI18n();\ntSidebarSection('main'); // defaults to 'title' -> \"Main\"\ntSidebarSection('main', 'title'); // \"Main\"\ntSidebarSection('main', 'description'); // \"Main navigation items\"\ntSidebarSection('tools'); // \"Tools\"\ntSidebarSection('my_custom_section'); // Falls back to \"My custom section\" if not translated\n\nCurried helpers (two-step)\nconst {\n makeTrResourceHeader,\n makeTrResourceOperation,\n makeTrResourceFieldDisplay,\n makeTrResourceFieldEdit,\n makeTrResourceFieldEnum,\n makeTrErrorMessage,\n makeTrNotificationCustom,\n makeTrErrorValidation,\n makeTrComponent,\n makeTrSystemEnum,\n} = useI18n();\n\n// Resources\nconst trTodosHeader = makeTrResourceHeader('todos');\ntrTodosHeader(); // defaults to 'title'\ntrTodosHeader('description');\n\nconst trTodosOp = makeTrResourceOperation('todos');\ntrTodosOp('create'); // defaults to 'title'\n\nconst trTodosDisplay = makeTrResourceFieldDisplay('todos');\ntrTodosDisplay('description'); // defaults to 'label'\n\nconst trTodosEdit = makeTrResourceFieldEdit('todos');\ntrTodosEdit('description'); // defaults to 'label'\ntrTodosEdit('description', 'placeholder');\ntrTodosEdit('description', 'tooltip');\n\nconst trTodosEnum = makeTrResourceFieldEnum('todos');\ntrTodosEnum('status', 'pending');\n\n// Errors messages\nconst trErrAuth = makeTrErrorMessage('authentication');\ntrErrAuth(); // defaults to 'msg'\n\n// Notifications custom\nconst trNotif = makeTrNotificationCustom('A_TEMP_REF');\ntrNotif(); // defaults to 'msg'\n\n// Errors validation\nconst trInvalidString = makeTrErrorValidation('invalid_string');\ntrInvalidString('msg', { validation: 'email' });\n\n// Components\nconst trButton = makeTrComponent('LOW_LEVEL_BUTTON');\ntrButton('label');\n\n// System enums (curried)\nconst trLanguage = makeTrSystemEnum(SystemEnumName.AVAILABLE_LANGUAGE);\ntrLanguage('en'); // 'English'\ntrLanguage('fr'); // 'French'\n\nconst trTimezone = makeTrSystemEnum(SystemEnumName.COMMON_TIMEZONE);\ntrTimezone('America/New_York'); // 'Eastern Time'\n\nconst trMonth = makeTrSystemEnum(SystemEnumName.MONTH);\ntrMonth('JANUARY'); // 'January'\n*/\n"]}
|