Skip to content

Commit 04f7187

Browse files
authored
Merge pull request #536 from chosww/message-french-translation
add: new messages file with French translations
2 parents 3c92298 + 72b37a5 commit 04f7187

31 files changed

+1148
-505
lines changed

docs/adding-new-world-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
`'All worlds should be displayed as options and only one is checked'`
2424
test in `WorldSelector.test.js` for the new world
2525
- Add entries to `messages.json`
26-
- `<WorldName>.name`: the name of the world
26+
- `UI.<WorldName>.name`: the name of the world
2727
- `<WorldName>.character`: the name of the character
2828
- `<WorldName>.label`: the label used for the world in the
2929
Scene Background dialog

src/ActionPanel.js

Lines changed: 85 additions & 58 deletions
Large diffs are not rendered by default.

src/ActionPanel.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function createMountActionPanel(props) {
2424
{},
2525
{
2626
focusedOptionName: null,
27-
selectedCommandName: 'right45',
27+
selectedActionName: 'right45',
2828
programSequence: new ProgramSequence(
2929
[
3030
{block: 'forward1'},
@@ -101,10 +101,10 @@ describe('ActionPanel options', () => {
101101
test('Given that there is no selected action, then the Replace button should be disabled', () => {
102102
const { wrapper } = createMountActionPanel({
103103
pressedStepIndex: 1,
104-
selectedCommandName: null
104+
selectedActionName: null
105105
});
106106
const replaceButton = getActionPanelOptionButtons(wrapper, 'replaceCurrentStep');
107-
const expectedAriaLabel = 'Replace Step 2 turn left 45 degrees ';
107+
const expectedAriaLabel = 'Replace Step 2 turn left 45 degrees';
108108
expect(replaceButton.get(0).props['aria-label']).toBe(expectedAriaLabel);
109109
expect(replaceButton.get(0).props['disabled']).toBe(true);
110110
});
@@ -127,7 +127,7 @@ describe('ActionPanel options', () => {
127127
pressedStepIndex: 0
128128
});
129129
const moveToPreviousStepButton = getActionPanelOptionButtons(wrapper, 'moveToPreviousStep');
130-
const expectedAriaLabel = 'Move Step 1 forward 1 square ';
130+
const expectedAriaLabel = 'Move Step 1 forward 1 square';
131131
expect(moveToPreviousStepButton.get(0).props['aria-label']).toBe(expectedAriaLabel);
132132
expect(moveToPreviousStepButton.get(0).props['disabled']).toBe(true);
133133
moveToPreviousStepButton.simulate('click');
@@ -150,7 +150,7 @@ describe('ActionPanel options', () => {
150150
pressedStepIndex: 0
151151
});
152152
const moveToPreviousStepButton = getActionPanelOptionButtons(wrapper, 'moveToPreviousStep');
153-
const expectedAriaLabel = "Move Step 1 loop A ";
153+
const expectedAriaLabel = "Move Step 1 loop A";
154154
expect(moveToPreviousStepButton.get(0).props['disabled']).toBe(true);
155155
moveToPreviousStepButton.simulate('click');
156156
expect(moveToPreviousStepButton.get(0).props['aria-label']).toBe(expectedAriaLabel);
@@ -173,7 +173,7 @@ describe('ActionPanel options', () => {
173173
pressedStepIndex: 2
174174
});
175175
const moveToPreviousStepButton = getActionPanelOptionButtons(wrapper, 'moveToPreviousStep');
176-
const expectedAriaLabel = "Move Step 3 loop A ";
176+
const expectedAriaLabel = "Move Step 3 loop A";
177177
expect(moveToPreviousStepButton.get(0).props['disabled']).toBe(true);
178178
moveToPreviousStepButton.simulate('click');
179179
expect(moveToPreviousStepButton.get(0).props['aria-label']).toBe(expectedAriaLabel);
@@ -328,7 +328,7 @@ describe('ActionPanel options', () => {
328328
pressedStepIndex: 2
329329
});
330330
const moveToNextStepButton = getActionPanelOptionButtons(wrapper, 'moveToNextStep');
331-
const expectedAriaLabel = 'Move Step 3 turn right 45 degrees ';
331+
const expectedAriaLabel = 'Move Step 3 turn right 45 degrees';
332332
expect(moveToNextStepButton.get(0).props['aria-label']).toBe(expectedAriaLabel);
333333
expect(moveToNextStepButton.get(0).props['disabled']).toBe(true);
334334
moveToNextStepButton.simulate('click');
@@ -351,7 +351,7 @@ describe('ActionPanel options', () => {
351351
pressedStepIndex: 0
352352
});
353353
const moveToNextStepButton = getActionPanelOptionButtons(wrapper, 'moveToNextStep');
354-
const expectedAriaLabel = "Move Step 1 loop A ";
354+
const expectedAriaLabel = "Move Step 1 loop A";
355355
expect(moveToNextStepButton.get(0).props['disabled']).toBe(true);
356356
moveToNextStepButton.simulate('click');
357357
expect(moveToNextStepButton.get(0).props['aria-label']).toBe(expectedAriaLabel);
@@ -374,7 +374,7 @@ describe('ActionPanel options', () => {
374374
pressedStepIndex: 2
375375
});
376376
const moveToNextStepButton = getActionPanelOptionButtons(wrapper, 'moveToNextStep');
377-
const expectedAriaLabel = "Move Step 3 loop A ";
377+
const expectedAriaLabel = "Move Step 3 loop A";
378378
expect(moveToNextStepButton.get(0).props['disabled']).toBe(true);
379379
moveToNextStepButton.simulate('click');
380380
expect(moveToNextStepButton.get(0).props['aria-label']).toBe(expectedAriaLabel);

src/ActionsMenuItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export class ActionsMenuItem extends React.Component< ActionsMenuItemProps, {} >
3434

3535
render () {
3636
// We don't use FormattedMessage as we are working with a complex chain of templates.
37-
let commandName = this.props.intl.formatMessage({ id: `ActionsMenuItem.command.${this.props.itemKey}` });
38-
const usedLabel = this.props.intl.formatMessage({ id: 'ActionsMenuItem.usedItemToggleLabel' });
37+
let commandName = this.props.intl.formatMessage({ id: `UI.ActionsMenuItem.command.${this.props.itemKey}` });
38+
const usedLabel = this.props.intl.formatMessage({ id: 'UI.ActionsMenuItem.usedItemToggleLabel' });
3939
if (this.props.isUsed) {
4040
commandName += " " + usedLabel;
4141
}

src/ActionsSimplificationModal.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ class ActionsSimplificationModal extends React.Component<ActionsSimplificationMo
5454

5555
render() {
5656
const cancelButtonProperties = {
57-
label: this.props.intl.formatMessage({ id: 'ActionsSimplificationModal.cancel'} ),
57+
label: this.props.intl.formatMessage({ id: 'UI.Cancel'} ),
5858
isPrimary: false,
5959
onClick: this.handleOnCancel
6060
};
6161
const saveButtonProperties = {
6262
id: 'ActionSimplificationModal-done',
6363
isPrimary: true,
64-
label: this.props.intl.formatMessage({ id: 'ActionsSimplificationModal.save'} ),
64+
label: this.props.intl.formatMessage({ id: 'UI.Save'} ),
6565
onClick: this.saveChanges
6666
};
6767
return (
@@ -75,14 +75,14 @@ class ActionsSimplificationModal extends React.Component<ActionsSimplificationMo
7575
>
7676
<ModalHeader
7777
id='ActionsSimplificationModal__header'
78-
title={this.props.intl.formatMessage({ id: 'ActionsSimplificationModal.title'})}
78+
title={this.props.intl.formatMessage({ id: 'UI.ActionsSimplificationModal.title'})}
7979
>
8080
<SimplificationIcon aria-hidden='true'/>
8181
</ModalHeader>
8282

8383
<ModalBody>
8484
<h3 className='ActionsSimplificationModal__section-heading'>
85-
<FormattedMessage id="CommandPalette.movementsTitle"/>
85+
<FormattedMessage id="UI.CommandPalette.movementsTitle"/>
8686
</h3>
8787

8888
<div className='ActionsSimplificationModal__section'>
@@ -91,7 +91,7 @@ class ActionsSimplificationModal extends React.Component<ActionsSimplificationMo
9191

9292

9393
<h3 className='ActionsSimplificationModal__section-heading'>
94-
<FormattedMessage id="CommandPalette.controlsTitle"/>
94+
<FormattedMessage id="UI.CommandPalette.controlsTitle"/>
9595
</h3>
9696

9797
<div className='ActionsSimplificationModal__section'>

src/AnnouncementBuilder.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,43 @@ export default class AnnouncementBuilder {
1616
}
1717

1818
buildSelectActionAnnouncement(action: string): AnnouncementData {
19-
let commandType = null;
19+
let actionType = null;
2020
if (action === 'loop') {
21-
commandType = this.intl.formatMessage({
21+
actionType = this.intl.formatMessage({
2222
id: 'Announcement.control'
2323
});
2424
} else {
25-
commandType = this.intl.formatMessage({
25+
actionType = this.intl.formatMessage({
2626
id: 'Announcement.movement'
2727
});
2828
}
2929
return {
3030
messageIdSuffix: 'actionSelected',
3131
values: {
32-
commandType: commandType,
33-
command: this.intl.formatMessage({
32+
actionType,
33+
actionName: this.intl.formatMessage({
3434
id: `Announcement.${action}`
3535
}),
3636
}
3737
};
3838
}
3939

4040
buildAddStepAnnouncement(action: string): AnnouncementData {
41-
let commandType = null;
41+
let actionType = null;
4242
if (action === 'loop') {
43-
commandType = this.intl.formatMessage({
43+
actionType = this.intl.formatMessage({
4444
id: 'Announcement.control'
4545
});
4646
} else {
47-
commandType = this.intl.formatMessage({
47+
actionType = this.intl.formatMessage({
4848
id: 'Announcement.movement'
4949
});
5050
}
5151
return {
5252
messageIdSuffix: 'add',
5353
values: {
54-
commandType: commandType,
55-
command: this.intl.formatMessage({
54+
actionType,
55+
actionName: this.intl.formatMessage({
5656
id: `Announcement.${action}`
5757
}),
5858
}
@@ -64,10 +64,10 @@ export default class AnnouncementBuilder {
6464
return {
6565
messageIdSuffix: 'delete',
6666
values: {
67-
commandType: this.intl.formatMessage({
67+
actionType: this.intl.formatMessage({
6868
id: "Announcement.control"
6969
}),
70-
command: this.intl.formatMessage(
70+
actionName: this.intl.formatMessage(
7171
{
7272
id: `Announcement.${programBlock.block}`
7373
},
@@ -81,10 +81,10 @@ export default class AnnouncementBuilder {
8181
return {
8282
messageIdSuffix: 'delete',
8383
values: {
84-
commandType: this.intl.formatMessage({
84+
actionType: this.intl.formatMessage({
8585
id: "Announcement.movement"
8686
}),
87-
command: this.intl.formatMessage(
87+
actionName: this.intl.formatMessage(
8888
{
8989
id: `Announcement.${programBlock.block}`
9090
}
@@ -100,10 +100,10 @@ export default class AnnouncementBuilder {
100100
return {
101101
messageIdSuffix: 'replace',
102102
values: {
103-
oldCommand: this.intl.formatMessage({
103+
oldActionName: this.intl.formatMessage({
104104
id: `Announcement.${programBlock.block}`
105105
}),
106-
newCommand: this.intl.formatMessage({
106+
newActionName: this.intl.formatMessage({
107107
id: `Announcement.${selectedAction}`
108108
})
109109
}

src/AnnouncementBuilder.test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ test('Test buildSelectActionAnnouncement()', () => {
2222
expect(announcementBuilder.buildSelectActionAnnouncement('loop')).toStrictEqual({
2323
messageIdSuffix: 'actionSelected',
2424
values: {
25-
commandType: 'control',
26-
command: 'loop'
25+
actionType: 'control',
26+
actionName: 'loop'
2727
}
2828
});
2929

3030
expect(announcementBuilder.buildSelectActionAnnouncement('forward1')).toStrictEqual({
3131
messageIdSuffix: 'actionSelected',
3232
values: {
33-
commandType: 'movement',
34-
command: 'forward 1 square'
33+
actionType: 'movement',
34+
actionName: 'forward 1 square'
3535
}
3636
});
3737
});
@@ -44,16 +44,16 @@ test('Test buildAddStepAnnouncement()', () => {
4444
expect(announcementBuilder.buildAddStepAnnouncement('loop')).toStrictEqual({
4545
messageIdSuffix: 'add',
4646
values: {
47-
commandType: 'control',
48-
command: 'loop'
47+
actionType: 'control',
48+
actionName: 'loop'
4949
}
5050
});
5151

5252
expect(announcementBuilder.buildAddStepAnnouncement('forward1')).toStrictEqual({
5353
messageIdSuffix: 'add',
5454
values: {
55-
commandType: 'movement',
56-
command: 'forward 1 square'
55+
actionType: 'movement',
56+
actionName: 'forward 1 square'
5757
}
5858
});
5959
});
@@ -71,8 +71,8 @@ describe('Test buildDeleteStepAnnouncement()', () => {
7171
expect(announcementBuilder.buildDeleteStepAnnouncement(startLoopBlock)).toStrictEqual({
7272
messageIdSuffix: 'delete',
7373
values: {
74-
commandType: 'control',
75-
command: 'loop A'
74+
actionType: 'control',
75+
actionName: 'loop A'
7676
}
7777
});
7878
});
@@ -88,8 +88,8 @@ describe('Test buildDeleteStepAnnouncement()', () => {
8888
expect(announcementBuilder.buildDeleteStepAnnouncement(endLoopBlock)).toStrictEqual({
8989
messageIdSuffix: 'delete',
9090
values: {
91-
commandType: 'control',
92-
command: 'loop A'
91+
actionType: 'control',
92+
actionName: 'loop A'
9393
}
9494
});
9595
});
@@ -104,8 +104,8 @@ describe('Test buildDeleteStepAnnouncement()', () => {
104104
expect(announcementBuilder.buildDeleteStepAnnouncement(forwardBlock)).toStrictEqual({
105105
messageIdSuffix: 'delete',
106106
values: {
107-
commandType: 'movement',
108-
command: 'forward 1 square'
107+
actionType: 'movement',
108+
actionName: 'forward 1 square'
109109
}
110110
});
111111
});
@@ -123,8 +123,8 @@ test('Test buildReplaceStepAnnouncement()', () => {
123123
expect(announcementBuilder.buildReplaceStepAnnouncement(forwardBlock, 'right45')).toStrictEqual({
124124
messageIdSuffix: 'replace',
125125
values: {
126-
oldCommand: 'forward 1 square',
127-
newCommand: 'turn right 45 degrees'
126+
oldActionName: 'forward 1 square',
127+
newActionName: 'turn right 45 degrees'
128128
}
129129
});
130130
});

src/App.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ export class App extends React.Component<AppProps, AppState> {
266266
});
267267
}
268268

269-
getSelectedCommandName() {
269+
getSelectedActionName() {
270270
if (this.state.selectedAction !== null) {
271271
return this.state.selectedAction;
272272
} else {
@@ -960,7 +960,7 @@ export class App extends React.Component<AppProps, AppState> {
960960
<CommandPaletteCommand
961961
key={`CommandBlock-${index}`}
962962
commandName={value}
963-
selectedCommandName={this.getSelectedCommandName()}
963+
selectedActionName={this.getSelectedActionName()}
964964
audioManager={this.audioManager}
965965
isDraggingCommand={this.state.isDraggingCommand}
966966
onSelect={this.handleCommandFromCommandPalette}
@@ -1268,13 +1268,13 @@ export class App extends React.Component<AppProps, AppState> {
12681268
className="App__PrivacyModal__toggle-button"
12691269
onClick={this.handleClickPrivacyButton}
12701270
>
1271-
<FormattedMessage id='App.privacyModalToggle'/>
1271+
<FormattedMessage id='UI.App.privacyModalToggle'/>
12721272
</button>
12731273
</div>
12741274
<div className='App__header-menu'>
12751275
<IconButton
12761276
className="App__header-soundOptions"
1277-
ariaLabel={this.props.intl.formatMessage({ id: 'SoundOptionsModal.title' })}
1277+
ariaLabel={this.props.intl.formatMessage({ id: 'UI.SoundOptionsModal.title' })}
12781278
onClick={this.handleClickSoundIcon}
12791279
>
12801280
<AudioIcon
@@ -1423,14 +1423,14 @@ export class App extends React.Component<AppProps, AppState> {
14231423
<React.Fragment>
14241424
<div className='App__ActionsMenu__header'>
14251425
<h2 className='App__ActionsMenu__header-heading'>
1426-
<FormattedMessage id='ActionsMenu.title' />
1426+
<FormattedMessage id='UI.ActionsMenu.title' />
14271427
</h2>
14281428
</div>
14291429
<div className='App__command-palette-command-container'>
14301430
<div className='App__command-palette-section'>
14311431
<div className='App__command-palette-section-heading-container'>
14321432
<h3 className='App__command-palette-section-heading'>
1433-
<FormattedMessage id='CommandPalette.movementsTitle'/>
1433+
<FormattedMessage id='UI.CommandPalette.movementsTitle'/>
14341434
</h3>
14351435
</div>
14361436
<div className='App__command-palette-section-body'>
@@ -1455,7 +1455,7 @@ export class App extends React.Component<AppProps, AppState> {
14551455
<div className='App__command-palette-section'>
14561456
<div className='App__command-palette-section-heading-container'>
14571457
<h3 className='App__command-palette-section-heading'>
1458-
<FormattedMessage id='CommandPalette.controlsTitle'/>
1458+
<FormattedMessage id='UI.CommandPalette.controlsTitle'/>
14591459
</h3>
14601460
</div>
14611461

@@ -1548,7 +1548,7 @@ export class App extends React.Component<AppProps, AppState> {
15481548
aria-hidden={true}
15491549
/>
15501550
<div className='App__ShareButton__label'>
1551-
{this.props.intl.formatMessage({id:'ShareButton'})}
1551+
{this.props.intl.formatMessage({id:'UI.ShareButton'})}
15521552
</div>
15531553
</button>
15541554
</div>

0 commit comments

Comments
 (0)