Skip to content

Commit 86e0b9b

Browse files
committed
TASK: Replace leftover usages of <I18n /> if possible
1 parent eb17b95 commit 86e0b9b

File tree

6 files changed

+30
-59
lines changed

6 files changed

+30
-59
lines changed

Diff for: packages/neos-ui/src/Containers/Drawer/UserDropDown/RestoreButtonItem.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
44
import {Icon} from '@neos-project/react-ui-components';
55
import {connect} from 'react-redux';
66
import {actions} from '@neos-project/neos-ui-redux-store';
7-
import I18n, {translate} from '@neos-project/neos-ui-i18n';
7+
import {translate} from '@neos-project/neos-ui-i18n';
88

99
import buttonTheme from './style.module.css';
1010

@@ -39,13 +39,7 @@ export default class RestoreButtonItem extends React.PureComponent {
3939
aria-hidden="true"
4040
className={buttonTheme.dropDown__itemIcon}
4141
/>
42-
<I18n
43-
id="impersonate.label.restoreUserButton"
44-
sourceName="Main"
45-
packageKey="Neos.Neos"
46-
fallback={`Back to user "${originUser.fullName}"`}
47-
params={{0: originUser.fullName}}
48-
/>
42+
{translate('Neos.Neos:Main:impersonate.label.restoreUserButton', 'Back to user "{0}"', {0: originUser.fullName})}
4943
</button>
5044
</li>
5145
) : null);

Diff for: packages/neos-ui/src/Containers/Drawer/UserDropDown/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {Icon, DropDown} from '@neos-project/react-ui-components';
77
import UserImage from './UserImage';
88
import RestoreButtonItem from './RestoreButtonItem';
99

10-
import I18n from '@neos-project/neos-ui-i18n';
10+
import {translate} from '@neos-project/neos-ui-i18n';
1111

1212
import style from './style.module.css';
1313
@connect(state => ({
@@ -36,15 +36,15 @@ export default class UserDropDown extends PureComponent {
3636
<li className={style.dropDown__item}>
3737
<a title="User Settings" href={userSettingsUri}>
3838
<Icon icon="wrench" aria-hidden="true" className={style.dropDown__itemIcon}/>
39-
<I18n id="userSettings.label" sourceName="Modules" packageKey="Neos.Neos" fallback="User Settings"/>
39+
{translate('Neos.Neos:Modules:userSettings.label', 'User Settings')}
4040
</a>
4141
</li>
4242
<li className={style.dropDown__item}>
4343
<form title="Logout" action={logoutUri} method="post" role="presentation">
4444
<input type="hidden" name="__csrfToken" value={csrfToken}/>
4545
<button onClick={e => e.stopPropagation()} type="submit" name="" value="logout">
4646
<Icon icon="sign-out-alt" aria-hidden="true" className={style.dropDown__itemIcon}/>
47-
<I18n id="logout" sourceName="Main" packageKey="Neos.Neos" fallback="Logout"/>
47+
{translate('Neos.Neos:Main:logout', 'Logout')}
4848
</button>
4949
</form>
5050
</li>

Diff for: packages/neos-ui/src/Containers/Modals/InsertMode/index.js

+14-39
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {connect} from 'react-redux';
55
import {neos} from '@neos-project/neos-ui-decorators';
66

77
import {Button, Dialog, Icon} from '@neos-project/react-ui-components';
8-
import I18n, {translate} from '@neos-project/neos-ui-i18n';
8+
import {translate} from '@neos-project/neos-ui-i18n';
99

1010
import {InsertModeSelector} from '@neos-project/neos-ui-containers';
1111

@@ -81,41 +81,22 @@ export default class InsertModeModal extends PureComponent {
8181

8282
renderTitle() {
8383
const {subjectContextPaths, referenceContextPath, operationType} = this.props;
84-
84+
const parameters = {
85+
source: this.renderNodeLabel(subjectContextPaths),
86+
target: this.renderNodeLabel([referenceContextPath])
87+
};
88+
89+
let label = '';
90+
if (operationType === actionTypes.CR.Nodes.COPY) {
91+
label = translate('Neos.Neos:Main:copy__from__to--title', '', parameters);
92+
} else if (operationType === actionTypes.CR.Nodes.CUT || operationType === actionTypes.CR.Nodes.MOVE) {
93+
label = translate('Neos.Neos:Main:move__from__to--title', '', parameters);
94+
}
8595
return (
8696
<div>
8797
<Icon icon="clipboard"/>
8898
<span className={style.modalTitle}>
89-
{operationType === actionTypes.CR.Nodes.COPY &&
90-
<I18n
91-
key="copy"
92-
id="Neos.Neos:Main:copy__from__to--title"
93-
params={{
94-
source: this.renderNodeLabel(subjectContextPaths),
95-
target: this.renderNodeLabel([referenceContextPath])
96-
}}
97-
/>
98-
}
99-
{operationType === actionTypes.CR.Nodes.CUT &&
100-
<I18n
101-
key="move"
102-
id="Neos.Neos:Main:move__from__to--title"
103-
params={{
104-
source: this.renderNodeLabel(subjectContextPaths),
105-
target: this.renderNodeLabel([referenceContextPath])
106-
}}
107-
/>
108-
}
109-
{operationType === actionTypes.CR.Nodes.MOVE &&
110-
<I18n
111-
key="move"
112-
id="Neos.Neos:Main:move__from__to--title"
113-
params={{
114-
source: this.renderNodeLabel(subjectContextPaths),
115-
target: this.renderNodeLabel([referenceContextPath])
116-
}}
117-
/>
118-
}
99+
{label}
119100
</span>
120101
</div>
121102
);
@@ -173,13 +154,7 @@ export default class InsertModeModal extends PureComponent {
173154
>
174155
<div className={style.modalContents}>
175156
<p>
176-
<I18n
177-
id="Neos.Neos:Main:copy__from__to--description"
178-
params={{
179-
source: this.renderNodeLabel(subjectContextPaths),
180-
target: this.renderNodeLabel([referenceContextPath])
181-
}}
182-
/>
157+
{translate('Neos.Neos:Main:copy__from__to--description', '', {source: this.renderNodeLabel(subjectContextPaths), target: this.renderNodeLabel([referenceContextPath])})}
183158
</p>
184159
<InsertModeSelector
185160
mode={this.state.mode}

Diff for: packages/neos-ui/src/Containers/Modals/KeyboardShortcutModal/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {connect} from 'react-redux';
44

55
import {neos} from '@neos-project/neos-ui-decorators';
66
import {actions} from '@neos-project/neos-ui-redux-store';
7-
import I18n, {translate} from '@neos-project/neos-ui-i18n';
7+
import {translate} from '@neos-project/neos-ui-i18n';
88

99
import {Dialog, Button} from '@neos-project/react-ui-components';
1010
import style from './style.module.css';
@@ -26,7 +26,7 @@ class KeyboardShortcutModal extends PureComponent {
2626
renderShortcut = ({id, description, keys}) => (
2727
<div key={id} className={style.keyboardShortcut}>
2828
<div className={style.keyboardShortcut__label}>
29-
<I18n id={`Neos.Neos.Ui:Main:Shortcut__${id}`} fallback={description} />
29+
{translate(`Neos.Neos.Ui:Main:Shortcut__${id}`, description)}
3030
</div>
3131
<div className={style.keyboardShortcut__keys}>{keys}</div>
3232
</div>
@@ -52,12 +52,12 @@ class KeyboardShortcutModal extends PureComponent {
5252
return (
5353
<Dialog
5454
actions={[this.renderCloseAction()]}
55-
title={<I18n fallback="Keyboard Shortcuts" />}
55+
title="Keyboard Shortcuts"
5656
isOpen={isOpen}
5757
onRequestClose={() => close()}
5858
>
5959
<div className={style.keyboardShortcutIntroText}>
60-
<I18n id={`Neos.Neos.Ui:Main:Shortcut__Introduction`} fallback={''} />
60+
{translate('Neos.Neos.Ui:Main:Shortcut__Introduction')}
6161
</div>
6262
<div className={style.keyboardShortcutList}>
6363
{hotkeyRegistry.getAllAsList().map(key => this.renderShortcut(key))}

Diff for: packages/neos-ui/src/Containers/Modals/NodeCreationDialog/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export default class NodeCreationDialog extends PureComponent {
220220

221221
return (
222222
<span>
223-
<I18n fallback="Create new" id="createNew"/>&nbsp;
223+
{translate('Neos.Neos:Main:createNew', 'Create new')}&nbsp;
224224
<I18n id={label} fallback={label}/>
225225
</span>
226226
);

Diff for: packages/neos-ui/src/Containers/Modals/NodeVariantCreationDialog/index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
33
import {connect} from 'react-redux';
44

55
import {Button, Dialog} from '@neos-project/react-ui-components';
6-
import I18n, {translate} from '@neos-project/neos-ui-i18n';
6+
import {translate} from '@neos-project/neos-ui-i18n';
77

88
import {selectors, actions} from '@neos-project/neos-ui-redux-store';
99
import {neos} from '@neos-project/neos-ui-decorators';
@@ -147,14 +147,16 @@ export default class NodeVariantCreationDialog extends PureComponent {
147147
>
148148
<div className={style.modalContents}>
149149
<div>
150-
<I18n id="Neos.Neos:Main:content.dimension.createDialog.nodeTypeDoesNotExistInDimension" fallback="TODO" params={i18nParams}/>
150+
{translate('Neos.Neos:Main:content.dimension.createDialog.nodeTypeDoesNotExistInDimension', '', i18nParams)}
151151
</div>
152152

153153
<div>
154-
<I18n id="Neos.Neos:Main:content.dimension.createDialog.createEmptyOrCopy" fallback="TODO" params={i18nParams}/>
154+
{translate('Neos.Neos:Main:content.dimension.createDialog.createEmptyOrCopy', '', i18nParams)}
155155
</div>
156156
{numberOfParentNodesToBeCreated > 0 ?
157-
<div><I18n id="Neos.Neos:Main:content.dimension.createDialog.existingAncestorDocuments" fallback="TODO" params={{numberOfNodesMissingInRootline: numberOfParentNodesToBeCreated}}/></div> : null
157+
<div>
158+
{translate('Neos.Neos:Main:content.dimension.createDialog.existingAncestorDocuments', '', {numberOfNodesMissingInRootline: numberOfParentNodesToBeCreated})}
159+
</div> : null
158160
}
159161
</div>
160162
</Dialog>

0 commit comments

Comments
 (0)