From 47ba00f65e7d9ec2e43c0669890936552ef1fcde Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 17:59:34 +0100 Subject: [PATCH 1/8] ForEachEvent --- .../src/EventsSheet/EventsTree/Renderers/ForEachEvent.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js index 892901e7fcce..f3ad837d4e79 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js @@ -14,6 +14,7 @@ import ObjectField from '../../ParameterFields/ObjectField'; import { type EventRendererProps } from './EventRenderer'; import ConditionsActionsColumns from '../ConditionsActionsColumns'; import { shouldActivate } from '../../../UI/KeyboardShortcuts/InteractionKeys.js'; +import { Trans } from '@lingui/macro'; const gd: libGDevelop = global.gd; const styles = { @@ -103,10 +104,12 @@ export default class ForEachEvent extends React.Component< tabIndex={0} > {objectName ? ( - `Repeat for each instance of ${objectName}:` + {`Repeat for each instance of ${objectName}:`} ) : ( - Click to choose for which objects this event will be repeated + + Click to choose for which objects this event will be repeated + )} From 9f1e2e8c13399fdca696ef7f77918f81ec17962d Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 18:06:51 +0100 Subject: [PATCH 2/8] GroupEvent --- .../app/src/EventsSheet/EventsTree/Renderers/GroupEvent.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/GroupEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/GroupEvent.js index fe23d70f20fd..856020190faa 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/GroupEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/GroupEvent.js @@ -16,6 +16,7 @@ import { shouldCloseOrCancel, shouldValidate, } from '../../../UI/KeyboardShortcuts/InteractionKeys'; +import { Trans } from '@lingui/macro'; const gd: libGDevelop = global.gd; const styles = { @@ -121,7 +122,11 @@ export default class GroupEvent extends React.Component { })} style={{ ...styles.title, color: textColor }} > - {groupEvent.getName() || ''} + {groupEvent.getName() ? ( + groupEvent.getName() + ) : ( + {``} + )} )} From 2ca90202075fbb57e3035db31af6e148094f1dd1 Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 18:32:25 +0100 Subject: [PATCH 3/8] JsCodeEvent - Font size look like font size of the JS code from monaco editor. - Add translation tags. -Use \u00A0 as a white space for keep the white space like before. --- .../EventsSheet/EventsTree/Renderers/JsCodeEvent.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js index 36085409aca4..ea443f82f064 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js @@ -17,6 +17,7 @@ import { type EventRendererProps } from './EventRenderer'; import Measure from 'react-measure'; import { CodeEditor } from '../../../CodeEditor'; import { shouldActivate } from '../../../UI/KeyboardShortcuts/InteractionKeys'; +import { Trans } from '@lingui/macro'; const gd: libGDevelop = global.gd; const fontFamily = '"Lucida Console", Monaco, monospace'; @@ -32,7 +33,7 @@ const styles = { }, wrappingText: { fontFamily, - fontSize: '12px', + fontSize: '13px', paddingLeft: 5, paddingRight: 5, paddingTop: 2, @@ -186,9 +187,11 @@ export default class JsCodeEvent extends React.Component< tabIndex={0} style={textStyle} > - {parameterObjects - ? `, objects /*${parameterObjects}*/` - : ' /* Click here to choose objects to pass to JavaScript */'} + {parameterObjects ? ( + {`, objects /*${parameterObjects}*/`} + ) : ( + {`\u00A0/* Click here to choose objects to pass to JavaScript */`} + )} ); From 928b499526d4483470dde8d0313fe7822baa6c90 Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 18:36:12 +0100 Subject: [PATCH 4/8] LinkEvent - Keep simple special chars --- newIDE/app/src/EventsSheet/EventsTree/Renderers/LinkEvent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/LinkEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/LinkEvent.js index 28753d01fb09..2005bcdd958b 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/LinkEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/LinkEvent.js @@ -135,7 +135,7 @@ export default class LinkEvent extends React.Component { tabIndex={0} > {target || ( - < Enter the name of external events > + {``} )} From c281c93125aff1a9a4aecaa78a1a35ed9aa8159e Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 18:42:39 +0100 Subject: [PATCH 5/8] RepeatEvent --- .../src/EventsSheet/EventsTree/Renderers/RepeatEvent.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js index 8a52926c9f85..12cfd273a35d 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js @@ -14,6 +14,7 @@ import DefaultField from '../../ParameterFields/DefaultField'; import { type EventRendererProps } from './EventRenderer'; import ConditionsActionsColumns from '../ConditionsActionsColumns'; import { shouldActivate } from '../../../UI/KeyboardShortcuts/InteractionKeys.js'; +import { Trans } from '@lingui/macro'; const gd: libGDevelop = global.gd; const styles = { @@ -104,9 +105,11 @@ export default class RepeatEvent extends React.Component< tabIndex={0} > {expression ? ( - `Repeat ${expression} times:` + {`Repeat ${expression} times:`} ) : ( - Click to choose how many times will be repeated + + Click to choose how many times will be repeated + )} From bde14c1c21d9b8973159c28d6e44f72a5dd27d5c Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 18:47:34 +0100 Subject: [PATCH 6/8] WhileEvent --- .../app/src/EventsSheet/EventsTree/Renderers/WhileEvent.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/WhileEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/WhileEvent.js index 1887b8a1a554..ad3fe801b1ff 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/WhileEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/WhileEvent.js @@ -11,6 +11,7 @@ import { } from '../ClassNames'; import { type EventRendererProps } from './EventRenderer'; import ConditionsActionsColumns from '../ConditionsActionsColumns'; +import { Trans } from '@lingui/macro'; const gd: libGDevelop = global.gd; const styles = { @@ -47,7 +48,7 @@ export default class ForEachEvent extends React.Component< [disabledText]: this.props.disabled, })} > - While these conditions are true: + While these conditions are true: - Repeat these: + Repeat these: Date: Wed, 30 Dec 2020 20:24:15 +0100 Subject: [PATCH 7/8] Review --- .../src/EventsSheet/EventsTree/Renderers/ForEachEvent.js | 2 +- .../app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js | 6 ++++-- .../app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js index f3ad837d4e79..46c9c9ca2575 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/ForEachEvent.js @@ -104,7 +104,7 @@ export default class ForEachEvent extends React.Component< tabIndex={0} > {objectName ? ( - {`Repeat for each instance of ${objectName}:`} + Repeat for each instance of {objectName}: ) : ( diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js index ea443f82f064..36936d256bd7 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js @@ -188,9 +188,11 @@ export default class JsCodeEvent extends React.Component< style={textStyle} > {parameterObjects ? ( - {`, objects /*${parameterObjects}*/`} + , objects /*{parameterObjects}*/ ) : ( - {`\u00A0/* Click here to choose objects to pass to JavaScript */`} + <>{' '} + /* Click here to choose objects to pass to JavaScript */ + )} ); diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js index 12cfd273a35d..fa3a370cf425 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/RepeatEvent.js @@ -105,7 +105,7 @@ export default class RepeatEvent extends React.Component< tabIndex={0} > {expression ? ( - {`Repeat ${expression} times:`} + Repeat {expression} times: ) : ( Click to choose how many times will be repeated From cbfe41acd787d6d8027fe8b8d8b5eabd51d2b05e Mon Sep 17 00:00:00 2001 From: Bouh Date: Wed, 30 Dec 2020 21:08:13 +0100 Subject: [PATCH 8/8] Prettier --- .../src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js b/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js index 36936d256bd7..63824f374997 100644 --- a/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js +++ b/newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js @@ -190,8 +190,11 @@ export default class JsCodeEvent extends React.Component< {parameterObjects ? ( , objects /*{parameterObjects}*/ ) : ( - <>{' '} - /* Click here to choose objects to pass to JavaScript */ + <> + {' '} + + /* Click here to choose objects to pass to JavaScript */ + )}