Skip to content

Commit 91ca946

Browse files
committed
Added German translation file for robot blocks.
1 parent 27416cb commit 91ca946

File tree

6 files changed

+69
-14
lines changed

6 files changed

+69
-14
lines changed

locales/deu/blocks/blocks.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,33 @@
1919
*/
2020
Locales['deu']['BLOCKS'] = {
2121
'ALL': 'alle',
22+
'AND': 'und',
2223
'AS': 'als',
2324
'CHANGE': 'ändere',
25+
'CLEAR_DISPLAY': 'Anzeige löschen',
2426
'DEFINE': 'definiere',
2527
'DESTROY': 'zerstöre',
28+
'DISABLE': 'deaktivieren',
29+
'DISPLAY_TEXT': 'zeige Text',
2630
'DO': 'mache',
2731
'DOWN': 'runter',
32+
'ENABLE': 'aktivieren',
2833
'GROUP': 'Gruppe',
2934
'HEIGHT': 'Höhe',
35+
'IMMEDIATELY': 'sofort',
3036
'IN': 'in',
3137
'KILL': 'töte',
3238
'LEFT': 'links',
3339
'LISTS': 'Listen',
3440
'PADDING': 'Abstand',
41+
'REPEAT_FOREVER': 'für immer wiederholen',
3542
'RIGHT': 'rechts',
43+
'SEC': 'Sek.',
3644
'SET': 'setze',
3745
'TO': 'auf',
3846
'UP': 'hoch',
47+
'WAIT': 'warte',
48+
'WHEN_FINISHED': 'wenn fertig',
3949
'WIDTH': 'Breite',
50+
'WITH': 'mit',
4051
};

locales/deu/blocks/robot_blocks.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* @fileoverview Translation file for robot 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+
/* eslint-disable max-len */
21+
Locales['deu']['BLOCKS_ROBOT'] = {
22+
'HEADING': 'Richtung',
23+
'ON_COLLISION': 'bei Kollision',
24+
'ON_POSITION_CHANGE': 'bei Positionsänderung',
25+
'RESET_ROBOT': 'Roboter zurücksetzten',
26+
'ROLL_FOR': 'rolle für',
27+
'ROLL_WITH': 'rolle mit',
28+
'ROTATE': 'drehe',
29+
'SET_BACKLIGHT': 'setze Hintergrundbeleuchtung',
30+
'SET_BLINK': 'setze Blinken',
31+
'SET_COLOR': 'setze Farbe',
32+
'SET_HEADING': 'setze Richtung',
33+
'SET_SPEED': 'setze Geschwindigkeit',
34+
'SET_STABILIZATION': 'setzte Stabilisierung',
35+
'SPEED': 'Geschwindigkeit',
36+
'START': 'Programmstart',
37+
'STOP_MOTORS': 'stoppe Motoren',
38+
};

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
"launch:mac": "\"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\" --load-and-launch:app=$PWD/dist/chrome_os --enable-logging --v=1 --no-first-run",
8585
"launch:nw": "nw dist/nw_app",
8686
"launch:web": "http-server dist/web_app",
87-
"launch:win": "echo && \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" --load-and-launch:app=%CD%\\dist\\chrome_os --enable-logging --v=1 --no-first-run",
88-
"launch:win-beta": "echo && \"C:\\Program Files (x86)\\Google\\Chrome Beta\\Application\\chrome.exe\" --load-and-launch:app=%CD%\\dist\\chrome_os --enable-logging --v=1 --no-first-run --enable-experimental-web-platform-features",
89-
"launch:win-experimental": "echo && \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" --load-and-launch:app=%CD%\\dist\\chrome_os --enable-logging --v=1 --no-first-run --enable-experimental-web-platform-features",
87+
"launch:win": "echo && \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" --profile-directory=Default --app-id=becloognjehhioodmnimnehjcibkloed --enable-logging --v=1 --no-first-run",
88+
"launch:win-beta": "echo && \"C:\\Program Files (x86)\\Google\\Chrome Beta\\Application\\chrome.exe\" --profile-directory=Default --app-id=becloognjehhioodmnimnehjcibkloed --enable-logging --v=1 --no-first-run --enable-experimental-web-platform-features",
89+
"launch:win-experimental": "echo && \"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe\" --profile-directory=Default --app-id=becloognjehhioodmnimnehjcibkloed --enable-logging --v=1 --no-first-run --enable-experimental-web-platform-features",
9090
"lint": "npm run lint-javascript && npm run lint-markdown",
9191
"lint-javascript": "eslint .",
9292
"lint-markdown": "markdownlint doc/ training/ *.md src/**/*.md",

src/blocks/sphero/sprk_plus/blocks.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,7 @@ Blockly.Blocks['sphero_sprk_plus_speed'] = {
199199
this.appendValueInput('speed')
200200
.setCheck('Number')
201201
.appendField(Blockly.BlocksTemplate.point())
202-
.appendField(i18t('@@BLOCKS_ROBOT__SET_SPEED'))
203-
.appendField(new Blockly.FieldAngle(0), 'speed');
202+
.appendField(i18t('@@BLOCKS_ROBOT__SET_SPEED'));
204203
this.setPreviousStatement(true);
205204
this.setNextStatement(true);
206205
this.setTooltip(i18t('Sets Sphero speed.'));

src/blocks/sphero/sprk_plus/javascript.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ Blockly.JavaScript['sphero_sprk_plus_roll_step'] = function(block) {
6464
* @return {string}
6565
*/
6666
Blockly.JavaScript['sphero_sprk_plus_roll_time'] = function(block) {
67-
let time = parseInt(Blockly.JavaScript.valueToCode(
68-
block, 'time', Blockly.JavaScript.ORDER_ATOMIC));
69-
let speed = parseInt(Blockly.JavaScript.valueToCode(
70-
block, 'speed', Blockly.JavaScript.ORDER_ATOMIC));
71-
let heading = Blockly.JavaScript.valueToCode(
72-
block, 'heading', Blockly.JavaScript.ORDER_ATOMIC);
67+
let time = Blockly.JavaScript.valueToCode(
68+
block, 'time', Blockly.JavaScript.ORDER_ATOMIC);
69+
let speed = Blockly.JavaScript.valueToCode(
70+
block, 'speed', Blockly.JavaScript.ORDER_ATOMIC);
71+
let heading = parseInt(Blockly.JavaScript.valueToCode(
72+
block, 'heading', Blockly.JavaScript.ORDER_ATOMIC));
7373
return 'sprkPlus.rollTime(' + time + ', ' + speed + ', ' + heading +
7474
', true);\n';
7575
};
@@ -119,10 +119,13 @@ Blockly.JavaScript['sphero_sprk_plus_heading'] = function(block) {
119119

120120
/**
121121
* Sphero speed.
122+
* @param {!Blockly.block} block
122123
* @return {string}
123124
*/
124-
Blockly.JavaScript['sphero_sprk_plus_speed'] = function() {
125-
return '//tbd';
125+
Blockly.JavaScript['sphero_sprk_plus_speed'] = function(block) {
126+
let speed = Blockly.JavaScript.valueToCode(
127+
block, 'speed', Blockly.JavaScript.ORDER_ATOMIC);
128+
return 'sprkPlus.speed(' + speed + ');\n';
126129
};
127130

128131

src/blocks/sphero/sprk_plus/toolbox.soy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@
3737
<block type="general_input_angle"></block>
3838
</value>
3939
</block>
40-
<block type="sphero_sprk_plus_speed"></block>
40+
<block type="sphero_sprk_plus_speed">
41+
<value name="speed">
42+
<block type="math_number"><field name="NUM">40</field></block>
43+
</value>
44+
</block>
4145
<block type="sphero_sprk_plus_stop"></block>
4246
</category>
4347

0 commit comments

Comments
 (0)