You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "Kusuma04-dev (via GitHub)" <gi...@apache.org> on 2025/08/08 08:39:34 UTC
[PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Kusuma04-dev opened a new pull request, #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223
closes https://github.com/apache/incubator-kie-tools/issues/3222
Added i18n for keyboardshortcuts in dmn editor envelope package
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "ljmotta (via GitHub)" <gi...@apache.org>.
ljmotta commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2273589853
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -189,6 +191,7 @@ export function DmnEditorRootWrapper({
isReadOnly={isReadOnly}
isImportDataTypesFromJavaClassesSupported={isImportDataTypesFromJavaClassesSupported}
javaCodeCompletionService={javaCodeCompletionService}
+ i18n={i18n}
Review Comment:
You can pass the `I18nDictionariesProvider` in the `DmnEditorInterface` `af_componentRoot`, and use the hook in the `DmnEditorRoot`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "Kusuma04-dev (via GitHub)" <gi...@apache.org>.
Kusuma04-dev commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2263156558
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -189,6 +191,7 @@ export function DmnEditorRootWrapper({
isReadOnly={isReadOnly}
isImportDataTypesFromJavaClassesSupported={isImportDataTypesFromJavaClassesSupported}
javaCodeCompletionService={javaCodeCompletionService}
+ i18n={i18n}
Review Comment:
Thanks for the review @ljmotta . I have tried this but DmnEditorRoot is a class so getting issue like this: `React Hook "useDmnEditorEnvelopeI18n" cannot be called in a class component`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "ljmotta (via GitHub)" <gi...@apache.org>.
ljmotta commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2290988094
##########
packages/i18n-common-dictionary/src/CommonI18n.ts:
##########
@@ -79,6 +79,35 @@ export type CommonDictionary = {
uninstall: string;
username: string;
validation: string;
+ keyboardShortCuts: {
+ ctrlC: string;
+ ctrlX: string;
+ ctrlV: string;
+ ctrl: string;
+ escape: string;
+ backspace: string;
+ delete: string;
+ up: string;
+ down: string;
+ left: string;
+ right: string;
+ a: string;
+ x: string;
+ g: string;
+ i: string;
+ h: string;
+ b: string;
+ shiftUp: string;
+ shiftDown: string;
+ shiftLeft: string;
+ shiftRight: string;
+ space: string;
+ shift: string;
+ edit: string;
+ misc: string;
+ move: string;
+ navigate: string;
+ };
Review Comment:
I believe the correct separation would be:
- `keyboardKeys` for the keyboard keys.
- The sections (`edit`, `misc`, etc) should be on the specific dictionary of the package that will use it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "tiagobento (via GitHub)" <gi...@apache.org>.
tiagobento merged PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "Kusuma04-dev (via GitHub)" <gi...@apache.org>.
Kusuma04-dev commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2291752395
##########
packages/i18n-common-dictionary/src/CommonI18n.ts:
##########
@@ -79,6 +79,35 @@ export type CommonDictionary = {
uninstall: string;
username: string;
validation: string;
+ keyboardShortCuts: {
+ ctrlC: string;
+ ctrlX: string;
+ ctrlV: string;
+ ctrl: string;
+ escape: string;
+ backspace: string;
+ delete: string;
+ up: string;
+ down: string;
+ left: string;
+ right: string;
+ a: string;
+ x: string;
+ g: string;
+ i: string;
+ h: string;
+ b: string;
+ shiftUp: string;
+ shiftDown: string;
+ shiftLeft: string;
+ shiftRight: string;
+ space: string;
+ shift: string;
+ edit: string;
+ misc: string;
+ move: string;
+ navigate: string;
+ };
Review Comment:
Thanks for the review @ljmotta . I have made the changes. Please let me know if anything else is needed. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "ljmotta (via GitHub)" <gi...@apache.org>.
ljmotta commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2262961575
##########
packages/i18n-common-dictionary/src/locales/de.ts:
##########
@@ -81,5 +81,34 @@ export const de: CommonI18n = {
uninstall: "Deinstallieren",
username: "Username",
validation: "Validierung",
+ keyboardShortCuts: {
+ ctrlC: "",
+ ctrlX: "",
+ ctrlV: "",
+ ctrl: "",
+ escape: "",
+ backspace: "",
+ delete: "",
+ up: "",
+ down: "",
+ left: "",
+ right: "",
+ a: "",
+ x: "",
+ g: "",
+ i: "",
+ h: "",
+ b: "",
+ shiftUp: "",
+ shiftDown: "",
+ shiftLeft: "",
+ shiftRight: "",
+ space: "",
+ shift: "",
+ edit: "",
+ misc: "",
+ move: "",
+ navigate: "",
+ },
Review Comment:
We shouldn't add anything for this case. `i18n` will automatically fallback to `en` dictionary.
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -189,6 +191,7 @@ export function DmnEditorRootWrapper({
isReadOnly={isReadOnly}
isImportDataTypesFromJavaClassesSupported={isImportDataTypesFromJavaClassesSupported}
javaCodeCompletionService={javaCodeCompletionService}
+ i18n={i18n}
Review Comment:
```tsx
<I18nDictionariesProvider
defaults={dmnEditorEnvelopeI18nDefaults}
dictionaries={dmnEditorEnvelopeI18nDictionaries}
initialLocale={navigator.language}
ctx={DmnEditorEnvelopeI18nContext}
>
<DmnEditorRoot ... />
</I18nDictionariesProvider>
```
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -189,6 +191,7 @@ export function DmnEditorRootWrapper({
isReadOnly={isReadOnly}
isImportDataTypesFromJavaClassesSupported={isImportDataTypesFromJavaClassesSupported}
javaCodeCompletionService={javaCodeCompletionService}
+ i18n={i18n}
Review Comment:
You should've added the `I18nDictionariesProvider` before `DmnEditorRoot`, so you can use the `const { i18n } = useDmnEditorEnvelopeI18n();` hook on the `DmnEditorRoot` component.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "ljmotta (via GitHub)" <gi...@apache.org>.
ljmotta commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2299288114
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -34,6 +34,13 @@ import { Notification } from "@kie-tools-core/notifications/dist/api";
import { ResourceContent, ResourcesList, WorkspaceEdit } from "@kie-tools-core/workspace/dist/api";
import { DmnEditorRoot, JavaCodeCompletionExposedInteropApi } from "./DmnEditorRoot";
import { VsCodeNewDmnEditorEnvelopeContext } from "./vscode/VsCodeNewDmnEditorFactory";
+import {
+ DmnEditorEnvelopeI18nContext,
+ dmnEditorEnvelopeI18nDefaults,
+ dmnEditorEnvelopeI18nDictionaries,
+ useDmnEditorEnvelopeI18n,
+} from "./i18n";
+import { I18nDictionariesProvider } from "../../i18n/dist/react-components";
Review Comment:
@Kusuma04-dev Please double check the imports.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org
Re: [PR] kie-issues#3222: Add i18n for dmn-editor-envelope package [incubator-kie-tools]
Posted by "Kusuma04-dev (via GitHub)" <gi...@apache.org>.
Kusuma04-dev commented on code in PR #3223:
URL: https://github.com/apache/incubator-kie-tools/pull/3223#discussion_r2300037109
##########
packages/dmn-editor-envelope/src/DmnEditorFactory.tsx:
##########
@@ -34,6 +34,13 @@ import { Notification } from "@kie-tools-core/notifications/dist/api";
import { ResourceContent, ResourcesList, WorkspaceEdit } from "@kie-tools-core/workspace/dist/api";
import { DmnEditorRoot, JavaCodeCompletionExposedInteropApi } from "./DmnEditorRoot";
import { VsCodeNewDmnEditorEnvelopeContext } from "./vscode/VsCodeNewDmnEditorFactory";
+import {
+ DmnEditorEnvelopeI18nContext,
+ dmnEditorEnvelopeI18nDefaults,
+ dmnEditorEnvelopeI18nDictionaries,
+ useDmnEditorEnvelopeI18n,
+} from "./i18n";
+import { I18nDictionariesProvider } from "../../i18n/dist/react-components";
Review Comment:
Thanks @ljmotta . I have reviewed and updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org