From 6029dee745b4f4cb1ef3f755b995eb859b58d1a5 Mon Sep 17 00:00:00 2001 From: StephenHanzlik Date: Tue, 19 May 2026 16:44:40 -0600 Subject: [PATCH 1/2] chore(apollo-react): expose ./i18n subpath export Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/apollo-react/package.json | 5 ++++ .../apollo-react/src/i18n/ApI18nProvider.tsx | 27 ++++++++++--------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/apollo-react/package.json b/packages/apollo-react/package.json index 76e233984..8203270d0 100644 --- a/packages/apollo-react/package.json +++ b/packages/apollo-react/package.json @@ -68,6 +68,11 @@ "import": "./dist/canvas/index.js", "require": "./dist/canvas/index.cjs" }, + "./i18n": { + "types": "./dist/i18n/index.d.ts", + "import": "./dist/i18n/index.js", + "require": "./dist/i18n/index.cjs" + }, "./canvas/xyflow/react": { "types": "./dist/canvas/xyflow/react.d.ts", "import": "./dist/canvas/xyflow/react.js", diff --git a/packages/apollo-react/src/i18n/ApI18nProvider.tsx b/packages/apollo-react/src/i18n/ApI18nProvider.tsx index 1b86b352b..26076b3ea 100644 --- a/packages/apollo-react/src/i18n/ApI18nProvider.tsx +++ b/packages/apollo-react/src/i18n/ApI18nProvider.tsx @@ -24,8 +24,10 @@ export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number]; export interface ApI18nProviderProps { /** - * Component path relative to src/ where locales are stored. - * Example: 'material/components/ap-chat' + * Apollo-react component group whose pre-built lingui catalogs should be + * activated. Must be a key registered in `locale-registry.ts` + * (e.g. `'canvas'`, `'material/components/ap-chat'`). Unknown values log + * an error and activate empty messages. */ component: string; /** @@ -40,22 +42,21 @@ export interface ApI18nProviderProps { } /** - * Component-scoped i18n provider for Apollo components. + * Activates apollo-react's pre-built lingui catalogs for a given component + * group. Wrap any apollo-react UI (e.g. , canvas components) so its + * strings render in the active locale. * - * @internal This is an internal API scoped to specific components. - * Not exposed in the public package exports. + * `component` must be a key registered in `locale-registry.ts`. Mutates the + * shared `@lingui/core` i18n singleton, so host apps running their own + * lingui setup should keep a single source of truth. * * @example * ```tsx - * import { ApI18nProvider } from '../../../i18n'; + * import { ApI18nProvider } from '@uipath/apollo-react/i18n'; * - * function MyComponent() { - * return ( - * - * - * - * ); - * } + * + * + * * ``` */ export function ApI18nProvider({ component, locale: propLocale, children }: ApI18nProviderProps) { From 4da8813807e85c81504b656448799e3c9473aca8 Mon Sep 17 00:00:00 2001 From: StephenHanzlik Date: Wed, 20 May 2026 13:27:26 -0600 Subject: [PATCH 2/2] chore(apollo-react): copilot nit Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/apollo-react/src/i18n/ApI18nProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/apollo-react/src/i18n/ApI18nProvider.tsx b/packages/apollo-react/src/i18n/ApI18nProvider.tsx index 26076b3ea..7183888e0 100644 --- a/packages/apollo-react/src/i18n/ApI18nProvider.tsx +++ b/packages/apollo-react/src/i18n/ApI18nProvider.tsx @@ -43,7 +43,7 @@ export interface ApI18nProviderProps { /** * Activates apollo-react's pre-built lingui catalogs for a given component - * group. Wrap any apollo-react UI (e.g. , canvas components) so its + * group. Wrap any apollo-react UI (e.g. ``, canvas components) so its * strings render in the active locale. * * `component` must be a key registered in `locale-registry.ts`. Mutates the