Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I18n maker setup list #36787

Merged
merged 14 commits into from
Sep 25, 2020
37 changes: 37 additions & 0 deletions apps/i18n/applab/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,48 @@
"dropletBlock_write_description": "Appends the specified text to the bottom of the document. The text can also be formatted as HTML.",
"dropletBlock_write_param0_description": "The text or HTML you want appended to the bottom of your application",
"finalLevel": "Congratulations! You have solved the final puzzle.",
"foundDevices": "Found devices: ",
"legacy": "Legacy",
"makeMyOwnApp": "Make my own app",
"makerSetupAcceptPrompt": "If a prompt asking for permission for Code Studio to connect to the Chrome App pops up, click Accept.",
"makerSetupAdafruitWindowsDrivers": "If your board is plugged in, you may be missing the **Adafruit Windows Drivers**. Follow the instructions [on this page](https://learn.adafruit.com/adafruit-feather-32u4-basic-proto/using-with-arduino-ide#install-drivers-windows-only) to install the drivers and try again.",
"makerSetupAppInstalled": "Chrome App installed",
"makerSetupBoardBadResponse": "We found a board but it didn't respond properly when we tried to connect to it.",
"makerSetupBrowserTitle": "Code.org Browser",
"makerSetupBrowserSupported": "Using a supported browser",
"makerSetupCheck": "Setup Check",
"makerSetupCheckInternetConnection": "Please make sure you are connected to the internet, and [https://downloads.code.org](https://downloads.code.org/index.html) is reachable from your network.",
"makerSetupChromebookPage": "Open this page ([{makerSetupPage}]({makerSetupPage})) on your Chromebook.",
"makerSetupDownloadAndInstall": "Download and install the Code.org Maker App using the download button above.",
"makerSetupDownloadProblem": "There was a problem getting your download link.",
"makerSetupFetchingVersion": "Getting the latest version...",
"makerSetupFollowInstructions": "Follow the instructions given by the interactive setup checklist.",
"makerSetupInstallSerialConnector": "Please install the [Code.org Serial Connector Chrome App]({webstoreURL}).",
"makerSetupInstallFirmata": "You should make sure it has the right firmware sketch installed. You can [install the Circuit Playground Firmata sketch with these instructions]({firmataURL}).",
"makerSetupLinuxAddDialout": "If you don't belong to 'dialout', you'll want to add yourself to that group:",
"makerSetupLinuxAlternative": "Alternative Installers",
"makerSetupLinuxAlternativeInstall": "[Install from source](https://github.com/code-dot-org/browser)",
"makerSetupLinuxGroupsCheck": "From your terminal, check which groups you belong to:",
"makerSetupLinuxRestart": "You may need to restart your computer for changes to take effect.",
"makerSetupLinuxSerialport": "We didn't have permission to open the serialport. Please make sure you are a member of the 'dialout' group.",
"makerSetupMakerAppForChromebook": "Maker Toolkit for Chromebook",
"makerSetupMakerAppForLinux": "Code.org Maker App for Linux",
"makerSetupMakerAppForMac": "Code.org Maker App for Mac",
"makerSetupMakerAppForWindows": "Code.org Maker App for Windows",
"makerSetupPlugInBoard": "Plug in your board to start using it with App Lab!",
"makerSetupPlugInBoardCheck": "We couldn't detect a Circuit Playground board. Make sure your board is plugged in, and click: ",
"makerSetupRedetect": "Once it is installed, come back to this page and click the \"re-detect\" button, above.",
"makerSetupSerialConnector": "Maker Toolkit on Chromebook does not use the Code.org Maker App. Instead, it depends on the [Code.org Serial Connector]({webstoreURL}) Chrome App.",
"makerSetupSignIn": "Open up the Code.org Maker App and sign in to Code.org.",
"makerSetupUnsupportedBrowser": "Your current browser is not supported at this time. Please install the latest version of [Google Chrome](https://www.google.com/chrome/browser).",
"makerSetupVerifyComponents": "Oh no! Something unexpected went wrong while verifying the board components.",
"makerSetupWindows7Drivers": "(Windows 7) Install the [Adafruit Windows drivers](https://learn.adafruit.com/adafruit-feather-32u4-basic-proto/using-with-arduino-ide#install-drivers-windows-only).",
"manageAssets": "Click to view or update your images and sounds.",
"nextLevel": "Congratulations! You have completed this puzzle.",
"no": "No",
"noUsableDeviceOnPort": "Did not find a usable device on a serial port.",
"numBlocksNeeded": "This puzzle can be solved with %1 blocks.",
"redetect": "re-detect",
"reinfFeedbackMsg": "Are you finished? With App Lab, you're in control - it's up to you to check your work and decide when you're done.",
"repeatForever": "repeat forever",
"repeatDo": "do",
Expand Down
4 changes: 4 additions & 0 deletions apps/i18n/common/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
"choosePrefix": "Choose...",
"chooseSection": "Choose your section",
"chooseTable": "Choose a table",
"chromebook": "Chromebook",
"classProgress": "Class Progress",
"clearPuzzle": "Start Over",
"clearPuzzleConfirm": "This will reset the puzzle to its start state and delete all the blocks you've added or changed.",
Expand Down Expand Up @@ -962,6 +963,7 @@
"libraryUnPublishFail": "There was an error unpublishing your library. Please check your internet connection and try again.",
"libraryUnPublishTitle": "Successfully unpublished your library",
"linesOfCode": "Lines of Code",
"linux": "Linux",
"listVariable": "list",
"loading": "Loading...",
"loadingError": "An error occurred. Please reload the page and try again.",
Expand Down Expand Up @@ -1046,6 +1048,7 @@
"loginTypeWordAgeGroup": "Recommended for ages 9 - 12",
"loginTypeWordButton": "Use word logins",
"loginTypeWordDescription": "You will create accounts for your students. Students will log in with a secret pair of words.",
"mac": "Mac",
"makeMyOwn": "Make my own",
"makeNewSounds": "Make new sounds",
"makerNewProjectButton": "Create a project",
Expand Down Expand Up @@ -1872,6 +1875,7 @@
"when": "when",
"whenRun": "when run",
"whichCourse": "Assign a course so that your students go directly to the right course after signing in. Don't know which course to teach? Find a course from the courses page to assign a course to your section later.",
"windows": "Windows",
"withoutHints": "Without using any hints!",
"workedWith": "Worked With:",
"workshopDate": "Workshop Date",
Expand Down
6 changes: 4 additions & 2 deletions apps/src/lib/kits/maker/portScanning.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* global SerialPort */ // Maybe provided by the Code.org Browser
import ChromeSerialPort from 'chrome-serialport';
import {ConnectionFailedError} from './MakerError';
import applabI18n from '@cdo/applab/locale';

/**
* @typedef {Object} SerialPortInfo
Expand Down Expand Up @@ -39,8 +40,9 @@ export function findPortWithViableDevice() {
} else {
return Promise.reject(
new ConnectionFailedError(
'Did not find a usable device on a serial port. ' +
'\n\nFound devices: ' +
applabI18n.noUsableDeviceOnPort() +
'\n\n' +
applabI18n.foundDevices() +
epeach marked this conversation as resolved.
Show resolved Hide resolved
JSON.stringify(list)
)
);
Expand Down
126 changes: 47 additions & 79 deletions apps/src/lib/kits/maker/ui/SetupChecklist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import trackEvent from '../../../../util/trackEvent';
import SetupChecker from '../util/SetupChecker';
import SafeMarkdown from '@cdo/apps/templates/SafeMarkdown';
import i18n from '@cdo/locale';
import applabI18n from '@cdo/applab/locale';
import {
isWindows,
isChrome,
Expand All @@ -20,6 +21,7 @@ import experiments from '@cdo/apps/util/experiments';
import _ from 'lodash';
import yaml from 'js-yaml';
import Button from '@cdo/apps/templates/Button';
import {CHROME_APP_WEBSTORE_URL} from '../util/makerConstants';

const STATUS_SUPPORTED_BROWSER = 'statusSupportedBrowser';
const STATUS_APP_INSTALLED = 'statusAppInstalled';
Expand Down Expand Up @@ -198,44 +200,40 @@ export default class SetupChecklist extends Component {
// Maker Toolkit Standalone App
return (
<ValidationStep
stepName="Code.org Browser"
stepName={applabI18n.makerSetupBrowserTitle()}
stepStatus={this.state[STATUS_SUPPORTED_BROWSER]}
/>
);
} else if (isChromeOS() || isChrome()) {
// Chromebooks - Chrome App
return (
<ValidationStep
stepName={'Chrome App installed' + (isChromeOS() ? '' : ' (Legacy)')}
stepName={
applabI18n.makerSetupAppInstalled() +
(isChromeOS() ? '' : ' (' + applabI18n.legacy() + ')')
epeach marked this conversation as resolved.
Show resolved Hide resolved
}
stepStatus={this.state[STATUS_APP_INSTALLED]}
>
Please install the{' '}
<a
href="https://chrome.google.com/webstore/detail/codeorg-serial-connector/ncmmhcpckfejllekofcacodljhdhibkg"
target="_blank"
>
Code.org Serial Connector Chrome App
</a>
.
<SafeMarkdown
markdown={applabI18n.makerSetupInstallSerialConnector({
webstoreURL: CHROME_APP_WEBSTORE_URL
})}
/>
<br />
Once it is installed, come back to this page and click the "re-detect"
button, above.
{applabI18n.makerSetupRedetect()}
<br />
If a prompt asking for permission for Code Studio to connect to the
Chrome App pops up, click Accept.
{applabI18n.makerSetupAcceptPrompt()}
{this.contactSupport()}
</ValidationStep>
);
} else {
// Unsupported Browser
return (
<ValidationStep
stepName="Using a supported browser"
stepName={applabI18n.makerSetupBrowserSupported()}
stepStatus={Status.FAILED}
>
Your current browser is not supported at this time. Please install the
latest version of{' '}
<a href="https://www.google.com/chrome/browser/">Google Chrome</a>.
<SafeMarkdown markdown={applabI18n.makerSetupUnsupportedBrowser()} />
</ValidationStep>
);
}
Expand All @@ -245,6 +243,21 @@ export default class SetupChecklist extends Component {
return <SafeMarkdown markdown={i18n.contactGeneralSupport()} />;
}

installFirmwareSketch() {
return (
<div>
<SafeMarkdown
markdown={applabI18n.makerSetupInstallFirmata({
firmataURL:
this.state.boardTypeDetected === BOARD_TYPE.CLASSIC
? 'https://learn.adafruit.com/circuit-playground-firmata/overview'
: 'https://learn.adafruit.com/adafruit-circuit-playground-express/code-org-csd'
})}
/>
</div>
);
}

render() {
const linuxPermissionError =
isLinux() &&
Expand All @@ -254,12 +267,12 @@ export default class SetupChecklist extends Component {
return (
<div>
<h2>
Setup Check
{applabI18n.makerSetupCheck()}
<input
style={{marginLeft: 9, marginTop: -4}}
className="btn"
type="button"
value="re-detect"
value={applabI18n.redetect()}
onClick={this.redetect.bind(this)}
disabled={this.state.isDetecting}
/>
Expand All @@ -273,89 +286,44 @@ export default class SetupChecklist extends Component {
{this.state.caughtError && this.state.caughtError.reason && (
<pre>{this.state.caughtError.reason}</pre>
)}
We couldn't detect a Circuit Playground board. Make sure your board
is plugged in, and click{' '}
{applabI18n.makerSetupPlugInBoardCheck()}
<a href="#" onClick={this.redetect.bind(this)}>
re-detect
{applabI18n.redetect()}
Comment on lines +289 to +291
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[incorporate these strings into 1 for i18n]

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! Can you let me know which string parts you are looking at here? Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course -- i was thinking we could condense applabI18n.makerSetupPlugInBoardCheck and applabI18n.redetect using the <SafeMarkdown/> component, but now i realize that won't work because the onClick handler here won't play nicely with markdown, so you can ignore this one 😄

</a>
.
{isWindows() && (
<p>
If your board is plugged in, you may be missing the{' '}
<strong>Adafruit Windows Drivers</strong>. Follow the
instructions{' '}
<a href="https://learn.adafruit.com/adafruit-feather-32u4-basic-proto/using-with-arduino-ide#install-drivers-windows-only">
on this page
</a>{' '}
to install the drivers and try again.
</p>
<SafeMarkdown
markdown={applabI18n.makerSetupAdafruitWindowsDrivers()}
/>
)}
{this.contactSupport()}
</ValidationStep>
<ValidationStep
stepStatus={this.state[STATUS_BOARD_CONNECT]}
stepName={i18n.validationStepBoardConnectable()}
>
We found a board but it didn't respond properly when we tried to
connect to it.
{applabI18n.makerSetupBoardBadResponse()}
{linuxPermissionError && (
<div>
<p>
We didn't have permission to open the serialport. Please make
sure you are a member of the 'dialout' group.
</p>
<p>From your terminal, check which groups you belong to:</p>
<p>{applabI18n.makerSetupLinuxSerialport()}</p>
<p>{applabI18n.makerSetupLinuxGroupsCheck()}</p>
<pre>groups $&#123;USER&#125;</pre>
<p>
If you don't belong to 'dialout', you'll want to add yourself
to that group:
</p>
<p>{applabI18n.makerSetupLinuxAddDialout()}</p>
<pre>sudo gpasswd --add $&#123;USER&#125; dialout</pre>
<p>
You may need to restart your computer for changes to take
effect.
</p>
</div>
)}
{!linuxPermissionError && (
<div>
You should make sure it has the right firmware sketch installed.
You can{' '}
<a
href={
this.state.boardTypeDetected === BOARD_TYPE.CLASSIC
? 'https://learn.adafruit.com/circuit-playground-firmata/overview'
: 'https://learn.adafruit.com/adafruit-circuit-playground-express/code-org-csd'
}
>
install the Circuit Playground Firmata sketch with these
instructions
</a>
.
<p> {applabI18n.makerSetupLinuxRestart()} </p>
</div>
)}
{!linuxPermissionError && this.installFirmwareSketch()}
{this.contactSupport()}
</ValidationStep>
<ValidationStep
stepStatus={this.state[STATUS_BOARD_COMPONENTS]}
stepName={i18n.validationStepBoardComponentsUsable()}
>
Oh no! Something unexpected went wrong while verifying the board
components.
{applabI18n.makerSetupVerifyComponents()}
<br />
You should make sure your board has the right firmware sketch
installed. You can{' '}
<a
href={
this.state.boardTypeDetected === BOARD_TYPE.CLASSIC
? 'https://learn.adafruit.com/circuit-playground-firmata/overview'
: 'https://learn.adafruit.com/adafruit-circuit-playground-express/code-org-csd'
}
>
install the Circuit Playground Firmata sketch with these
instructions
</a>
.{this.contactSupport()}
{this.installFirmwareSketch()}
{this.contactSupport()}
</ValidationStep>
{experiments.isEnabled('flash-classic') &&
this.state.boardTypeDetected !== BOARD_TYPE.OTHER && (
Expand Down