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

Fix Translation mess #502

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 6 additions & 2 deletions demo/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ import {
top_bar_fr,
treeview_finder_en,
treeview_finder_fr,
inputs_en,
inputs_fr,
} from '../../src/index';
import translations from './demo_intl';

Expand Down Expand Up @@ -103,8 +105,8 @@ import { FlatParametersTab } from './FlatParametersTab';

import { toNestedGlobalSelectors } from '../../src/utils/styles';
import { InputsTab } from './InputsTab';
import inputs_en from '../../src/components/translations/inputs-en';
import inputs_fr from '../../src/components/translations/inputs-fr';
import demo_inputs_en from './components/translations/demo-inputs-en';
import demo_inputs_fr from './components/translations/demo-inputs-fr';
import { EquipmentSearchDialog } from './equipment-search';
import { InlineSearch } from './inline-search';

Expand All @@ -123,6 +125,7 @@ const messages = {
...flat_parameters_en,
...multiple_selection_dialog_en,
...inputs_en,
...demo_inputs_en,
...translations.en,
},
fr: {
Expand All @@ -139,6 +142,7 @@ const messages = {
...flat_parameters_fr,
...multiple_selection_dialog_fr,
...inputs_fr,
...demo_inputs_fr,
...translations.fr,
},
};
Expand Down
25 changes: 25 additions & 0 deletions demo/src/components/translation/demo-inputs-en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2022, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

const demo_inputs_en = {
'inputs/kiki': 'Kylian Mbappe',
'inputs/ney': 'Neymar',
'inputs/lapulga': 'Lionel Messi',
'inputs/ibra': 'Zlatan Ibrahimovic',
'inputs/float': 'Float',
'inputs/integer': 'Integer',
'inputs/radio': 'Radio',
'inputs/select': 'Select',
'inputs/slider': 'Slider',
'inputs/text': 'Text',
'inputs/autocomplete': 'Autocomplete',
'inputs/boolean': 'Boolean',
'inputs/checkbox': 'Checkbox',
'inputs/switch': 'Switch',
};

export default demo_inputs_en;
25 changes: 25 additions & 0 deletions demo/src/components/translation/demo-inputs-fr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2022, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

const demo_inputs_fr = {
'inputs/kiki': 'Kylian Mbappe',
'inputs/ney': 'Neymar',
'inputs/lapulga': 'Lionel Messi',
'inputs/ibra': 'Zlatan Ibrahimovic',
'inputs/float': 'Float',
'inputs/integer': 'Integer',
'inputs/radio': 'Radio',
'inputs/select': 'Select',
'inputs/slider': 'Slider',
'inputs/text': 'Text',
'inputs/autocomplete': 'Autocomplete',
'inputs/boolean': 'Boolean',
'inputs/checkbox': 'Checkbox',
'inputs/switch': 'Switch',
};

export default demo_inputs_fr;
2 changes: 1 addition & 1 deletion src/components/dialogs/description-modification-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const DescriptionModificationDialog: FunctionComponent<
<Box paddingTop={1}>
<ExpandingTextField
name={FieldConstants.DESCRIPTION}
label={'descriptionProperty'}
label={'inputs/descriptionProperty'}
minRows={3}
rows={5}
></ExpandingTextField>
Expand Down
4 changes: 2 additions & 2 deletions src/components/filter/filter-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export const FilterForm: FunctionComponent<FilterFormProps> = (props) => {
{props.creation && (
<>
<Grid item xs={12}>
<ExpandableGroup renderHeader={'Description'}>
<ExpandableGroup renderHeader={'inputs/description'}>
<ExpandingTextField
name={FieldConstants.DESCRIPTION}
label={'descriptionProperty'}
label={'inputs/descriptionProperty'}
minRows={3}
rows={5}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const FieldLabel = ({
return (
<>
<FormattedMessage id={label} values={values} />
{optional && <FormattedMessage id="Optional" />}
{optional && <FormattedMessage id="inputs/optional" />}
</>
);
};
Expand Down
17 changes: 2 additions & 15 deletions src/components/translations/inputs-en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,9 @@
*/

const inputs_en = {
'inputs/kiki': 'Kylian Mbappe',
'inputs/ney': 'Neymar',
'inputs/lapulga': 'Lionel Messi',
'inputs/ibra': 'Zlatan Ibrahimovic',
'inputs/float': 'Float',
'inputs/integer': 'Integer',
'inputs/radio': 'Radio',
'inputs/select': 'Select',
'inputs/slider': 'Slider',
'inputs/text': 'Text',
'inputs/description': 'Description',
'inputs/autocomplete': 'Autocomplete',
'inputs/boolean': 'Boolean',
'inputs/checkbox': 'Checkbox',
'inputs/switch': 'Switch',
Optional: 'Optional',
'inputs/descriptionProperty': 'Description (optional)',
'inputs/optional': 'Optional',
};

export default inputs_en;
17 changes: 2 additions & 15 deletions src/components/translations/inputs-fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,9 @@
*/

const inputs_fr = {
'inputs/kiki': 'Kylian Mbappe',
'inputs/ney': 'Neymar',
'inputs/lapulga': 'Lionel Messi',
'inputs/ibra': 'Zlatan Ibrahimovic',
'inputs/float': 'Float',
'inputs/integer': 'Integer',
'inputs/radio': 'Radio',
'inputs/select': 'Select',
'inputs/slider': 'Slider',
'inputs/text': 'Text',
'inputs/description': 'Description',
'inputs/autocomplete': 'Autocomplete',
'inputs/boolean': 'Boolean',
'inputs/checkbox': 'Checkbox',
'inputs/switch': 'Switch',
Optional: 'Optional',
'inputs/descriptionProperty': 'Description (optionnel)',
'inputs/optional': 'Optional',
};

export default inputs_fr;
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ export { default as common_button_en } from './components/translations/common-bu
export { default as common_button_fr } from './components/translations/common-button-fr';
export { default as directory_items_input_en } from './components/translations/directory-items-input-en';
export { default as directory_items_input_fr } from './components/translations/directory-items-input-fr';
export { default as inputs_en } from './components/translations/inputs-en';
export { default as inputs_fr } from './components/translations/inputs-fr';

export {
TagRenderer,
Expand Down
Loading