feat(apollo-react): add i18n support for canvas components [MST-8210]#436
feat(apollo-react): add i18n support for canvas components [MST-8210]#436david-rios-uipath wants to merge 1 commit intomainfrom
Conversation
Dependency License Review
License distribution
Excluded packages
|
73c084e to
b6f1b06
Compare
cc16cbf to
8ad5e85
Compare
CalinaCristian
left a comment
There was a problem hiding this comment.
Can you validate ap-chat (in web packages) still works properly? I think I chose cjs vs esm for some issues that were caused there.. if you run dev mode and switch language, does it actually switch?
720c6ba to
abdda60
Compare
fe4c2c3 to
b6e0981
Compare
|
It seems to be working as expected when run from web-packages after some changes to the locale copy script: Screen.Recording.2026-04-01.at.10.45.52.PM.mov |
4e1b22b to
6ddd8ee
Compare
43462ed to
2ff16b3
Compare
6ddd8ee to
3572178
Compare
2ff16b3 to
9871736
Compare
3572178 to
fcfccbe
Compare
fcfccbe to
8a517e5
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
a294277 to
c972488
Compare
b55f507 to
429b7e2
Compare
429b7e2 to
deacf88
Compare
| import type { ResizeDragEvent, ResizeParams } from '@uipath/apollo-react/canvas/xyflow/system'; | ||
| import { AnimatePresence } from 'motion/react'; | ||
| import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'; | ||
| import { ApI18nProvider } from '../../../i18n'; |
There was a problem hiding this comment.
Not a huge fan of ancestor directory reference path -- should I create an alias for i18n?
There was a problem hiding this comment.
I think it's fine for now, we can come back to this (I think we are using a mixed pattern)
Heads up:
|
Summary
module.exports) to ESM (export const messages) for better compatibility w/ StorybookCJS → ESM locale migration
Lingui's default
compileNamespaceiscjs, which outputsmodule.exports = {...}. This caused two problems:.jsfiles as ESM, so CJS locale files failed withdoes not provide an export named 'default'locale-registry.tsused ESMimportsyntax with@ts-expect-errorsuppressions to work around the CJS/ESM mismatchSetting
compileNamespace: 'es'inlingui.config.tsfixes both issues:.mjswith properexport const messages = ...locale-registry.tsuses clean typed named imports — no@ts-expect-errorneededlingui-locale.d.tstype declaration for.mjsimportslingui-cjs-to-esmVite workaround plugin from Storybook**/locales/*.mjsto.gitignore(compiled output, same as the old.jsfiles)Storybook Lingui support
@vitejs/plugin-reactwith@lingui/babel-plugin-lingui-macroto Storybook's Vite config (scoped toapollo-react/src/only)lingui.config.tsre-export so the Babel plugin can find the config from any workspace cwdTest plan
pnpm i18n:compile && pnpm testinpackages/apollo-react— verify locale compilation and tests passpnpm storybook) — verify sticky note stories render without locale errors🤖 Generated with Claude Code