Add localization (i18n) support #15#46
Add localization (i18n) support #15#46kumaradityaraj wants to merge 13 commits intoserverlessworkflow:mainfrom
Conversation
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
|
@fantonangeli Please review this PR. Thank you. |
There was a problem hiding this comment.
Pull request overview
This PR introduces initial internationalization (i18n) scaffolding by adding a shared @serverlessworkflow/i18n workspace package and wiring i18n initialization/usage into the diagram editor so React components can call useTranslation().
Changes:
- Added new
@serverlessworkflow/i18npackage with i18next + react-i18next configuration and English resources. - Initialized i18n in
serverless-workflow-diagram-editorand demonstrateduseTranslation()usage. - Updated workspace dependencies/lockfile to include the new package and i18n libraries.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds lock entries for the new i18n package and i18next/react-i18next deps. |
| packages/serverless-workflow-diagram-editor/src/i18n.ts | Initializes i18next via shared setupI18n. |
| packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx | Imports i18n setup and renders a few translated strings via useTranslation(). |
| packages/serverless-workflow-diagram-editor/package.json | Adds dependencies for shared i18n package and i18n libraries. |
| packages/i18n/tsconfig.json | TypeScript build config for the new i18n package. |
| packages/i18n/src/types.d.ts | Adds react-i18next type augmentation for typed resources/namespace. |
| packages/i18n/src/resources.ts | Defines resources map and imports English JSON bundle. |
| packages/i18n/src/locales/en/common.json | English string bundle for the default namespace. |
| packages/i18n/src/index.ts | Exports i18n config/resources from the new package. |
| packages/i18n/src/config.ts | Implements setupI18n() using i18next + initReactI18next. |
| packages/i18n/package.json | Declares the new workspace package, scripts, and dependencies. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
fantonangeli
left a comment
There was a problem hiding this comment.
Thanks a lot @kumaradityaraj for this PR.
I also add some points here:
- please write a short README file explaining how to use it and how to add languages to components
|
@kumaradityaraj Let me know when you have addressed @fantonangeli comments and I will review again, thanks! |
|
@lornakelly Handrey suggested something similar to implement like this - I18nDictionariesProvider So i am looking at it as this is more modular and easy to use |
|
@kumaradityaraj, maybe you can try with the official provider: https://react.i18next.com/latest/i18nextprovider ? |
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
handreyrc
left a comment
There was a problem hiding this comment.
Supported languages settings and translations could be package specific in my opinion.
WDYT?
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 4 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Show resolved
Hide resolved
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 8 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Show resolved
Hide resolved
packages/i18n/src/react-components/I18nDictionariesProvider.tsx
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/i18n/SwdEditorI18n.ts
Outdated
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Show resolved
Hide resolved
packages/serverless-workflow-diagram-editor/src/diagram-editor/DiagramEditor.tsx
Show resolved
Hide resolved
Signed-off-by: kumaradityaraj <sedulous.0007@gmail.com>
Closes 15
Summary
This PR sets up internationalization (i18n) support for the project by introducing a shared
@serverlessworkflow/i18npackage and integrating it into the diagram editor.Changes
@serverlessworkflow/i18nto centralize i18n configuration.useTranslation()without additional setup.