Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into redirect-to-prototype
  • Loading branch information
microbit-grace committed Feb 29, 2024
2 parents 21d30c5 + 0aa4729 commit 209046f
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 274 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
steps:
- uses: microbit-foundation/action-pr-url-template@v0.1.2
with:
uri-template: 'https://review-ml.microbit.org/{branch}/thenextgen/'
uri-template: 'https://review-ml.microbit.org/{branch}'
repo-token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions deployment.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const { s3Config } = createDeploymentDetailsFromOptions({
module.exports = {
deploymentDir: './dist',
...s3Config,
// We deploy to a fixed path for the nextgen version
bucketPrefix: posixPath.join(s3Config.bucketPrefix || '', 'thenextgen'),
// For non-review versions deploy to the prototype URL
bucketPrefix: s3Config.bucketPrefix ?? 'v/prototype',
region: 'eu-west-1',
removeNonexistentObjects: true,
enableS3StaticWebsiteHosting: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ml-machine",
"version": "1.0.0",
"version": "0.6.0-local",
"author": "Center for Computational Thinking and Design at Aarhus University",
"private": true,
"type": "module",
Expand Down
6 changes: 4 additions & 2 deletions src/__tests__/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ describe('Initialization tests', () => {
vitest.resetModules();
});

test('Language is set to welsh when it is the preferred browser option', async () => {
// Welsh disabled for now
test.skip('Language is set to welsh when it is the preferred browser option', async () => {
windowSpy.mockImplementation(() => ({
navigator: {
languages: ['cy', 'en'],
Expand Down Expand Up @@ -57,7 +58,8 @@ describe('Initialization tests', () => {
expect(translatedText).toBe('You are currently recording!');
});

test('Language is set to welsh when it is defined query string', async () => {
// Welsh disabled for now
test.skip('Language is set to welsh when it is defined query string', async () => {
windowSpy.mockImplementation(() => ({
navigator: {
languages: ['some languages'],
Expand Down
3 changes: 2 additions & 1 deletion src/__tests__/translations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
*
* SPDX-License-Identifier: MIT
*/
import da from './../messages/ui.da.json';
import en from './../messages/ui.en.json';
// TODO: actually import the right one!
const da = en;

// We're moving translations to Crowdin so expect the English to be the only
// updated language for now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
openLink('https://microbit.org/terms-of-use/');
};
const onPrivacyPolicyClick = () => {
openLink('https://microbit.org/privacy/#the-playground-survey');
openLink('https://microbit.org/privacy/');
};
const onHelpAndSupportClick = () => {
openLink('https://support.microbit.org/support/home');
Expand Down
8 changes: 3 additions & 5 deletions src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,20 @@ export const allLanguages = [
name: 'English',
enName: 'English',
},
// There are no Welsh translations yet but enabled to demo the language feature
{
// Welsh translations disabled on this branch. Danish has never worked in this fork.
/*{
id: 'cy',
name: 'Cymraeg',
enName: 'Welsh',
},
// Disabled for now as this fork doesn't have full Danish translations
/*{
{
id: 'da',
name: 'Dansk',
enName: 'Danish',
},*/
];

register('en', () => import('./messages/ui.en.json'));
register('cy', () => import('./messages/ui.cy.json'));

const initialLocale =
getLocaleFromQueryString('l') ||
Expand Down
237 changes: 0 additions & 237 deletions src/messages/ui.cy.json

This file was deleted.

1 change: 0 additions & 1 deletion src/messages/ui.da.json

This file was deleted.

1 change: 0 additions & 1 deletion src/messages/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"alert.recordingsPerGesture": "You need at least three examples per action",

"content.index.title": "machine learning tool",
"content.index.toolInfo": "Use this tool with the <link>BBC micro:bit playground survey</link>",
"content.index.toolProcessCards.main.title": "How this tool works",
"content.index.toolProcessCards.data.title": "Add data",
"content.index.toolProcessCards.data.description": "Add samples of the actions you would like your model to recognise (e.g. waving and clapping).",
Expand Down
21 changes: 0 additions & 21 deletions src/pages/Homepage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
import { locale as currentLocale } from 'svelte-i18n';
import { get } from 'svelte/store';
const playgroundSurveyUrlByLang: Record<string, string> = {
en: 'https://microbit.org/teach/playground-survey/exploring-machine-learning/',
cy: 'https://microbit.org/cy/teach/playground-survey/exploring-machine-learning/',
};
$: hasExistingSession = $gestures.some(g => g.name || g.recordings.length);
let showDataLossWarning = false;
Expand Down Expand Up @@ -71,9 +66,6 @@
};
$: title = getTitle(Paths.HOME, $t);
$: playgroundSurveyUrl =
($currentLocale ? playgroundSurveyUrlByLang[$currentLocale] : undefined) ??
playgroundSurveyUrlByLang.en;
</script>

<svelte:head>
Expand All @@ -94,19 +86,6 @@
frameBorder="0"
allowFullScreen>
</iframe>
<p>
<HtmlFormattedMessage
id="content.index.toolInfo"
options={{
values: {
link: linkWithProps({
href: playgroundSurveyUrl,
target: '_blank',
rel: 'noopener',
}),
},
}} />
</p>
</div>

<div class="flex flex-col flex-wrap items-center max-w-325">
Expand Down
7 changes: 6 additions & 1 deletion src/script/stores/uiStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import MBSpecs from '../microbit-interfacing/MBSpecs';
import { gestures } from './Stores';
import { HexOrigin } from '../../StaticConfiguration';
import { DeviceRequestStates } from '../microbit-interfacing/MicrobitConnection';
import { logError } from '../utils/logging';
import { persistantWritable } from './storeUtil';
import { logError, logEvent } from '../utils/logging';

// TODO: Rename? Split up further?

Expand All @@ -29,6 +29,11 @@ if (compatibilityResult.bluetooth) {
.getAvailability()
.then(bluetoothAvailable => {
compatibility.update(s => {
logEvent({
type: 'Device',
action: 'Bluetooth available',
value: s.bluetooth && bluetoothAvailable ? 1 : 0,
});
s.bluetooth = s.bluetooth && bluetoothAvailable;
return s;
});
Expand Down

0 comments on commit 209046f

Please sign in to comment.