From 9cf17b477ec9cfc318d635ebe499cffb821cefbd Mon Sep 17 00:00:00 2001 From: Sandra Monnier <70577952+SandraMonnier@users.noreply.github.com> Date: Fri, 10 Jan 2025 16:09:38 +0100 Subject: [PATCH 1/2] =?UTF-8?q?WEG-138=20Use=20player=20language=20to=20tr?= =?UTF-8?q?anslate=20component=E2=80=99s=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/node/wegas-react/src/Components/Outputs/Inbox.tsx | 6 +++--- .../src/main/node/wegas-react/src/Components/Selector.tsx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wegas-app/src/main/node/wegas-react/src/Components/Outputs/Inbox.tsx b/wegas-app/src/main/node/wegas-react/src/Components/Outputs/Inbox.tsx index 56c98abb57..4c63891e66 100644 --- a/wegas-app/src/main/node/wegas-react/src/Components/Outputs/Inbox.tsx +++ b/wegas-app/src/main/node/wegas-react/src/Components/Outputs/Inbox.tsx @@ -25,7 +25,7 @@ import { editingStore } from '../../data/Stores/editingStore'; import { useStore } from '../../data/Stores/store'; import { wwarn } from '../../Helper/wegaslog'; import { componentsTranslations } from '../../i18n/components/components'; -import { useInternalTranslate } from '../../i18n/internalTranslator'; +import { useInternalPlayerLangTranslate } from '../../i18n/internalTranslator'; import { DefaultEntityChooserLabel, defaultEntityDisplay, @@ -177,7 +177,7 @@ interface MessageDisplayProps { } function MessageDisplay({ entity }: MessageDisplayProps) { - const i18nComponentValues = useInternalTranslate(componentsTranslations); + const i18nComponentValues = useInternalPlayerLangTranslate(componentsTranslations); const subject = useTranslate(entity.subject); const date = useTranslate(entity.date); @@ -233,7 +233,7 @@ export function InboxDisplay({ }, [inbox]); const messages = useStore(messagesSelector); - const i18nComponentValues = useInternalTranslate(componentsTranslations); + const i18nComponentValues = useInternalPlayerLangTranslate(componentsTranslations); return ( ({ readOnly, disabled, }: SelectorProps): JSX.Element { - const i18nValues = useInternalTranslate(componentsTranslations).select; + const i18nValues = useInternalPlayerLangTranslate(componentsTranslations).select; const options = buildOptions(choices); From bec9cad1390323ad029d38c3b634b49689d411d5 Mon Sep 17 00:00:00 2001 From: Mikkel Vestergaard <56039404+TehAwol@users.noreply.github.com> Date: Thu, 16 Jan 2025 10:07:26 +0100 Subject: [PATCH 2/2] Use InternalPlayerLang for PeerReview page components --- .../Advanced/PeerReviewTreeViewDisplay.component.tsx | 10 +++++----- .../Advanced/PeerReviewVariableEditor.component.tsx | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewTreeViewDisplay.component.tsx b/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewTreeViewDisplay.component.tsx index 0c4484bacc..2e0a6c3edc 100644 --- a/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewTreeViewDisplay.component.tsx +++ b/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewTreeViewDisplay.component.tsx @@ -47,7 +47,7 @@ import * as VariableDescriptorSelector from '../../../data/selectors/VariableDes import { editingStore } from '../../../data/Stores/editingStore'; import { useStore } from '../../../data/Stores/store'; import { createFindVariableScript } from '../../../Helper/wegasEntites'; -import { useInternalTranslate } from '../../../i18n/internalTranslator'; +import { useInternalPlayerLangTranslate } from '../../../i18n/internalTranslator'; import { PeerReviewTranslations } from '../../../i18n/peerReview/definitions'; import { peerReviewTranslations } from '../../../i18n/peerReview/peerReview'; import { languagesCTX } from '../../Contexts/LanguagesProvider'; @@ -141,7 +141,7 @@ const prPhasesJustifyStyle = css({ const phases = ['edition', 'reviewing', 'commenting', 'completed']; function PRPHaseComponent({ value, phase }: PhaseComponentProps) { - const i18nValues = useInternalTranslate(peerReviewTranslations); + const i18nValues = useInternalPlayerLangTranslate(peerReviewTranslations); return (
{ @@ -518,7 +518,7 @@ function ReviewEditor({ disabled, readOnly, }: ReviewEditorProps) { - const i18nValues = useInternalTranslate(peerReviewTranslations); + const i18nValues = useInternalPlayerLangTranslate(peerReviewTranslations); const rev = useStore(() => { const reviewed = peerReview @@ -669,7 +669,7 @@ export default function PeerReviewTreeViewDisplay({ id, options, }: PeerReviewTreeViewDisplayProps) { - const i18nValues = useInternalTranslate(peerReviewTranslations); + const i18nValues = useInternalPlayerLangTranslate(peerReviewTranslations); const sPR = useScript(peerReview, context); const sPRinstance = useStore(() => sPR?.getInstance(Player.self())); diff --git a/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewVariableEditor.component.tsx b/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewVariableEditor.component.tsx index f72a452c5d..8e9671bf27 100644 --- a/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewVariableEditor.component.tsx +++ b/wegas-app/src/main/node/wegas-react/src/Components/PageComponents/Advanced/PeerReviewVariableEditor.component.tsx @@ -31,7 +31,7 @@ import { findByName } from '../../../data/selectors/VariableDescriptorSelector'; import { editingStore } from '../../../data/Stores/editingStore'; import { store, useStore } from '../../../data/Stores/store'; import { createFindVariableScript } from '../../../Helper/wegasEntites'; -import { useInternalTranslate } from '../../../i18n/internalTranslator'; +import { useInternalPlayerLangTranslate } from '../../../i18n/internalTranslator'; import { peerReviewTranslations } from '../../../i18n/peerReview/peerReview'; import { languagesCTX } from '../../Contexts/LanguagesProvider'; import { deepDifferent } from '../../Hooks/storeHookFactory'; @@ -73,7 +73,7 @@ export default function PeerReviewVariableEditor({ const lastVal = React.useRef(); const timer = React.useRef(); const { lang } = React.useContext(languagesCTX); - const i18nValues = useInternalTranslate(peerReviewTranslations); + const i18nValues = useInternalPlayerLangTranslate(peerReviewTranslations); const sPR = useScript(peerReview, context); const reviewState = useStore(() => sPR?.getInstance(Player.self()).getReviewState(), @@ -185,7 +185,7 @@ export default function PeerReviewVariableEditor({ if (reviewState !== 'NOT_STARTED') { return (
-

Your submission:

+

{i18nValues.tabview.toReview}:

);