Skip to content

Commit ee677fa

Browse files
committed
Ensure recompile after locale change
1 parent 8d49fb5 commit ee677fa

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ts/ui/menu/Menu.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -506,9 +506,7 @@ export class Menu {
506506
this.a11yVar<boolean>('subtitles'),
507507
this.a11yVar<boolean>('viewBraille'),
508508
this.a11yVar<boolean>('voicing'),
509-
this.a11yVar<string>('locale', value => {
510-
MathJax._.a11y.sre.Sre.setupEngine({locale: value as string});
511-
}),
509+
this.a11yVar<string>('locale', locale => this.setLocale(locale)),
512510
this.a11yVar<string>('speechRules', value => {
513511
const [domain, style] = value.split('-');
514512
this.document.options.sre.domain = domain;
@@ -982,6 +980,14 @@ export class Menu {
982980
this.rerender(STATE.COMPILED);
983981
}
984982

983+
/**
984+
* @param {string} locale The speech locale
985+
*/
986+
protected setLocale(locale: string) {
987+
this.document.options.sre.locale = locale;
988+
this.rerender(STATE.COMPILED);
989+
}
990+
985991
/**
986992
* @param {boolean} enrich True to enable enriched math, false to not
987993
*/

0 commit comments

Comments
 (0)