Skip to content

Commit

Permalink
TASK: Replace usages of <I18n /> with only one parameter
Browse files Browse the repository at this point in the history
Also appends Neos.Neos:Main if necessary, which was forgotten in:

05fe5f8
  • Loading branch information
mhsdesign committed Jan 27, 2025
1 parent 82553f1 commit 0885715
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions packages/neos-ui-containers/src/InsertModeSelector/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';

import {ButtonGroup, Button, ResourceIcon} from '@neos-project/react-ui-components';
import I18n, {translate} from '@neos-project/neos-ui-i18n';
import {translate} from '@neos-project/neos-ui-i18n';

import style from './style.module.css';

Expand Down Expand Up @@ -86,7 +86,7 @@ export default class InsertModeSelector extends PureComponent {
return (
<div className={style.root}>
<span className={style.label}>
<I18n id="Neos.Neos:Main:insertMode"/>&nbsp;
{translate('Neos.Neos:Main:insertMode')}&nbsp;
</span>
<ButtonGroup value={mode} onSelect={this.handleSelect} className={style.buttonGroup}>
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ResizeControls = props => {
return (
<div>
<div className={style.resizeControls__item}>
<div className={style.resizeControls__label}>{translate('width', 'Width')}:</div>
<div className={style.resizeControls__label}>{translate('Neos.Neos:Main:width', 'Width')}:</div>
<div className={style.resizeControls}>
<span className={style.resizeControls__before}>
<CheckBox
Expand All @@ -74,7 +74,7 @@ const ResizeControls = props => {
</div>
</div>
<div>
<div className={style.resizeControls__label}>{translate('height', 'Height')}:</div>
<div className={style.resizeControls__label}>{translate('Neos.Neos:Main:height', 'Height')}:</div>
<div className={style.resizeControls}>
<span className={style.resizeControls__before}>
<CheckBox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TestBackend from 'react-dnd-test-backend';
import {DndProvider as DragDropContextProvider} from 'react-dnd';
import SelectBoxEditor from './index.js';
import {WrapWithMockGlobalRegistry, MockDataSourceDataLoader} from '../../_lib/testUtils';
import {setupI18n} from "@neos-project/neos-ui-i18n";
import {setupI18n} from '@neos-project/neos-ui-i18n';

const optionValues = {
foo: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {processSelectBoxOptions} from './selectBoxHelpers';
import {I18nRegistry} from '@neos-project/neos-ts-interfaces';
import {setupI18n} from "@neos-project/neos-ui-i18n";
import {setupI18n} from '@neos-project/neos-ui-i18n';

const fakeI18NRegistry = {
translate: (id) => id ?? ''
Expand Down
4 changes: 2 additions & 2 deletions packages/neos-ui-validators/src/Count/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import I18n from '@neos-project/neos-ui-i18n';
import I18n, {translate} from '@neos-project/neos-ui-i18n';
import logger from '@neos-project/utils-logger';

/**
Expand Down Expand Up @@ -28,7 +28,7 @@ const Count = (value: any, validatorOptions: CountOptions) => {
}

if (typeof value !== 'object' || value === null) {
return <I18n id="content.inspector.validators.countValidator.notCountable"/>;
return translate('Neos.Neos:Main:content.inspector.validators.countValidator.notCountable', '');
}

const {length} = Object.keys(value);
Expand Down
4 changes: 2 additions & 2 deletions packages/neos-ui-validators/src/NumberRange/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import I18n from '@neos-project/neos-ui-i18n';
import I18n, {translate} from '@neos-project/neos-ui-i18n';
import logger from '@neos-project/utils-logger';

/**
Expand Down Expand Up @@ -33,7 +33,7 @@ const NumberRange = (value: any, validatorOptions: NumberRangeOptions) => {
}

if (value.length > 0 && !Number.isSafeInteger(number)) {
return <I18n id="content.inspector.validators.numberRangeValidator.validNumberExpected"/>;
return translate('Neos.Neos:Main:content.inspector.validators.numberRangeValidator.validNumberExpected', '');
}
if (number < minimum || number > maximum) {
const label = validatorOptions?.validationErrorMessage ?? 'content.inspector.validators.numberRangeValidator.numberShouldBeInRange';
Expand Down
4 changes: 2 additions & 2 deletions packages/neos-ui-views/src/Data/DataLoader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {neos} from '@neos-project/neos-ui-decorators';
import {selectors} from '@neos-project/neos-ui-redux-store';
import Widget from '../../Widget/index';
import Icon from '@neos-project/react-ui-components/src/Icon/';
import I18n from '@neos-project/neos-ui-i18n';
import style from './style.module.css';
import isEqual from 'lodash.isequal';
import {translate} from '@neos-project/neos-ui-i18n';

/*
* This HOC is responsible for fetching data for Data views and wraping
Expand Down Expand Up @@ -91,7 +91,7 @@ export default () => WrappedComponent => {
}

if (!this.state.data) {
return (<div><I18n id="Neos.Neos:Main:loading"/></div>);
return (<div>{translate('Neos.Neos:Main:loading')}</div>);
}

return (<WrappedComponent data={this.state.data} {...this.props}/>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {actions, selectors} from '@neos-project/neos-ui-redux-store';
import {neos} from '@neos-project/neos-ui-decorators';

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

import style from './style.module.css';

Expand Down Expand Up @@ -85,7 +85,7 @@ export default class UnappliedChangesDialog extends PureComponent {
className={`${style.button} ${style.discardButton}`}
>
<Icon icon="ban" className={style.buttonIcon}/>
<I18n id="Neos.Neos:Main:content.inspector.unappliedChangesDialog.button.danger"/>
{translate('Neos.Neos:Main:content.inspector.unappliedChangesDialog.button.danger')}
</Button>
);
}
Expand All @@ -100,7 +100,7 @@ export default class UnappliedChangesDialog extends PureComponent {
onClick={this.handleResume}
className={`${style.button} ${style.resumeButton}`}
>
<I18n id="Neos.Neos:Main:content.inspector.unappliedChangesDialog.button.default"/>
{translate('Neos.Neos:Main:content.inspector.unappliedChangesDialog.button.default')}
</Button>
);
}
Expand All @@ -119,7 +119,7 @@ export default class UnappliedChangesDialog extends PureComponent {
className={`${style.button} ${style.publishButton}`}
>
<Icon icon="check" className={style.buttonIcon}/>
<I18n id="Neos.Neos:Main:content.inspector.unappliedChangesDialog.button.success"/>
{translate('Neos.Neos:Main:content.inspector.unappliedChangesDialog.button.success')}
</Button>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {connect} from 'react-redux';

import {Headline, SelectBox} from '@neos-project/react-ui-components';
import I18n from '@neos-project/neos-ui-i18n';
import {translate} from '@neos-project/neos-ui-i18n';

import {actions, selectors} from '@neos-project/neos-ui-redux-store';
import {neos} from '@neos-project/neos-ui-decorators';
Expand Down Expand Up @@ -57,7 +57,7 @@ export default class SelectedElement extends PureComponent {
<section className={sidebarStyle.rightSideBar__header}>
<Headline className={style.label}>
<span>
<I18n id="Neos.Neos:Main:content.inspector.inspectorView.selectedElement"/>
{translate('Neos.Neos:Main:content.inspector.inspectorView.selectedElement')}
</span>
</Headline>
<div className={style.content}>
Expand Down

0 comments on commit 0885715

Please sign in to comment.