Commit d90950d
committed
fix(irish): use the standard sampleTexts path for default example text
Every other language gets its example text from the sampleTexts map in
dynamic_meta.js, applied by updateMeta(). Irish was never added there, so
updateMeta() assigned sampleTexts["Irish"] === undefined to the textarea.
The previous workaround added a separate DEFAULT_EXAMPLE_TEXT map in
main.js, but it ran before updateMeta() in the same handler, so updateMeta()
overwrote it moments later. It also gated on localStorage rather than the
textarea, so it could not repopulate an emptied form.
Fix the data instead of working around it:
- Add Irish to sampleTexts (an Irish passage about the IPA, matching the
theme of the other languages' samples).
- Add Irish to translatedMeta so the meta description no longer renders
"undefined" for Irish.
- Remove the DEFAULT_EXAMPLE_TEXT block from main.js.
Verified in a real browser (Playwright): Irish shows its sample on first
load and again after clearing the form and reselecting the language;
German is unaffected. Full e2e suite: 21 passed, 5 skipped. Golden: 81 pass.1 parent 9e5a6bc commit d90950d
2 files changed
Lines changed: 5 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
680 | 680 | | |
681 | 681 | | |
682 | 682 | | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | 683 | | |
696 | 684 | | |
697 | 685 | | |
| |||
844 | 832 | | |
845 | 833 | | |
846 | 834 | | |
847 | | - | |
848 | | - | |
| 835 | + | |
| 836 | + | |
849 | 837 | | |
850 | 838 | | |
851 | 839 | | |
| |||
0 commit comments