Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing translation tags for events #2160

Merged
merged 8 commits into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -103,10 +104,12 @@ export default class ForEachEvent extends React.Component<
tabIndex={0}
>
{objectName ? (
`Repeat for each instance of ${objectName}:`
<Trans>{`Repeat for each instance of ${objectName}:`}</Trans>
Bouh marked this conversation as resolved.
Show resolved Hide resolved
) : (
<i>
Click to choose for which objects this event will be repeated
<Trans>
Click to choose for which objects this event will be repeated
</Trans>
</i>
)}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
shouldCloseOrCancel,
shouldValidate,
} from '../../../UI/KeyboardShortcuts/InteractionKeys';
import { Trans } from '@lingui/macro';
const gd: libGDevelop = global.gd;

const styles = {
Expand Down Expand Up @@ -121,7 +122,11 @@ export default class GroupEvent extends React.Component<EventRendererProps, *> {
})}
style={{ ...styles.title, color: textColor }}
>
{groupEvent.getName() || '<Enter group name>'}
{groupEvent.getName() ? (
groupEvent.getName()
) : (
<Trans>{`<Enter group name>`}</Trans>
4ian marked this conversation as resolved.
Show resolved Hide resolved
)}
</span>
)}
</div>
Expand Down
11 changes: 7 additions & 4 deletions newIDE/app/src/EventsSheet/EventsTree/Renderers/JsCodeEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -32,7 +33,7 @@ const styles = {
},
wrappingText: {
fontFamily,
fontSize: '12px',
fontSize: '13px',
paddingLeft: 5,
paddingRight: 5,
paddingTop: 2,
Expand Down Expand Up @@ -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 ? (
<Trans>{`, objects /*${parameterObjects}*/`}</Trans>
Bouh marked this conversation as resolved.
Show resolved Hide resolved
) : (
<Trans>{`\u00A0/* Click here to choose objects to pass to JavaScript */`}</Trans>
4ian marked this conversation as resolved.
Show resolved Hide resolved
)}
</span>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default class LinkEvent extends React.Component<EventRendererProps, *> {
tabIndex={0}
>
{target || (
<Trans>&lt; Enter the name of external events &gt;</Trans>
<Trans>{`<Enter the name of external events>`}</Trans>
)}
</i>
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -104,9 +105,11 @@ export default class RepeatEvent extends React.Component<
tabIndex={0}
>
{expression ? (
`Repeat ${expression} times:`
<Trans>{`Repeat ${expression} times:`}</Trans>
) : (
<i>Click to choose how many times will be repeated</i>
<i>
<Trans>Click to choose how many times will be repeated</Trans>
</i>
)}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -47,7 +48,7 @@ export default class ForEachEvent extends React.Component<
[disabledText]: this.props.disabled,
})}
>
While these conditions are true:
<Trans>While these conditions are true:</Trans>
</div>
<InstructionsList
instrsList={whileEvent.getWhileConditions()}
Expand Down Expand Up @@ -76,7 +77,7 @@ export default class ForEachEvent extends React.Component<
[disabledText]: this.props.disabled,
})}
>
Repeat these:
<Trans>Repeat these:</Trans>
</div>
<ConditionsActionsColumns
leftIndentWidth={this.props.leftIndentWidth}
Expand Down