Skip to content

Commit 238d214

Browse files
New Crowdin updates (#1212)
Co-authored-by: Jamie Benstead <jamie.benstead@gmail.com> Co-authored-by: Jamie Benstead <57325966+jamiebenstead@users.noreply.github.com>
1 parent d99f380 commit 238d214

File tree

12 files changed

+1007
-74
lines changed

12 files changed

+1007
-74
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
### Added
1010

1111
- Ability to translate demo project instructions (#1230)
12+
- Translations (#1212)
1213

1314
### Changed
1415

cypress/e2e/missionZero-wc.cy.js

Lines changed: 25 additions & 17 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", "Visual output");
14+
.should("contain", "output.visualOutput");
1515
});
1616

1717
it("renders the astro pi component on page load", () => {
@@ -38,7 +38,7 @@ it("sets initial criteria correctly", () => {
3838
cy.get("editor-wc").shadow().find(".btn--run").click();
3939
cy.get("#results").should(
4040
"contain",
41-
'"noInputEvents":true,"readColour":false,"readHumidity":false,"readPressure":false,"readTemperature":false,"usedLEDs":false',
41+
'"noInputEvents":true,"readColour":false,"readHumidity":false,"readPressure":false,"readTemperature":false,"usedLEDs":false'
4242
);
4343
});
4444

@@ -57,7 +57,7 @@ it("checks temperature has been read correctly", () => {
5757
.find("div[class=cm-content]")
5858
.invoke(
5959
"text",
60-
"from sense_hat import SenseHat\nSenseHat().get_temperature()",
60+
"from sense_hat import SenseHat\nSenseHat().get_temperature()"
6161
);
6262
cy.get("editor-wc").shadow().find(".btn--run").click();
6363
cy.get("#results").should("contain", '"readTemperature":true');
@@ -69,7 +69,7 @@ it("checks humidity has been read correctly", () => {
6969
.find("div[class=cm-content]")
7070
.invoke(
7171
"text",
72-
"from sense_hat import SenseHat\nSenseHat().get_humidity()",
72+
"from sense_hat import SenseHat\nSenseHat().get_humidity()"
7373
);
7474
cy.get("editor-wc").shadow().find(".btn--run").click();
7575
cy.get("#results").should("contain", '"readHumidity":true');
@@ -81,7 +81,7 @@ it("checks pressure has been read correctly", () => {
8181
.find("div[class=cm-content]")
8282
.invoke(
8383
"text",
84-
"from sense_hat import SenseHat\nSenseHat().get_pressure()",
84+
"from sense_hat import SenseHat\nSenseHat().get_pressure()"
8585
);
8686
cy.get("editor-wc").shadow().find(".btn--run").click();
8787
cy.get("#results").should("contain", '"readPressure":true');
@@ -93,18 +93,26 @@ it("resets criteria correctly", () => {
9393
.find("div[class=cm-content]")
9494
.invoke(
9595
"text",
96-
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.get_pressure()\nsense.get_humidity()\nsense.get_temperature()",
96+
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.get_pressure()\nsense.get_humidity()\nsense.get_temperature()"
9797
);
98-
cy.get("editor-wc").shadow().find(".btn--run").contains("Run").click();
98+
cy.get("editor-wc")
99+
.shadow()
100+
.find(".btn--run")
101+
.contains("runButton.run")
102+
.click();
99103
cy.get("#results").should("contain", '"readPressure":true');
100104
cy.get("editor-wc")
101105
.shadow()
102106
.find("div[class=cm-content]")
103107
.invoke("text", "from sense_hat import SenseHat");
104-
cy.get("editor-wc").shadow().find(".btn--run").contains("Run").click();
108+
cy.get("editor-wc")
109+
.shadow()
110+
.find(".btn--run")
111+
.contains("runButton.run")
112+
.click();
105113
cy.get("#results").should(
106114
"contain",
107-
'"noInputEvents":true,"readColour":false,"readHumidity":false,"readPressure":false,"readTemperature":false,"usedLEDs":false',
115+
'"noInputEvents":true,"readColour":false,"readHumidity":false,"readPressure":false,"readTemperature":false,"usedLEDs":false'
108116
);
109117
});
110118

@@ -114,7 +122,7 @@ it("confirms LEDs used when single led set", () => {
114122
.find("div[class=cm-content]")
115123
.invoke(
116124
"text",
117-
"from sense_hat import SenseHat\nSenseHat().set_pixel(0, 0, 100, 100, 100)",
125+
"from sense_hat import SenseHat\nSenseHat().set_pixel(0, 0, 100, 100, 100)"
118126
);
119127
cy.get("editor-wc").shadow().find(".btn--run").click();
120128
cy.get("#results").should("contain", '"usedLEDs":true');
@@ -126,7 +134,7 @@ it("confirms LEDs used when display set", () => {
126134
.find("div[class=cm-content]")
127135
.invoke(
128136
"text",
129-
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.set_pixels([[100,0,0]] * 64)",
137+
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.set_pixels([[100,0,0]] * 64)"
130138
);
131139
cy.get("editor-wc").shadow().find(".btn--run").click();
132140
cy.scrollTo("bottom");
@@ -143,7 +151,7 @@ it("picks up calls to input()", () => {
143151
cy.get("editor-wc")
144152
.shadow()
145153
.find("div.pythonrunner-container.skulptrunner.skulptrunner--active")
146-
.contains(".react-tabs__tab-text", "Text output")
154+
.contains(".react-tabs__tab-text", "output.textOutput")
147155
.click();
148156
cy.get("editor-wc")
149157
.shadow()
@@ -162,7 +170,7 @@ it("picks up calls to wait for motion", () => {
162170
.find("div[class=cm-content]")
163171
.invoke(
164172
"text",
165-
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.motion.wait_for_motion()",
173+
"from sense_hat import SenseHat\nsense = SenseHat()\nsense.motion.wait_for_motion()"
166174
);
167175
cy.get("editor-wc").shadow().find(".btn--run").click();
168176
cy.get("#results").should("contain", '"noInputEvents":false');
@@ -183,7 +191,7 @@ it("does not return null duration if no change in focus", () => {
183191
.find("div[class=cm-content]")
184192
.invoke(
185193
"text",
186-
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")',
194+
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")'
187195
);
188196
cy.get("editor-wc").shadow().find(".btn--run").click();
189197
cy.get("#results").should("not.contain", '"duration":null');
@@ -195,7 +203,7 @@ it("does not return null duration if focus changed before code run", () => {
195203
.find("div[class=cm-content]")
196204
.invoke(
197205
"text",
198-
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")',
206+
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")'
199207
);
200208
cy.window().blur();
201209
cy.window().focus();
@@ -209,7 +217,7 @@ it("returns duration of null if focus is lost", () => {
209217
.find("div[class=cm-content]")
210218
.invoke(
211219
"text",
212-
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")',
220+
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")'
213221
);
214222
cy.get("editor-wc")
215223
.shadow()
@@ -228,7 +236,7 @@ it("does not return duration of null if code rerun after focus lost", () => {
228236
.find("div[class=cm-content]")
229237
.invoke(
230238
"text",
231-
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")',
239+
'from sense_hat import SenseHat\nsense = SenseHat()\nsense.show_message("a")'
232240
);
233241
cy.get("editor-wc").shadow().find(".btn--run").click();
234242
cy.window().blur();

cypress/e2e/spec-html.cy.js

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

2020
const makeNewFile = (filename = "new.html") => {
21-
cy.get("editor-wc").shadow().find("span").contains("Add file").click();
21+
cy.get("editor-wc")
22+
.shadow()
23+
.find("span")
24+
.contains("filePanel.newFileButton")
25+
.click();
2226
cy.get("editor-wc")
2327
.shadow()
2428
.find("div[class=modal-content__input]")
@@ -27,7 +31,7 @@ const makeNewFile = (filename = "new.html") => {
2731
cy.get("editor-wc")
2832
.shadow()
2933
.find("div[class=modal-content__buttons]")
30-
.contains("Add file")
34+
.contains("newFileModal.addFile")
3135
.click();
3236
};
3337

@@ -36,9 +40,9 @@ beforeEach(() => {
3640
cy.intercept(
3741
"GET",
3842
`${Cypress.env(
39-
"REACT_APP_API_ENDPOINT",
43+
"REACT_APP_API_ENDPOINT"
4044
)}/api/projects/blank-html-starter?locale=en`,
41-
defaultHtmlProject,
45+
defaultHtmlProject
4246
);
4347
});
4448

@@ -55,7 +59,7 @@ it("blocks access to localStorage authKey", () => {
5559
localStorage.setItem("authKey", "secret")
5660
const authKey = localStorage.getItem("authKey")
5761
document.getElementById("authKey").innerHTML = \`\${authKey}\`
58-
</script>`,
62+
</script>`
5963
);
6064
cy.get("editor-wc").shadow().find(".btn--run").click();
6165
getIframeBody().find("p").should("include.text", "authKey: null");
@@ -74,7 +78,7 @@ it("blocks access to localStorage OIDC keys", () => {
7478
localStorage.setItem("oidc.user:https://auth-v1.raspberrypi.org:editor-api", "token")
7579
const oidcUser = localStorage.getItem("oidc.user:https://auth-v1.raspberrypi.org:editor-api")
7680
document.getElementById("oidcUser").innerHTML = \`\${oidcUser}\`
77-
</script>`,
81+
</script>`
7882
);
7983
cy.get("editor-wc").shadow().find(".btn--run").click();
8084
getIframeBody().find("p").should("include.text", "oidcUser: null");
@@ -93,7 +97,7 @@ it("allows access to other localStorage keys", () => {
9397
localStorage.setItem("foo", "bar")
9498
const foo = localStorage.getItem("foo")
9599
document.getElementById("foo").innerHTML = \`\${foo}\`
96-
</script>`,
100+
</script>`
97101
);
98102
cy.get("editor-wc").shadow().find(".btn--run").click();
99103
getIframeBody().find("p").should("include.text", "foo: bar");
@@ -138,15 +142,15 @@ it("blocks non-permitted external links", () => {
138142
.find("div[class=cm-content]")
139143
.invoke(
140144
"text",
141-
'<a href="https://raspberrypi.org/en/">some external link</a>',
145+
'<a href="https://raspberrypi.org/en/">some external link</a>'
142146
);
143147
cy.get("editor-wc").shadow().find(".btn--run").click();
144148
getIframeBody().find("a").click();
145149
cy.get("editor-wc")
146150
.shadow()
147151
.find("div[class=modal-content__header]")
148152
.find("h2")
149-
.should("include.text", "An error has occurred");
153+
.should("include.text", "modal.error.heading");
150154
});
151155

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

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

Lines changed: 13 additions & 13 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", "Visual output")
44+
.contains(".react-tabs__tab", "output.visualOutput")
4545
.should("not.exist");
4646
cy.get("editor-wc")
4747
.shadow()
4848
.find(".pyodiderunner")
4949
.find(".react-tabs__tab--selected")
50-
.should("contain", "Text output");
50+
.should("contain", "output.textOutput");
5151
cy.get("editor-wc")
5252
.shadow()
5353
.find(".pythonrunner-console-output-line")
@@ -56,7 +56,7 @@ describe("Running the code with pyodide", () => {
5656

5757
it("interrupts the code when the stop button is clicked", () => {
5858
runCode(
59-
"from time import sleep\nfor i in range(100):\n\tprint(i)\n\tsleep(1)",
59+
"from time import sleep\nfor i in range(100):\n\tprint(i)\n\tsleep(1)"
6060
);
6161
cy.get("editor-wc")
6262
.shadow()
@@ -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", "Execution interrupted");
73+
.should("contain", "output.errors.interrupted");
7474
});
7575

7676
it("runs a simple program with an input", () => {
@@ -115,7 +115,7 @@ describe("Running the code with pyodide", () => {
115115
.find(".error-message__content")
116116
.should(
117117
"contain",
118-
"FileExistsError: File 'output.txt' already exists on line 1 of main.py",
118+
"FileExistsError: File 'output.txt' already exists on line 1 of main.py"
119119
);
120120
});
121121

@@ -126,7 +126,7 @@ describe("Running the code with pyodide", () => {
126126
.find("div[class=cm-content]")
127127
.invoke(
128128
"text",
129-
'with open("output.txt", "a") as f:\n\tf.write("Hello again world")',
129+
'with open("output.txt", "a") as f:\n\tf.write("Hello again world")'
130130
);
131131
cy.get("editor-wc")
132132
.shadow()
@@ -153,7 +153,7 @@ describe("Running the code with pyodide", () => {
153153

154154
it("runs a simple program with a built-in pyodide module", () => {
155155
runCode(
156-
"import simplejson as json\nprint(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]))",
156+
"import simplejson as json\nprint(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]))"
157157
);
158158
cy.get("editor-wc")
159159
.shadow()
@@ -163,7 +163,7 @@ describe("Running the code with pyodide", () => {
163163

164164
it("runs a simple pygal program", () => {
165165
runCode(
166-
"import pygal\nbar_chart = pygal.Bar()\nbar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55])\nbar_chart.render()",
166+
"import pygal\nbar_chart = pygal.Bar()\nbar_chart.add('Fibonacci', [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55])\nbar_chart.render()"
167167
);
168168
cy.get("editor-wc")
169169
.shadow()
@@ -173,7 +173,7 @@ describe("Running the code with pyodide", () => {
173173

174174
it("runs a simple matplotlib program", () => {
175175
runCode(
176-
"import matplotlib.pyplot as plt\nx = [1,2,3]\ny = [2,4,1]\nplt.plot(x, y)\nplt.title('My first graph!')\nplt.show()",
176+
"import matplotlib.pyplot as plt\nx = [1,2,3]\ny = [2,4,1]\nplt.plot(x, y)\nplt.title('My first graph!')\nplt.show()"
177177
);
178178
cy.wait(5000);
179179
cy.get("editor-wc")
@@ -198,7 +198,7 @@ describe("Running the code with pyodide", () => {
198198
statusCode: 200,
199199
});
200200
runCode(
201-
"import urllib.request\nresponse = urllib.request.urlopen('https://www.my-amazing-website.com')\nprint(response.getcode())",
201+
"import urllib.request\nresponse = urllib.request.urlopen('https://www.my-amazing-website.com')\nprint(response.getcode())"
202202
);
203203
cy.get("editor-wc")
204204
.shadow()
@@ -208,7 +208,7 @@ describe("Running the code with pyodide", () => {
208208

209209
it("runs a simple program with a module from PyPI", () => {
210210
runCode(
211-
"from strsimpy.levenshtein import Levenshtein\nlevenshtein = Levenshtein()\nprint(levenshtein.distance('hello', 'world'))",
211+
"from strsimpy.levenshtein import Levenshtein\nlevenshtein = Levenshtein()\nprint(levenshtein.distance('hello', 'world'))"
212212
);
213213
cy.get("editor-wc")
214214
.shadow()
@@ -236,7 +236,7 @@ text_in = "This is a test message"
236236
rotor_start = "FNZ"
237237
text_out = use_enigma_machine(text_in, rotor_start)
238238
print(text_out)
239-
`,
239+
`
240240
);
241241
cy.get("editor-wc")
242242
.shadow()
@@ -251,7 +251,7 @@ print(text_out)
251251
.find(".error-message__content")
252252
.should(
253253
"contain",
254-
"ModuleNotFoundError: No module named 'i_do_not_exist' on line 1 of main.py",
254+
"ModuleNotFoundError: No module named 'i_do_not_exist' on line 1 of main.py"
255255
);
256256
});
257257

0 commit comments

Comments
 (0)