Skip to content

Commit c38187e

Browse files
committed
Better translation and UI interaction
Moved media file upload from Editor / Blockly to file library. Improved existing translation and fixed smaller issues.
1 parent abb29da commit c38187e

File tree

33 files changed

+369
-495
lines changed

33 files changed

+369
-495
lines changed

locales/deu/blocks/blocks.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @fileoverview Translation file for Blocks (german).
3+
*
4+
* @license Copyright 2018 The Coding with Chrome Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* @author [email protected] (Markus Bordihn)
19+
*/
20+
window['Locales'] = window['Locales'] || {};
21+
Locales['deu'] = Locales['deu'] || {};
22+
23+
24+
/**
25+
* @final
26+
* @export
27+
*/
28+
/* eslint-disable max-len */
29+
Object.assign(Locales['deu'], {
30+
'BLOCKS_DO': 'mache',
31+
'BLOCKS_DEFINE': 'definiere',
32+
});

locales/deu/blocks/phaser_blocks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ Locales['deu'] = Locales['deu'] || {};
2727
*/
2828
/* eslint-disable max-len */
2929
Object.assign(Locales['deu'], {
30+
'BLOCKS_PHASER_CREATE': 'Erstellen',
31+
'BLOCKS_PHASER_GAME': 'Spiel',
32+
'BLOCKS_PHASER_ON_CREATE': 'beim Erstellen',
3033
'BLOCKS_PHASER_OPEN_FILE_LIBRARY': 'Öffne Datei Bibliothek',
3134
});

locales/eng/blocks/blocks.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @fileoverview Translation file for blocks (english).
3+
*
4+
* @license Copyright 2018 The Coding with Chrome Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* @author [email protected] (Markus Bordihn)
19+
*/
20+
window['Locales'] = window['Locales'] || {};
21+
Locales['eng'] = Locales['eng'] || {};
22+
23+
24+
/**
25+
* @final
26+
* @export
27+
*/
28+
/* eslint-disable max-len */
29+
Object.assign(Locales['eng'], {
30+
'BLOCKS_DO': 'do',
31+
'BLOCKS_DEFINE': 'define',
32+
});

locales/eng/blocks/phaser_blocks.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@ Locales['eng'] = Locales['eng'] || {};
2727
*/
2828
/* eslint-disable max-len */
2929
Object.assign(Locales['eng'], {
30+
'BLOCKS_PHASER_CREATE': 'Create',
31+
'BLOCKS_PHASER_GAME': 'Game',
32+
'BLOCKS_PHASER_ON_CREATE': 'on create',
3033
'BLOCKS_PHASER_OPEN_FILE_LIBRARY': 'Open file library',
3134
});

src/blocks/phaser/arcade_physics/blocks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Blockly.Blocks['phaser_pyhsics_arcade_sprite_add'] = {
2626
init: function() {
2727
this.appendValueInput('variable')
2828
.appendField(Blockly.BlocksTemplate.addCircle())
29-
.appendField(i18t('define'));
29+
.appendField(i18t('BLOCKS_DEFINE'));
3030
this.appendDummyInput()
3131
.appendField(i18t('as physics sprite'))
3232
.appendField(new Blockly.FieldTextInput('player'), 'sprite')
@@ -141,7 +141,7 @@ Blockly.Blocks['phaser_physics_arcade_overlap'] = {
141141
.appendField(i18t('and'));
142142
this.appendValueInput('object2');
143143
this.appendStatementInput('func')
144-
.appendField(i18t('do'));
144+
.appendField(i18t('BLOCKS_DO'));
145145
this.setInputsInline(true);
146146
this.setPreviousStatement(true, 'Update');
147147
this.setNextStatement(true, 'Update');

src/blocks/phaser/audio/blocks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Blockly.Blocks['phaser_audio_add'] = {
2626
init: function() {
2727
this.appendValueInput('variable')
2828
.appendField(Blockly.BlocksTemplate.addCircle())
29-
.appendField(i18t('define'));
29+
.appendField(i18t('BLOCKS_DEFINE'));
3030
this.appendDummyInput()
3131
.appendField(i18t('as audio'))
3232
.appendField(new Blockly.FieldTextInput('audio'), 'audio')
3333
.appendField(Blockly.BlocksTemplate.audio())
3434
.appendField(i18t('with volume'))
3535
.appendField(new Blockly.FieldNumber(100, 0, 200), 'volume')
36-
.appendField(i18t('%'))
36+
.appendField('%')
3737
.appendField(new Blockly.FieldDropdown([
3838
['no loop', false],
3939
['loop', true],

src/blocks/phaser/create/blocks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Blockly.Blocks['phaser_create'] = {
2626
init: function() {
2727
this.appendDummyInput()
2828
.appendField(Blockly.BlocksTemplate.addCircle())
29-
.appendField(i18t('on create'));
29+
.appendField(i18t('BLOCKS_PHASER_ON_CREATE'));
3030
this.appendStatementInput('CODE')
31-
.appendField(i18t('do'))
31+
.appendField(i18t('BLOCKS_DO'))
3232
.setAlign(Blockly.ALIGN_CENTRE)
3333
.setCheck(['Create']);
3434
this.setPreviousStatement(true, 'Create_');
@@ -84,7 +84,7 @@ Blockly.Blocks['phaser_add_group'] = {
8484
init: function() {
8585
this.appendValueInput('variable')
8686
.appendField(Blockly.BlocksTemplate.addCircle())
87-
.appendField(i18t('define'));
87+
.appendField(i18t('BLOCKS_DEFINE'));
8888
this.appendDummyInput()
8989
.appendField(i18t('as group'))
9090
.appendField(new Blockly.FieldTextInput('group_name'), 'name');
@@ -109,7 +109,7 @@ Blockly.Blocks['phaser_time_loop_event'] = {
109109
this.appendDummyInput()
110110
.appendField(i18t('milliseconds'));
111111
this.appendStatementInput('func')
112-
.appendField(i18t('do'));
112+
.appendField(i18t('BLOCKS_DO'));
113113
this.setPreviousStatement(true, 'Create');
114114
this.setNextStatement(true, 'Create');
115115
this.setColour(30);

src/blocks/phaser/input/blocks.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Blockly.Blocks['phaser_input'] = {
2929
.appendField(Blockly.BlocksTemplate.mouse())
3030
.appendField(i18t('on input'));
3131
this.appendStatementInput('CODE')
32-
.appendField(i18t('do'))
32+
.appendField(i18t('BLOCKS_DO'))
3333
.setAlign(Blockly.ALIGN_CENTRE)
3434
.setCheck(['Input']);
3535
this.setPreviousStatement(true, 'Input_');
@@ -48,7 +48,7 @@ Blockly.Blocks['phaser_input_keyboard_cursor_keys_add'] = {
4848
init: function() {
4949
this.appendValueInput('variable')
5050
.appendField(Blockly.BlocksTemplate.addCircle())
51-
.appendField(i18t('define'));
51+
.appendField(i18t('BLOCKS_DEFINE'));
5252
this.appendDummyInput()
5353
.appendField(i18t('as capture keyboard cursors keys'))
5454
.appendField(Blockly.BlocksTemplate.keyboard());
@@ -68,7 +68,7 @@ Blockly.Blocks['phaser_input_keyboard_spacebar_add'] = {
6868
init: function() {
6969
this.appendValueInput('variable')
7070
.appendField(Blockly.BlocksTemplate.addCircle())
71-
.appendField(i18t('define'));
71+
.appendField(i18t('BLOCKS_DEFINE'));
7272
this.appendDummyInput()
7373
.appendField(i18t('as capture keyboard spacebar'))
7474
.appendField(Blockly.BlocksTemplate.keyboard());
@@ -88,7 +88,7 @@ Blockly.Blocks['phaser_input_keyboard_key_add'] = {
8888
init: function() {
8989
this.appendValueInput('variable')
9090
.appendField(Blockly.BlocksTemplate.addCircle())
91-
.appendField(i18t('define'));
91+
.appendField(i18t('BLOCKS_DEFINE'));
9292
this.appendDummyInput()
9393
.appendField(i18t('as capture keyboard key'))
9494
.appendField(new Blockly.FieldDropdown([
@@ -117,7 +117,7 @@ Blockly.Blocks['phaser_input_mouse_keys_add'] = {
117117
init: function() {
118118
this.appendValueInput('variable')
119119
.appendField(Blockly.BlocksTemplate.addCircle())
120-
.appendField(i18t('define'));
120+
.appendField(i18t('BLOCKS_DEFINE'));
121121
this.appendDummyInput()
122122
.appendField(i18t('as capture mouse keys'))
123123
.appendField(Blockly.BlocksTemplate.mouse());

src/blocks/phaser/preload/blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Blockly.Blocks['phaser_preload'] = {
2828
.appendField(Blockly.BlocksTemplate.fileDownload())
2929
.appendField(i18t('on preload'));
3030
this.appendStatementInput('CODE')
31-
.appendField(i18t('do'))
31+
.appendField(i18t('BLOCKS_DO'))
3232
.setAlign(Blockly.ALIGN_CENTRE)
3333
.setCheck(['Preload']);
3434
this.setPreviousStatement(true, 'Preload_');

src/blocks/phaser/render/blocks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Blockly.Blocks['phaser_render'] = {
2828
.appendField(Blockly.BlocksTemplate.point())
2929
.appendField(i18t('on render'));
3030
this.appendStatementInput('CODE')
31-
.appendField(i18t('do'))
31+
.appendField(i18t('BLOCKS_DO'))
3232
.setAlign(Blockly.ALIGN_CENTRE)
3333
.setCheck(['Render']);
3434
this.setPreviousStatement(true, 'Render_');

0 commit comments

Comments
 (0)