@khanacademy/perseus 57.2.1 → 58.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/strings.js CHANGED
@@ -1,16 +1,3 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- /**
6
- * The translated strings that are used to render Perseus.
7
- */
8
-
9
- /**
10
- * Untranslated strings used in Perseus. To be used by an external
11
- * translator to produce translated strings, passed in as `PerseusStrings`.
12
- * !! Note: Ensure that all escape sequences are double-escaped. (e.g. `\\text` -> `\\\\text`)
13
- */
14
1
  const strings = {
15
2
  closeKeypad: "close math keypad",
16
3
  openKeypad: "open math keypad",
@@ -147,7 +134,6 @@ const strings = {
147
134
  simulationLoadFail: "Sorry, this simulation cannot load.",
148
135
  simulationLocaleWarning: "Sorry, this simulation isn't available in your language.",
149
136
  selectAnAnswer: "Select an answer",
150
- // The following strings are used for interactive graph SR descriptions.
151
137
  addPoint: "Add Point",
152
138
  removePoint: "Remove Point",
153
139
  graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
@@ -155,14 +141,8 @@ const strings = {
155
141
  openPolygon: "Re-open shape",
156
142
  srInteractiveElements: "Interactive elements: %(elements)s",
157
143
  srNoInteractiveElements: "No interactive elements",
158
- // TODO(LEMS-2660): The following strings are ones that will need
159
- // translation tickets after all interactive graph SR strings have
160
- // been finalized. Remove this comment after the tickets have been
161
- // created.
162
144
  srGraphInstructions: "Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.",
163
145
  srUnlimitedGraphInstructions: "Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
164
- xAxis: "X-axis",
165
- yAxis: "Y-axis",
166
146
  srPointAtCoordinates: "Point %(num)s at %(x)s comma %(y)s.",
167
147
  srCircleGraph: "A circle on a coordinate plane.",
168
148
  srCircleShape: "Circle. The center point is at %(centerX)s comma %(centerY)s.",
@@ -238,30 +218,19 @@ const strings = {
238
218
  srSinusoidFlatPoint: "Line through point at %(x)s comma %(y)s.",
239
219
  srSinusoidDescription: "The graph shows a wave with a minimum value of %(minValue)s and a maximum value of %(maxValue)s. The wave completes a full cycle from %(cycleStart)s to %(cycleEnd)s.",
240
220
  srSinusoidInteractiveElements: "Sinusoid graph with midline intersection point at %(point1X)s comma %(point1Y)s and extremum point at %(point2X)s comma %(point2Y)s."
241
- // The above strings are used for interactive graph SR descriptions.
242
221
  };
243
-
244
- /**
245
- * Mock strings for the Perseus package, to be used for tests and Storybook.
246
- */
247
222
  const mockStrings = {
248
223
  closeKeypad: "close math keypad",
249
224
  openKeypad: "open math keypad",
250
225
  mathInputBox: "Math input box",
251
226
  removeHighlight: "Remove highlight",
252
227
  addHighlight: "Add highlight",
253
- hintPos: _ref => {
254
- let {
255
- pos
256
- } = _ref;
257
- return `Hint #${pos}`;
258
- },
259
- errorRendering: _ref2 => {
260
- let {
261
- error
262
- } = _ref2;
263
- return `Error rendering: ${error}`;
264
- },
228
+ hintPos: ({
229
+ pos
230
+ }) => `Hint #${pos}`,
231
+ errorRendering: ({
232
+ error
233
+ }) => `Error rendering: ${error}`,
265
234
  APPROXIMATED_PI_ERROR: "Your answer is close, but you may " + "have approximated pi. Enter your " + "answer as a multiple of pi, like " + "<code>12\\ \\text{pi}</code> or " + "<code>2/3\\ \\text{pi}</code>",
266
235
  EXTRA_SYMBOLS_ERROR: "We could not understand your " + "answer. Please check your answer for extra " + "text or symbols.",
267
236
  NEEDS_TO_BE_SIMPLFIED_ERROR: "Your answer is almost correct, " + "but it needs to be simplified.",
@@ -280,12 +249,9 @@ const mockStrings = {
280
249
  check: "Check",
281
250
  correctExcited: "Correct!",
282
251
  nextQuestion: "Next question",
283
- skipToTitle: _ref3 => {
284
- let {
285
- title
286
- } = _ref3;
287
- return `Skip to ${title}`;
288
- },
252
+ skipToTitle: ({
253
+ title
254
+ }) => `Skip to ${title}`,
289
255
  current: "Current",
290
256
  correct: "Correct",
291
257
  correctSelected: "Correct (selected)",
@@ -315,85 +281,52 @@ const mockStrings = {
315
281
  clickMultiple: "Click each dot on the image to select all answers that apply.",
316
282
  clickSingle: "Click each dot on the image to select an answer.",
317
283
  choices: "Choices:",
318
- answers: _ref4 => {
319
- let {
320
- num
321
- } = _ref4;
322
- return num === 1 ? `${num} answer` : `${num} answers`;
323
- },
284
+ answers: ({
285
+ num
286
+ }) => num === 1 ? `${num} answer` : `${num} answers`,
324
287
  hideAnswersToggleLabel: "Hide answer choices",
325
- moves: _ref5 => {
326
- let {
327
- num
328
- } = _ref5;
329
- return num === 1 ? `Moves: ${num}` : `Moves: ${num}`;
330
- },
288
+ moves: ({
289
+ num
290
+ }) => num === 1 ? `Moves: ${num}` : `Moves: ${num}`,
331
291
  clickTiles: "Click on the tiles to change the lights.",
332
292
  turnOffLights: "You must turn on all of the lights to continue.",
333
293
  fillAllCells: "Make sure you fill in all cells in the matrix.",
334
- molecularDrawing: _ref6 => {
335
- let {
336
- content
337
- } = _ref6;
338
- return `A molecular structure drawing. SMILES notation: ${content}`;
339
- },
294
+ molecularDrawing: ({
295
+ content
296
+ }) => `A molecular structure drawing. SMILES notation: ${content}`,
340
297
  switchDirection: "Switch direction",
341
298
  circleOpen: "Make circle open",
342
299
  circleFilled: "Make circle filled",
343
300
  numDivisions: "Number of divisions:",
344
- divisions: _ref7 => {
345
- let {
346
- divRangeString
347
- } = _ref7;
348
- return `Please make sure the number of divisions is in the range ${divRangeString}.`;
349
- },
350
- lineRange: _ref8 => {
351
- let {
352
- lineRange
353
- } = _ref8;
354
- return `lines ${lineRange}`;
355
- },
356
- lineNumber: _ref9 => {
357
- let {
358
- lineNumber
359
- } = _ref9;
360
- return `line ${lineNumber}`;
361
- },
362
- symbolPassage: _ref10 => {
363
- let {
364
- questionSymbol,
365
- questionNumber
366
- } = _ref10;
367
- return `The symbol ${questionSymbol} indicates that question ${questionNumber} references this portion of the passage.`;
368
- },
369
- symbolQuestion: _ref11 => {
370
- let {
371
- sentenceSymbol
372
- } = _ref11;
373
- return ` The symbol ${sentenceSymbol} indicates that the following sentence is referenced in a question.`;
374
- },
301
+ divisions: ({
302
+ divRangeString
303
+ }) => `Please make sure the number of divisions is in the range ${divRangeString}.`,
304
+ lineRange: ({
305
+ lineRange
306
+ }) => `lines ${lineRange}`,
307
+ lineNumber: ({
308
+ lineNumber
309
+ }) => `line ${lineNumber}`,
310
+ symbolPassage: ({
311
+ questionSymbol,
312
+ questionNumber
313
+ }) => `The symbol ${questionSymbol} indicates that question ${questionNumber} references this portion of the passage.`,
314
+ symbolQuestion: ({
315
+ sentenceSymbol
316
+ }) => ` The symbol ${sentenceSymbol} indicates that the following sentence is referenced in a question.`,
375
317
  lineLabel: "Line",
376
318
  beginningPassage: "Beginning of reading passage.",
377
319
  beginningFootnotes: "Beginning of reading passage footnotes.",
378
320
  endPassage: "End of reading passage.",
379
- questionMarker: _ref12 => {
380
- let {
381
- number
382
- } = _ref12;
383
- return `[Marker for question ${number}]`;
384
- },
385
- circleMarker: _ref13 => {
386
- let {
387
- number
388
- } = _ref13;
389
- return `[Circle marker ${number}]`;
390
- },
391
- sentenceMarker: _ref14 => {
392
- let {
393
- number
394
- } = _ref14;
395
- return `[Sentence ${number}]`;
396
- },
321
+ questionMarker: ({
322
+ number
323
+ }) => `[Marker for question ${number}]`,
324
+ circleMarker: ({
325
+ number
326
+ }) => `[Circle marker ${number}]`,
327
+ sentenceMarker: ({
328
+ number
329
+ }) => `[Sentence ${number}]`,
397
330
  dragHandles: "Drag handles to make graph",
398
331
  tapAddPoints: "Tap to add points",
399
332
  false: "False",
@@ -403,83 +336,47 @@ const mockStrings = {
403
336
  chooseCorrectNum: "Please choose the correct number of answers.",
404
337
  notNoneOfTheAbove: "'None of the above' may not be selected when other answers are selected.",
405
338
  noneOfTheAbove: "None of the above",
406
- chooseNumAnswers: _ref15 => {
407
- let {
408
- numCorrect
409
- } = _ref15;
410
- return `Choose ${numCorrect} answers:`;
411
- },
339
+ chooseNumAnswers: ({
340
+ numCorrect
341
+ }) => `Choose ${numCorrect} answers:`,
412
342
  chooseAllAnswers: "Choose all answers that apply:",
413
343
  chooseOneAnswer: "Choose 1 answer:",
414
- choiceCheckedCorrect: _ref16 => {
415
- let {
416
- letter
417
- } = _ref16;
418
- return `(Choice ${letter}, Checked, Correct)`;
419
- },
420
- choiceCrossedOutCorrect: _ref17 => {
421
- let {
422
- letter
423
- } = _ref17;
424
- return `(Choice ${letter}, Crossed out, Correct)`;
425
- },
426
- choiceCorrect: _ref18 => {
427
- let {
428
- letter
429
- } = _ref18;
430
- return `(Choice ${letter}, Correct)`;
431
- },
432
- choiceCheckedIncorrect: _ref19 => {
433
- let {
434
- letter
435
- } = _ref19;
436
- return `(Choice ${letter}, Checked, Incorrect)`;
437
- },
438
- choiceCrossedOutIncorrect: _ref20 => {
439
- let {
440
- letter
441
- } = _ref20;
442
- return `(Choice ${letter}, Crossed out, Incorrect)`;
443
- },
444
- choiceIncorrect: _ref21 => {
445
- let {
446
- letter
447
- } = _ref21;
448
- return `(Choice ${letter}, Incorrect)`;
449
- },
450
- choiceChecked: _ref22 => {
451
- let {
452
- letter
453
- } = _ref22;
454
- return `(Choice ${letter}, Checked)`;
455
- },
456
- choiceCrossedOut: _ref23 => {
457
- let {
458
- letter
459
- } = _ref23;
460
- return `(Choice ${letter}, Crossed out)`;
461
- },
462
- choice: _ref24 => {
463
- let {
464
- letter
465
- } = _ref24;
466
- return `(Choice ${letter})`;
467
- },
344
+ choiceCheckedCorrect: ({
345
+ letter
346
+ }) => `(Choice ${letter}, Checked, Correct)`,
347
+ choiceCrossedOutCorrect: ({
348
+ letter
349
+ }) => `(Choice ${letter}, Crossed out, Correct)`,
350
+ choiceCorrect: ({
351
+ letter
352
+ }) => `(Choice ${letter}, Correct)`,
353
+ choiceCheckedIncorrect: ({
354
+ letter
355
+ }) => `(Choice ${letter}, Checked, Incorrect)`,
356
+ choiceCrossedOutIncorrect: ({
357
+ letter
358
+ }) => `(Choice ${letter}, Crossed out, Incorrect)`,
359
+ choiceIncorrect: ({
360
+ letter
361
+ }) => `(Choice ${letter}, Incorrect)`,
362
+ choiceChecked: ({
363
+ letter
364
+ }) => `(Choice ${letter}, Checked)`,
365
+ choiceCrossedOut: ({
366
+ letter
367
+ }) => `(Choice ${letter}, Crossed out)`,
368
+ choice: ({
369
+ letter
370
+ }) => `(Choice ${letter})`,
468
371
  crossOut: "Cross out",
469
372
  crossOutOption: "Cross out option",
470
- crossOutChoice: _ref25 => {
471
- let {
472
- letter
473
- } = _ref25;
474
- return `Cross out Choice ${letter}`;
475
- },
373
+ crossOutChoice: ({
374
+ letter
375
+ }) => `Cross out Choice ${letter}`,
476
376
  bringBack: "Bring back",
477
- openMenuForChoice: _ref26 => {
478
- let {
479
- letter
480
- } = _ref26;
481
- return `Open menu for Choice ${letter}`;
482
- },
377
+ openMenuForChoice: ({
378
+ letter
379
+ }) => `Open menu for Choice ${letter}`,
483
380
  letters: "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z",
484
381
  rightArrow: "Reaction arrow pointing to the right.",
485
382
  dontUnderstandUnits: "I couldn't understand those units.",
@@ -499,454 +396,287 @@ const mockStrings = {
499
396
  simulationLoadFail: "Sorry, this simulation cannot load.",
500
397
  simulationLocaleWarning: "Sorry, this simulation isn't available in your language.",
501
398
  selectAnAnswer: "Select an answer",
502
- // The following strings are used for interactive graph SR descriptions.
503
399
  srGraphInstructions: "Use the Tab key to move through the interactive elements in the graph. When an interactive element has focus, use Control + Shift + Arrows to move it.",
504
400
  srUnlimitedGraphInstructions: "Press Shift + Enter to interact with the graph. Use the Tab key to move through the interactive elements in the graph and access the graph Action Bar. When an interactive element has focus, use Control + Shift + Arrows to move it or use the Delete key to remove it from the graph. Use the buttons in the Action Bar to add or adjust elements within the graph.",
505
- xAxis: "X-axis",
506
- yAxis: "Y-axis",
507
401
  graphKeyboardPrompt: "Press Shift + Enter to interact with the graph",
508
402
  addPoint: "Add Point",
509
403
  removePoint: "Remove Point",
510
404
  closePolygon: "Close shape",
511
405
  openPolygon: "Re-open shape",
512
- srPointAtCoordinates: _ref27 => {
513
- let {
514
- num,
515
- x,
516
- y
517
- } = _ref27;
518
- return `Point ${num} at ${x} comma ${y}.`;
519
- },
520
- srInteractiveElements: _ref28 => {
521
- let {
522
- elements
523
- } = _ref28;
524
- return `Interactive elements: ${elements}`;
525
- },
406
+ srPointAtCoordinates: ({
407
+ num,
408
+ x,
409
+ y
410
+ }) => `Point ${num} at ${x} comma ${y}.`,
411
+ srInteractiveElements: ({
412
+ elements
413
+ }) => `Interactive elements: ${elements}`,
526
414
  srNoInteractiveElements: "No interactive elements",
527
415
  srCircleGraph: "A circle on a coordinate plane.",
528
- srCircleShape: _ref29 => {
529
- let {
530
- centerX,
531
- centerY
532
- } = _ref29;
533
- return `Circle. The center point is at ${centerX} comma ${centerY}.`;
534
- },
535
- srCircleRadiusPointRight: _ref30 => {
536
- let {
537
- radiusPointX,
538
- radiusPointY
539
- } = _ref30;
540
- return `Right radius endpoint at ${radiusPointX} comma ${radiusPointY}.`;
541
- },
542
- srCircleRadiusPointLeft: _ref31 => {
543
- let {
544
- radiusPointX,
545
- radiusPointY
546
- } = _ref31;
547
- return `Left radius endpoint at ${radiusPointX} comma ${radiusPointY}.`;
548
- },
549
- srCircleRadius: _ref32 => {
550
- let {
551
- radius
552
- } = _ref32;
553
- return `Circle radius is ${radius}.`;
554
- },
555
- srCircleOuterPoints: _ref33 => {
556
- let {
557
- point1X,
558
- point1Y,
559
- point2X,
560
- point2Y,
561
- point3X,
562
- point3Y,
563
- point4X,
564
- point4Y
565
- } = _ref33;
566
- return `Points on the circle at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, ${point3X} comma ${point3Y}, ${point4X} comma ${point4Y}.`;
567
- },
416
+ srCircleShape: ({
417
+ centerX,
418
+ centerY
419
+ }) => `Circle. The center point is at ${centerX} comma ${centerY}.`,
420
+ srCircleRadiusPointRight: ({
421
+ radiusPointX,
422
+ radiusPointY
423
+ }) => `Right radius endpoint at ${radiusPointX} comma ${radiusPointY}.`,
424
+ srCircleRadiusPointLeft: ({
425
+ radiusPointX,
426
+ radiusPointY
427
+ }) => `Left radius endpoint at ${radiusPointX} comma ${radiusPointY}.`,
428
+ srCircleRadius: ({
429
+ radius
430
+ }) => `Circle radius is ${radius}.`,
431
+ srCircleOuterPoints: ({
432
+ point1X,
433
+ point1Y,
434
+ point2X,
435
+ point2Y,
436
+ point3X,
437
+ point3Y,
438
+ point4X,
439
+ point4Y
440
+ }) => `Points on the circle at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, ${point3X} comma ${point3Y}, ${point4X} comma ${point4Y}.`,
568
441
  srLinearGraph: "A line on a coordinate plane.",
569
- srLinearGraphPoints: _ref34 => {
570
- let {
571
- point1X,
572
- point1Y,
573
- point2X,
574
- point2Y
575
- } = _ref34;
576
- return `The line has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`;
577
- },
442
+ srLinearGraphPoints: ({
443
+ point1X,
444
+ point1Y,
445
+ point2X,
446
+ point2Y
447
+ }) => `The line has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`,
578
448
  srLinearGraphSlopeIncreasing: "Its slope increases from left to right.",
579
449
  srLinearGraphSlopeDecreasing: "Its slope decreases from left to right.",
580
450
  srLinearGraphSlopeHorizontal: "Its slope is zero.",
581
451
  srLinearGraphSlopeVertical: "Its slope is undefined.",
582
- srLinearGraphXOnlyIntercept: _ref35 => {
583
- let {
584
- xIntercept
585
- } = _ref35;
586
- return `The line crosses the X-axis at ${xIntercept} comma 0.`;
587
- },
588
- srLinearGraphYOnlyIntercept: _ref36 => {
589
- let {
590
- yIntercept
591
- } = _ref36;
592
- return `The line crosses the Y-axis at 0 comma ${yIntercept}.`;
593
- },
594
- srLinearGraphBothIntercepts: _ref37 => {
595
- let {
596
- xIntercept,
597
- yIntercept
598
- } = _ref37;
599
- return `The line crosses the X-axis at ${xIntercept} comma 0 and the Y-axis at 0 comma ${yIntercept}.`;
600
- },
452
+ srLinearGraphXOnlyIntercept: ({
453
+ xIntercept
454
+ }) => `The line crosses the X-axis at ${xIntercept} comma 0.`,
455
+ srLinearGraphYOnlyIntercept: ({
456
+ yIntercept
457
+ }) => `The line crosses the Y-axis at 0 comma ${yIntercept}.`,
458
+ srLinearGraphBothIntercepts: ({
459
+ xIntercept,
460
+ yIntercept
461
+ }) => `The line crosses the X-axis at ${xIntercept} comma 0 and the Y-axis at 0 comma ${yIntercept}.`,
601
462
  srLinearGraphOriginIntercept: "The line crosses the X and Y axes at the graph's origin.",
602
- srLinearGrabHandle: _ref38 => {
603
- let {
604
- point1X,
605
- point1Y,
606
- point2X,
607
- point2Y
608
- } = _ref38;
609
- return `Line going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`;
610
- },
611
- srAngleStartingSide: _ref39 => {
612
- let {
613
- x,
614
- y
615
- } = _ref39;
616
- return `Point 3, starting side at ${x} comma ${y}.`;
617
- },
618
- srAngleEndingSide: _ref40 => {
619
- let {
620
- x,
621
- y
622
- } = _ref40;
623
- return `Point 2, ending side at ${x} comma ${y}.`;
624
- },
625
- srAngleVertexWithAngleMeasure: _ref41 => {
626
- let {
627
- x,
628
- y,
629
- angleMeasure
630
- } = _ref41;
631
- return `Point 1, vertex at ${x} comma ${y}. Angle ${angleMeasure} degrees.`;
632
- },
463
+ srLinearGrabHandle: ({
464
+ point1X,
465
+ point1Y,
466
+ point2X,
467
+ point2Y
468
+ }) => `Line going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`,
469
+ srAngleStartingSide: ({
470
+ x,
471
+ y
472
+ }) => `Point 3, starting side at ${x} comma ${y}.`,
473
+ srAngleEndingSide: ({
474
+ x,
475
+ y
476
+ }) => `Point 2, ending side at ${x} comma ${y}.`,
477
+ srAngleVertexWithAngleMeasure: ({
478
+ x,
479
+ y,
480
+ angleMeasure
481
+ }) => `Point 1, vertex at ${x} comma ${y}. Angle ${angleMeasure} degrees.`,
633
482
  srAngleGraphAriaLabel: "An angle on a coordinate plane.",
634
- srAngleGraphAriaDescription: _ref42 => {
635
- let {
636
- angleMeasure,
637
- vertexX,
638
- vertexY,
639
- startingSideX,
640
- startingSideY,
641
- endingSideX,
642
- endingSideY
643
- } = _ref42;
644
- return `The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the starting side at ${startingSideX} comma ${startingSideY} and a point on the ending side at ${endingSideX} comma ${endingSideY}.`;
645
- },
646
- srAngleInteractiveElements: _ref43 => {
647
- let {
648
- vertexX,
649
- vertexY,
650
- startingSideX,
651
- startingSideY,
652
- endingSideX,
653
- endingSideY
654
- } = _ref43;
655
- return `An angle formed by 3 points. The vertex is at ${vertexX} comma ${vertexY}. The starting side point is at ${startingSideX} comma ${startingSideY}. The ending side point is at ${endingSideX} comma ${endingSideY}.`;
656
- },
483
+ srAngleGraphAriaDescription: ({
484
+ angleMeasure,
485
+ vertexX,
486
+ vertexY,
487
+ startingSideX,
488
+ startingSideY,
489
+ endingSideX,
490
+ endingSideY
491
+ }) => `The angle measure is ${angleMeasure} degrees with a vertex at ${vertexX} comma ${vertexY}, a point on the starting side at ${startingSideX} comma ${startingSideY} and a point on the ending side at ${endingSideX} comma ${endingSideY}.`,
492
+ srAngleInteractiveElements: ({
493
+ vertexX,
494
+ vertexY,
495
+ startingSideX,
496
+ startingSideY,
497
+ endingSideX,
498
+ endingSideY
499
+ }) => `An angle formed by 3 points. The vertex is at ${vertexX} comma ${vertexY}. The starting side point is at ${startingSideX} comma ${startingSideY}. The ending side point is at ${endingSideX} comma ${endingSideY}.`,
657
500
  srSingleSegmentGraphAriaLabel: "A line segment on a coordinate plane.",
658
- srMultipleSegmentGraphAriaLabel: _ref44 => {
659
- let {
660
- countOfSegments
661
- } = _ref44;
662
- return `${countOfSegments} segments on a coordinate plane.`;
663
- },
664
- srMultipleSegmentIndividualLabel: _ref45 => {
665
- let {
666
- point1X,
667
- point1Y,
668
- point2X,
669
- point2Y,
670
- indexOfSegment
671
- } = _ref45;
672
- return `Segment ${indexOfSegment}: Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`;
673
- },
674
- srSingleSegmentLabel: _ref46 => {
675
- let {
676
- point1X,
677
- point1Y,
678
- point2X,
679
- point2Y
680
- } = _ref46;
681
- return `Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`;
682
- },
683
- srSegmentLength: _ref47 => {
684
- let {
685
- length
686
- } = _ref47;
687
- return `Segment length ${length} units.`;
688
- },
689
- srSingleSegmentGraphEndpointAriaLabel: _ref48 => {
690
- let {
691
- endpointNumber,
692
- x,
693
- y
694
- } = _ref48;
695
- return `Endpoint ${endpointNumber} at ${x} comma ${y}.`;
696
- },
697
- srMultipleSegmentGraphEndpointAriaLabel: _ref49 => {
698
- let {
699
- endpointNumber,
700
- x,
701
- y,
702
- indexOfSegment
703
- } = _ref49;
704
- return `Endpoint ${endpointNumber} on segment ${indexOfSegment} at ${x} comma ${y}.`;
705
- },
706
- srSegmentGrabHandle: _ref50 => {
707
- let {
708
- point1X,
709
- point1Y,
710
- point2X,
711
- point2Y
712
- } = _ref50;
713
- return `Segment from ${point1X} comma ${point1Y} to ${point2X} comma ${point2Y}.`;
714
- },
501
+ srMultipleSegmentGraphAriaLabel: ({
502
+ countOfSegments
503
+ }) => `${countOfSegments} segments on a coordinate plane.`,
504
+ srMultipleSegmentIndividualLabel: ({
505
+ point1X,
506
+ point1Y,
507
+ point2X,
508
+ point2Y,
509
+ indexOfSegment
510
+ }) => `Segment ${indexOfSegment}: Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`,
511
+ srSingleSegmentLabel: ({
512
+ point1X,
513
+ point1Y,
514
+ point2X,
515
+ point2Y
516
+ }) => `Endpoint 1 at ${point1X} comma ${point1Y}. Endpoint 2 at ${point2X} comma ${point2Y}.`,
517
+ srSegmentLength: ({
518
+ length
519
+ }) => `Segment length ${length} units.`,
520
+ srSingleSegmentGraphEndpointAriaLabel: ({
521
+ endpointNumber,
522
+ x,
523
+ y
524
+ }) => `Endpoint ${endpointNumber} at ${x} comma ${y}.`,
525
+ srMultipleSegmentGraphEndpointAriaLabel: ({
526
+ endpointNumber,
527
+ x,
528
+ y,
529
+ indexOfSegment
530
+ }) => `Endpoint ${endpointNumber} on segment ${indexOfSegment} at ${x} comma ${y}.`,
531
+ srSegmentGrabHandle: ({
532
+ point1X,
533
+ point1Y,
534
+ point2X,
535
+ point2Y
536
+ }) => `Segment from ${point1X} comma ${point1Y} to ${point2X} comma ${point2Y}.`,
715
537
  srLinearSystemGraph: "Two lines on a coordinate plane.",
716
- srLinearSystemPoints: _ref51 => {
717
- let {
718
- lineNumber,
719
- point1X,
720
- point1Y,
721
- point2X,
722
- point2Y
723
- } = _ref51;
724
- return `Line ${lineNumber} has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`;
725
- },
726
- srLinearSystemPoint: _ref52 => {
727
- let {
728
- lineNumber,
729
- pointSequence,
730
- x,
731
- y
732
- } = _ref52;
733
- return `Point ${pointSequence} on line ${lineNumber} at ${x} comma ${y}.`;
734
- },
735
- srLinearSystemGrabHandle: _ref53 => {
736
- let {
737
- lineNumber,
738
- point1X,
739
- point1Y,
740
- point2X,
741
- point2Y
742
- } = _ref53;
743
- return `Line ${lineNumber} going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`;
744
- },
745
- srLinearSystemIntersection: _ref54 => {
746
- let {
747
- x,
748
- y
749
- } = _ref54;
750
- return `Line 1 and line 2 intersect at point ${x} comma ${y}.`;
751
- },
538
+ srLinearSystemPoints: ({
539
+ lineNumber,
540
+ point1X,
541
+ point1Y,
542
+ point2X,
543
+ point2Y
544
+ }) => `Line ${lineNumber} has two points, point 1 at ${point1X} comma ${point1Y} and point 2 at ${point2X} comma ${point2Y}.`,
545
+ srLinearSystemPoint: ({
546
+ lineNumber,
547
+ pointSequence,
548
+ x,
549
+ y
550
+ }) => `Point ${pointSequence} on line ${lineNumber} at ${x} comma ${y}.`,
551
+ srLinearSystemGrabHandle: ({
552
+ lineNumber,
553
+ point1X,
554
+ point1Y,
555
+ point2X,
556
+ point2Y
557
+ }) => `Line ${lineNumber} going through point ${point1X} comma ${point1Y} and point ${point2X} comma ${point2Y}.`,
558
+ srLinearSystemIntersection: ({
559
+ x,
560
+ y
561
+ }) => `Line 1 and line 2 intersect at point ${x} comma ${y}.`,
752
562
  srLinearSystemParallel: "Line 1 and line 2 are parallel.",
753
563
  srRayGraph: "A ray on a coordinate plane.",
754
- srRayPoints: _ref55 => {
755
- let {
756
- point1X,
757
- point1Y,
758
- point2X,
759
- point2Y
760
- } = _ref55;
761
- return `The endpoint is at ${point1X} comma ${point1Y} and the ray goes through point ${point2X} comma ${point2Y}.`;
762
- },
763
- srRayGrabHandle: _ref56 => {
764
- let {
765
- point1X,
766
- point1Y,
767
- point2X,
768
- point2Y
769
- } = _ref56;
770
- return `Ray with endpoint ${point1X} comma ${point1Y} going through point ${point2X} comma ${point2Y}.`;
771
- },
772
- srRayEndpoint: _ref57 => {
773
- let {
774
- x,
775
- y
776
- } = _ref57;
777
- return `Endpoint at ${x} comma ${y}.`;
778
- },
779
- srRayTerminalPoint: _ref58 => {
780
- let {
781
- x,
782
- y
783
- } = _ref58;
784
- return `Through point at ${x} comma ${y}.`;
785
- },
564
+ srRayPoints: ({
565
+ point1X,
566
+ point1Y,
567
+ point2X,
568
+ point2Y
569
+ }) => `The endpoint is at ${point1X} comma ${point1Y} and the ray goes through point ${point2X} comma ${point2Y}.`,
570
+ srRayGrabHandle: ({
571
+ point1X,
572
+ point1Y,
573
+ point2X,
574
+ point2Y
575
+ }) => `Ray with endpoint ${point1X} comma ${point1Y} going through point ${point2X} comma ${point2Y}.`,
576
+ srRayEndpoint: ({
577
+ x,
578
+ y
579
+ }) => `Endpoint at ${x} comma ${y}.`,
580
+ srRayTerminalPoint: ({
581
+ x,
582
+ y
583
+ }) => `Through point at ${x} comma ${y}.`,
786
584
  srQuadraticGraph: "A parabola on a 4-quadrant coordinate plane.",
787
585
  srQuadraticFaceUp: "The parabola opens upward.",
788
586
  srQuadraticFaceDown: "The parabola opens downward.",
789
587
  srQuadraticGraphVertexOrigin: "Vertex is at the origin.",
790
588
  srQuadraticGraphVertexXAxis: "Vertex is on the X-axis.",
791
589
  srQuadraticGraphVertexYAxis: "Vertex is on the Y-axis.",
792
- srQuadraticGraphVertexQuadrant: _ref59 => {
793
- let {
794
- quadrant
795
- } = _ref59;
796
- return `Vertex is in quadrant ${quadrant}.`;
797
- },
798
- srQuadraticTwoXIntercepts: _ref60 => {
799
- let {
800
- intercept1,
801
- intercept2
802
- } = _ref60;
803
- return `The X-intercepts are at ${intercept1} comma 0 and ${intercept2} comma 0.`;
804
- },
805
- srQuadraticOneXIntercept: _ref61 => {
806
- let {
807
- intercept
808
- } = _ref61;
809
- return `The X-intercept is at ${intercept} comma 0.`;
810
- },
811
- srQuadraticYIntercept: _ref62 => {
812
- let {
813
- intercept
814
- } = _ref62;
815
- return `The Y-intercept is at 0 comma ${intercept}.`;
816
- },
817
- srQuadraticPointOrigin: _ref63 => {
818
- let {
819
- pointNumber
820
- } = _ref63;
821
- return `Point ${pointNumber} on parabola at the origin.`;
822
- },
823
- srQuadraticPointAxis: _ref64 => {
824
- let {
825
- pointNumber,
826
- x,
827
- y
828
- } = _ref64;
829
- return `Point ${pointNumber} on parabola at ${x} comma ${y}.`;
830
- },
831
- srQuadraticPointQuadrant: _ref65 => {
832
- let {
833
- pointNumber,
834
- x,
835
- y,
836
- quadrant
837
- } = _ref65;
838
- return `Point ${pointNumber} on parabola in quadrant ${quadrant} at ${x} comma ${y}.`;
839
- },
840
- srQuadraticInteractiveElements: _ref66 => {
841
- let {
842
- point1X,
843
- point1Y,
844
- point2X,
845
- point2Y,
846
- point3X,
847
- point3Y
848
- } = _ref66;
849
- return `Parabola with points at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, and ${point3X} comma ${point3Y}.`;
850
- },
590
+ srQuadraticGraphVertexQuadrant: ({
591
+ quadrant
592
+ }) => `Vertex is in quadrant ${quadrant}.`,
593
+ srQuadraticTwoXIntercepts: ({
594
+ intercept1,
595
+ intercept2
596
+ }) => `The X-intercepts are at ${intercept1} comma 0 and ${intercept2} comma 0.`,
597
+ srQuadraticOneXIntercept: ({
598
+ intercept
599
+ }) => `The X-intercept is at ${intercept} comma 0.`,
600
+ srQuadraticYIntercept: ({
601
+ intercept
602
+ }) => `The Y-intercept is at 0 comma ${intercept}.`,
603
+ srQuadraticPointOrigin: ({
604
+ pointNumber
605
+ }) => `Point ${pointNumber} on parabola at the origin.`,
606
+ srQuadraticPointAxis: ({
607
+ pointNumber,
608
+ x,
609
+ y
610
+ }) => `Point ${pointNumber} on parabola at ${x} comma ${y}.`,
611
+ srQuadraticPointQuadrant: ({
612
+ pointNumber,
613
+ x,
614
+ y,
615
+ quadrant
616
+ }) => `Point ${pointNumber} on parabola in quadrant ${quadrant} at ${x} comma ${y}.`,
617
+ srQuadraticInteractiveElements: ({
618
+ point1X,
619
+ point1Y,
620
+ point2X,
621
+ point2Y,
622
+ point3X,
623
+ point3Y
624
+ }) => `Parabola with points at ${point1X} comma ${point1Y}, ${point2X} comma ${point2Y}, and ${point3X} comma ${point3Y}.`,
851
625
  srPolygonGraph: "A polygon.",
852
626
  srPolygonGraphCoordinatePlane: "A polygon on a coordinate plane.",
853
- srPolygonGraphPointsNum: _ref67 => {
854
- let {
855
- num
856
- } = _ref67;
857
- return `The polygon has ${num} points.`;
858
- },
627
+ srPolygonGraphPointsNum: ({
628
+ num
629
+ }) => `The polygon has ${num} points.`,
859
630
  srPolygonGraphPointsOne: "The polygon has 1 point.",
860
- srPolygonElementsNum: _ref68 => {
861
- let {
862
- num
863
- } = _ref68;
864
- return `A polygon with ${num} points.`;
865
- },
631
+ srPolygonElementsNum: ({
632
+ num
633
+ }) => `A polygon with ${num} points.`,
866
634
  srPolygonElementsOne: "A polygon with 1 point.",
867
- srPolygonPointAngleApprox: _ref69 => {
868
- let {
869
- angle
870
- } = _ref69;
871
- return `Angle approximately equal to ${angle} degrees.`;
872
- },
873
- srPolygonPointAngle: _ref70 => {
874
- let {
875
- angle
876
- } = _ref70;
877
- return `Angle equal to ${angle} degrees.`;
878
- },
879
- srPolygonSideLength: _ref71 => {
880
- let {
881
- pointNum,
882
- length
883
- } = _ref71;
884
- return `A line segment, length equal to ${length} units, connects to point ${pointNum}.`;
885
- },
886
- srPolygonSideLengthApprox: _ref72 => {
887
- let {
888
- pointNum,
889
- length
890
- } = _ref72;
891
- return `A line segment, length approximately equal to ${length} units, connects to point ${pointNum}.`;
892
- },
635
+ srPolygonPointAngleApprox: ({
636
+ angle
637
+ }) => `Angle approximately equal to ${angle} degrees.`,
638
+ srPolygonPointAngle: ({
639
+ angle
640
+ }) => `Angle equal to ${angle} degrees.`,
641
+ srPolygonSideLength: ({
642
+ pointNum,
643
+ length
644
+ }) => `A line segment, length equal to ${length} units, connects to point ${pointNum}.`,
645
+ srPolygonSideLengthApprox: ({
646
+ pointNum,
647
+ length
648
+ }) => `A line segment, length approximately equal to ${length} units, connects to point ${pointNum}.`,
893
649
  srUnlimitedPolygonEmpty: "An empty coordinate plane.",
894
650
  srSinusoidGraph: "A sinusoid function on a coordinate plane.",
895
- srSinusoidRootPoint: _ref73 => {
896
- let {
897
- x,
898
- y
899
- } = _ref73;
900
- return `Midline intersection at ${x} comma ${y}.`;
901
- },
902
- srSinusoidMaxPoint: _ref74 => {
903
- let {
904
- x,
905
- y
906
- } = _ref74;
907
- return `Maximum point at ${x} comma ${y}.`;
908
- },
909
- srSinusoidMinPoint: _ref75 => {
910
- let {
911
- x,
912
- y
913
- } = _ref75;
914
- return `Minimum point at ${x} comma ${y}.`;
915
- },
916
- srSinusoidFlatPoint: _ref76 => {
917
- let {
918
- x,
919
- y
920
- } = _ref76;
921
- return `Line through point at ${x} comma ${y}.`;
922
- },
923
- srSinusoidDescription: _ref77 => {
924
- let {
925
- minValue,
926
- maxValue,
927
- cycleStart,
928
- cycleEnd
929
- } = _ref77;
930
- return `The graph shows a wave with a minimum value of ${minValue} and a maximum value of ${maxValue}. The wave completes a full cycle from ${cycleStart} to ${cycleEnd}.`;
931
- },
932
- srSinusoidInteractiveElements: _ref78 => {
933
- let {
934
- point1X,
935
- point1Y,
936
- point2X,
937
- point2Y
938
- } = _ref78;
939
- return `Sinusoid graph with midline intersection point at ${point1X} comma ${point1Y} and extremum point at ${point2X} comma ${point2Y}.`;
940
- }
941
- // The above strings are used for interactive graph SR descriptions.
651
+ srSinusoidRootPoint: ({
652
+ x,
653
+ y
654
+ }) => `Midline intersection at ${x} comma ${y}.`,
655
+ srSinusoidMaxPoint: ({
656
+ x,
657
+ y
658
+ }) => `Maximum point at ${x} comma ${y}.`,
659
+ srSinusoidMinPoint: ({
660
+ x,
661
+ y
662
+ }) => `Minimum point at ${x} comma ${y}.`,
663
+ srSinusoidFlatPoint: ({
664
+ x,
665
+ y
666
+ }) => `Line through point at ${x} comma ${y}.`,
667
+ srSinusoidDescription: ({
668
+ minValue,
669
+ maxValue,
670
+ cycleStart,
671
+ cycleEnd
672
+ }) => `The graph shows a wave with a minimum value of ${minValue} and a maximum value of ${maxValue}. The wave completes a full cycle from ${cycleStart} to ${cycleEnd}.`,
673
+ srSinusoidInteractiveElements: ({
674
+ point1X,
675
+ point1Y,
676
+ point2X,
677
+ point2Y
678
+ }) => `Sinusoid graph with midline intersection point at ${point1X} comma ${point1Y} and extremum point at ${point2X} comma ${point2Y}.`
942
679
  };
943
-
944
- // This type helps us make sure all error codes are mapped to strings
945
-
946
- /**
947
- * Map an error string to a PerseusStrings key
948
- * that we can use to get the translated error message
949
- */
950
680
  const errorToString = {
951
681
  MISSING_PERCENT_ERROR: "MISSING_PERCENT_ERROR",
952
682
  NEEDS_TO_BE_SIMPLIFIED_ERROR: "NEEDS_TO_BE_SIMPLFIED_ERROR",
@@ -960,18 +690,12 @@ const errorToString = {
960
690
  NOT_NONE_ABOVE_ERROR: "notNoneOfTheAbove",
961
691
  FILL_ALL_CELLS_ERROR: "fillAllCells"
962
692
  };
963
- function mapErrorToString(
964
- // the string representing an error code
965
- err,
966
- // the translated Perseus strings
967
- translatedStrings) {
693
+ function mapErrorToString(err, translatedStrings) {
968
694
  if (!err) {
969
695
  return err;
970
696
  }
971
697
  return translatedStrings[errorToString[err]] || err;
972
698
  }
973
699
 
974
- exports.mapErrorToString = mapErrorToString;
975
- exports.mockStrings = mockStrings;
976
- exports.strings = strings;
700
+ export { mapErrorToString, mockStrings, strings };
977
701
  //# sourceMappingURL=strings.js.map