Skip to content

Commit 729e5a1

Browse files
Fix typo, change loadpath (#1241)
Fixed a translation typo which was causing the file to error. Fixed loadpath.
1 parent 238d214 commit 729e5a1

File tree

8 files changed

+37
-61
lines changed

8 files changed

+37
-61
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2222
- CrowdIn issue for pluralised strings with no `one` version (#1234)
2323
- Update `imagePanel.gallery` string to remove Title Casing for consistency (#1238)
2424
- Update `imageUploadButton.uploadImage` string to remove Title Casing for consistency (#1238)
25+
- Fixed typo in the `en.json` translation file (#1241)
2526

2627
### Removed
2728

cypress/e2e/missionZero-wc.cy.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ it("defaults to the visual output tab", () => {
1111
.find(".proj-runner-container");
1212
runnerContainer
1313
.find(".react-tabs__tab--selected")
14-
.should("contain", "output.visualOutput");
14+
.should("contain", "Visual output");
1515
});
1616

1717
it("renders the astro pi component on page load", () => {
@@ -95,21 +95,13 @@ it("resets criteria correctly", () => {
9595
"text",
9696
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.get_pressure()\nsense.get_humidity()\nsense.get_temperature()"
9797
);
98-
cy.get("editor-wc")
99-
.shadow()
100-
.find(".btn--run")
101-
.contains("runButton.run")
102-
.click();
98+
cy.get("editor-wc").shadow().find(".btn--run").contains("Run").click();
10399
cy.get("#results").should("contain", '"readPressure":true');
104100
cy.get("editor-wc")
105101
.shadow()
106102
.find("div[class=cm-content]")
107103
.invoke("text", "from sense_hat import SenseHat");
108-
cy.get("editor-wc")
109-
.shadow()
110-
.find(".btn--run")
111-
.contains("runButton.run")
112-
.click();
104+
cy.get("editor-wc").shadow().find(".btn--run").contains("Run").click();
113105
cy.get("#results").should(
114106
"contain",
115107
'"noInputEvents":true,"readColour":false,"readHumidity":false,"readPressure":false,"readTemperature":false,"usedLEDs":false'
@@ -151,7 +143,7 @@ it("picks up calls to input()", () => {
151143
cy.get("editor-wc")
152144
.shadow()
153145
.find("div.pythonrunner-container.skulptrunner.skulptrunner--active")
154-
.contains(".react-tabs__tab-text", "output.textOutput")
146+
.contains(".react-tabs__tab-text", "Text output")
155147
.click();
156148
cy.get("editor-wc")
157149
.shadow()

cypress/e2e/spec-html.cy.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ const getIframeBody = () => {
1818
};
1919

2020
const makeNewFile = (filename = "new.html") => {
21-
cy.get("editor-wc")
22-
.shadow()
23-
.find("span")
24-
.contains("filePanel.newFileButton")
25-
.click();
21+
cy.get("editor-wc").shadow().find("span").contains("Add file").click();
2622
cy.get("editor-wc")
2723
.shadow()
2824
.find("div[class=modal-content__input]")
@@ -31,7 +27,7 @@ const makeNewFile = (filename = "new.html") => {
3127
cy.get("editor-wc")
3228
.shadow()
3329
.find("div[class=modal-content__buttons]")
34-
.contains("newFileModal.addFile")
30+
.contains("Add file")
3531
.click();
3632
};
3733

@@ -150,7 +146,7 @@ it("blocks non-permitted external links", () => {
150146
.shadow()
151147
.find("div[class=modal-content__header]")
152148
.find("h2")
153-
.should("include.text", "modal.error.heading");
149+
.should("include.text", "An error has occurred");
154150
});
155151

156152
it("allows permitted external links", () => {

cypress/e2e/spec-wc-pyodide.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ describe("Running the code with pyodide", () => {
4141
cy.get("editor-wc")
4242
.shadow()
4343
.find(".pyodiderunner")
44-
.contains(".react-tabs__tab", "output.visualOutput")
44+
.contains(".react-tabs__tab", "Visual output")
4545
.should("not.exist");
4646
cy.get("editor-wc")
4747
.shadow()
4848
.find(".pyodiderunner")
4949
.find(".react-tabs__tab--selected")
50-
.should("contain", "output.textOutput");
50+
.should("contain", "Text output");
5151
cy.get("editor-wc")
5252
.shadow()
5353
.find(".pythonrunner-console-output-line")
@@ -70,7 +70,7 @@ describe("Running the code with pyodide", () => {
7070
cy.get("editor-wc")
7171
.shadow()
7272
.find(".error-message__content")
73-
.should("contain", "output.errors.interrupted");
73+
.should("contain", "Execution interrupted");
7474
});
7575

7676
it("runs a simple program with an input", () => {

cypress/e2e/spec-wc-skulpt.cy.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ describe("Running the code with skulpt", () => {
3737
cy.get("editor-wc")
3838
.shadow()
3939
.find(".skulptrunner")
40-
.contains(".react-tabs__tab", "output.visualOutput")
40+
.contains(".react-tabs__tab", "Visual output")
4141
.should("not.be.visible");
4242
cy.get("editor-wc")
4343
.shadow()
4444
.find(".skulptrunner")
4545
.find(".react-tabs__tab--selected")
46-
.should("contain", "output.textOutput");
46+
.should("contain", "Text output");
4747
cy.get("editor-wc")
4848
.shadow()
4949
.find(".pythonrunner-console-output-line")
@@ -57,13 +57,13 @@ describe("Running the code with skulpt", () => {
5757
cy.get("editor-wc")
5858
.shadow()
5959
.find(".skulptrunner")
60-
.contains(".react-tabs__tab", "output.textOutput")
60+
.contains(".react-tabs__tab", "Text output")
6161
.should("exist");
6262
cy.get("editor-wc")
6363
.shadow()
6464
.find(".skulptrunner")
6565
.find(".react-tabs__tab--selected")
66-
.should("contain", "output.visualOutput");
66+
.should("contain", "Visual output");
6767
cy.get("editor-wc").shadow().find(".p5Canvas").should("exist");
6868
});
6969

@@ -83,17 +83,17 @@ describe("Running the code with skulpt", () => {
8383
cy.get("editor-wc")
8484
.shadow()
8585
.find(".error-message__content")
86-
.should("contain", "output.errors.interrupted");
86+
.should("contain", "Execution interrupted");
8787
});
8888

8989
it("Py5 magic comment imports py5", () => {
90-
runCode("# input.comment.py5");
91-
cy.get("editor-wc").shadow().find(".p5Canvas").should("be.visible").debug();
90+
runCode("# Py5: imported mode");
91+
cy.get("editor-wc").shadow().find(".p5Canvas").should("be.visible");
9292
});
9393

9494
it("Py5 imported mode runs sketch without explicit run call", () => {
9595
runCode(
96-
"# input.comment.py5\ndef setup():\n\tsize(400,400)\n\ndef draw():\n\tprint('hello world')"
96+
"# Py5: imported mode\ndef setup():\n\tsize(400,400)\n\ndef draw():\n\tprint('hello world')"
9797
);
9898
cy.get("editor-wc")
9999
.shadow()
@@ -108,7 +108,7 @@ describe("Running the code with skulpt", () => {
108108
cy.get("editor-wc")
109109
.shadow()
110110
.find(".skulptrunner")
111-
.contains("output.textOutput")
111+
.contains("Text output")
112112
.click();
113113

114114
cy.get("editor-wc")
@@ -122,7 +122,7 @@ describe("Running the code with skulpt", () => {
122122
cy.get("editor-wc")
123123
.shadow()
124124
.find(".skulptrunner")
125-
.should("contain", "output.visualOutput");
125+
.should("contain", "Visual output");
126126
});
127127

128128
it("does not render astro pi component on page load", () => {
@@ -134,14 +134,14 @@ describe("Running the code with skulpt", () => {
134134

135135
it("renders astro pi component if sense hat imported", () => {
136136
runCode("import sense_hat");
137-
cy.get("editor-wc").shadow().contains("output.visualOutput").click();
137+
cy.get("editor-wc").shadow().contains("Visual output").click();
138138
cy.get("editor-wc").shadow().find(".skulptrunner").should("contain", "yaw");
139139
});
140140

141141
it("does not render astro pi component if sense hat unimported", () => {
142142
runCode("import sense_hat");
143143
runCode("import p5");
144-
cy.get("editor-wc").shadow().contains("output.visualOutput").click();
144+
cy.get("editor-wc").shadow().contains("Visual output").click();
145145
cy.get("editor-wc")
146146
.shadow()
147147
.find(".skulptrunner")

cypress/e2e/spec-wc.cy.js

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ describe("default behaviour", () => {
1313
});
1414

1515
it("renders the web component", () => {
16-
cy.get("editor-wc")
17-
.shadow()
18-
.find("button")
19-
.should("contain", "runButton.run");
16+
cy.get("editor-wc").shadow().find("button").should("contain", "Run");
2017
});
2118

2219
it("defaults to the text output tab", () => {
@@ -26,14 +23,14 @@ describe("default behaviour", () => {
2623
.find(".proj-runner-container");
2724
runnerContainer
2825
.find(".react-tabs__tab--selected")
29-
.should("contain", "output.textOutput");
26+
.should("contain", "Text output");
3027
});
3128

3229
it("does not render visual output tab on page load", () => {
3330
cy.get("editor-wc")
3431
.shadow()
3532
.find("#root")
36-
.should("not.contain", "output.visualOutput");
33+
.should("not.contain", "Visual output");
3734
});
3835
});
3936

@@ -122,11 +119,11 @@ describe("when embedded, output_only & output_split_view are true", () => {
122119
.find(".proj-runner-container");
123120
runnerContainer
124121
.find(".react-tabs__tab--selected")
125-
.should("contain", "output.textOutput");
122+
.should("contain", "Text output");
126123
cy.get("editor-wc")
127124
.shadow()
128125
.find("button")
129-
.contains("runButton.run")
126+
.contains("Run")
130127
.should("not.be.disabled")
131128
.should("be.visible");
132129

@@ -144,21 +141,14 @@ describe("when embedded, output_only & output_split_view are true", () => {
144141
.should("not.exist");
145142

146143
// Run the code and check it executed without error
147-
cy.get("editor-wc")
148-
.shadow()
149-
.find("button")
150-
.contains("runButton.run")
151-
.click();
144+
cy.get("editor-wc").shadow().find("button").contains("Run").click();
152145
cy.get("#results").should("contain", '{"errorDetails":{}}');
153146

154147
// Check that the visual output panel is displayed in split view mode (vs tabbed view)
148+
cy.get("editor-wc").shadow().contains("Visual output").should("be.visible");
155149
cy.get("editor-wc")
156150
.shadow()
157-
.contains("output.visualOutput")
158-
.should("be.visible");
159-
cy.get("editor-wc")
160-
.shadow()
161-
.contains("output.visualOutput")
151+
.contains("Visual output")
162152
.parents("ul")
163153
.children()
164154
.should("have.length", 1);
@@ -171,12 +161,12 @@ describe("when embedded, output_only & output_split_view are true", () => {
171161
// Important to wait for this before making the negative assertions that follow
172162
cy.get("editor-wc")
173163
.shadow()
174-
.contains("index.html output.preview")
164+
.contains("index.html preview")
175165
.should("be.visible");
176166
cy.get("editor-wc")
177167
.shadow()
178168
.find("button")
179-
.contains("runButton.run")
169+
.contains("Run")
180170
.should("not.be.disabled")
181171
.should("be.visible");
182172

@@ -201,11 +191,7 @@ describe("when embedded, output_only & output_split_view are true", () => {
201191
.should("not.exist");
202192

203193
// Run the code and check it executed without error
204-
cy.get("editor-wc")
205-
.shadow()
206-
.find("button")
207-
.contains("runButton.run")
208-
.click();
194+
cy.get("editor-wc").shadow().find("button").contains("Run").click();
209195
cy.get("#results").should("contain", '{"errorDetails":{}}');
210196
});
211197
});

public/translations/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
},
2929
"files": "Project files",
3030
"images": "Image gallery",
31-
},
3231
"newFileButton": "Add file",
3332
"newFileModal": {
3433
"cancel": "Cancel",

src/utils/i18n.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ i18n
111111
interpolation: {
112112
escapeValue: false, // not needed for react!!
113113
},
114-
backend: { loadPath: "/translations/{{lng}}.json" },
114+
backend: {
115+
loadPath: `${process.env.PUBLIC_URL}/translations/{{lng}}.json`,
116+
},
115117
});
116118

117119
export default i18n;

0 commit comments

Comments
 (0)