Skip to content

Commit 42ae1bf

Browse files
committed
feat: new extension define
1 parent ffdec69 commit 42ae1bf

File tree

6 files changed

+60
-29
lines changed

6 files changed

+60
-29
lines changed

src/lib/libraries/extensions/index.jsx

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ import smalrubotS1InsetIconURL from './smalrubot-s1/smalrubot-s1-small.png';
5656
import smalrubotS1ConnectionIconURL from './smalrubot-s1/smalrubot-s1-illustration.png';
5757
import smalrubotS1ConnectionSmallIconURL from './smalrubot-s1/smalrubot-s1-small.png';
5858

59-
import koshienIconURL from './koshien/koshien.png';
60-
import koshienInsetIconURL from './koshien/koshien-small.png';
61-
6259
const extensions = [
6360
{
6461
name: (
@@ -399,31 +396,14 @@ const extensions = [
399396
/>
400397
),
401398
helpLink: 'https://github.com/smalruby/smalruby3-gui/wiki/SmalrubotS1'
402-
},
403-
{
404-
name: (
405-
<FormattedMessage
406-
defaultMessage="Smalruby Koshien"
407-
description="Name for the 'koshien' extension"
408-
id="gui.smalruby3.extension.koshien.name"
409-
/>
410-
),
411-
extensionId: 'koshien',
412-
iconURL: koshienIconURL,
413-
insetIconURL: koshienInsetIconURL,
414-
description: (
415-
<FormattedMessage
416-
defaultMessage="Smalruby Koshien AI."
417-
description="Description for the 'koshien' extension"
418-
id="gui.smalruby3.extension.koshien.description"
419-
/>
420-
),
421-
featured: true
422399
}
423400
];
424401

425402
// Injected for extra extensions
426403
import microbitMore from './microbitMore/index.jsx';
427404
extensions.push(microbitMore);
428405

406+
import koshien from './koshien/index.jsx';
407+
extensions.push(koshien);
408+
429409
export default extensions;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
let formatMessage = messageData => messageData.defaultMessage;
2+
3+
/**
4+
* Koshien extension
5+
*/
6+
7+
import koshienIconURL from './koshien.png';
8+
import koshienInsetIconURL from './koshien-small.png';
9+
import translations from './translations.json';
10+
11+
const entry = {
12+
get name () {
13+
return formatMessage({
14+
defaultMessage: 'Smalruby Koshien',
15+
description: "Name for the 'koshien' extension",
16+
id: 'koshien.entry.name'
17+
});
18+
},
19+
extensionId: 'koshien',
20+
iconURL: koshienIconURL,
21+
insetIconURL: koshienInsetIconURL,
22+
get description () {
23+
return formatMessage({
24+
defaultMessage: 'Smalruby Koshien AI.',
25+
description: "Description for the 'koshien' extension",
26+
id: 'koshien.entry.description'
27+
});
28+
},
29+
featured: true,
30+
disabled: false,
31+
bluetoothRequired: false,
32+
internetConnectionRequired: false,
33+
launchPeripheralConnectionFlow: false,
34+
useAutoScan: false,
35+
helpLink: 'https://smalruby-koshien.netlab.jp/',
36+
setFormatMessage: formatter => {
37+
formatMessage = formatter;
38+
},
39+
translationMap: translations
40+
};
41+
42+
export {entry}; // loadable-extension needs this line.
43+
export default entry;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"en": {
3+
"koshien.entry.name": "Smalruby Koshien",
4+
"koshien.entry.description": "Smalruby Koshien AI."
5+
},
6+
"ja": {
7+
"koshien.entry.name": "スモウルビー甲子園",
8+
"koshien.entry.description": "スモウルビー甲子園のAIを作成する。"
9+
},
10+
"ja-Hira": {
11+
"koshien.entry.name": "スモウルビー こうしえん",
12+
"koshien.entry.description": "スモウルビー こうしえんのエー・アイをさくせいする。"
13+
}
14+
}

src/locales/en.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ export default {
2222
"gui.smalruby3.telemetryOptIn.buttonTextYes": "Yes, I'd like to help improve Smalruby",
2323
'gui.smalruby3.extension.mesh.name': 'Mesh',
2424
'gui.smalruby3.extension.mesh.description': 'Allowing users to interact over a computer network.',
25-
'gui.smalruby3.extension.koshien.name': 'Smalruby Koshien',
26-
'gui.smalruby3.extension.koshien.description': 'Smalruby Koshien AI.',
2725
'mesh.categoryName': 'Mesh',
2826
'mesh.sensorValue': '[NAME] sensor value',
2927
'mesh.hostPeripheralName': 'Mesh Host [{ MESH_ID }]',

src/locales/ja-Hira.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export default {
2424
'gui.smalruby3.rubyToBlocksConverter.wrongInstruction': '「{ SOURCE }」はめいれいがまちがっています。',
2525
'gui.smalruby3.extension.mesh.name': 'メッシュ',
2626
'gui.smalruby3.extension.mesh.description': 'ネットワークじょうでユーザーかんのやりとりをおこなう。',
27-
'gui.smalruby3.extension.koshien.name': 'スモウルビー こうしえん',
28-
'gui.smalruby3.extension.koshien.description': 'スモウルビー こうしえんのエー・アイを作成する。',
2927
'mesh.categoryName': 'メッシュ',
3028
'mesh.sensorValue': '[NAME] センサーのあたい',
3129
'mesh.hostPeripheralName': 'メッシュのホストになる 【{ MESH_ID }】',

src/locales/ja.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export default {
2424
'gui.smalruby3.telemetryOptIn.buttonTextYes': 'はい、スモウルビーの改善に協力します。',
2525
'gui.smalruby3.extension.mesh.name': 'メッシュ',
2626
'gui.smalruby3.extension.mesh.description': 'ネットワーク上でユーザー間のやりとりを行う。',
27-
'gui.smalruby3.extension.koshien.name': 'スモウルビー甲子園',
28-
'gui.smalruby3.extension.koshien.description': 'スモウルビー甲子園のAIを作成する。',
2927
'mesh.categoryName': 'メッシュ',
3028
'mesh.sensorValue': '[NAME] センサーの値',
3129
'mesh.hostPeripheralName': 'メッシュのホストになる 【{ MESH_ID }】',

0 commit comments

Comments
 (0)