Skip to content

Commit 98619d6

Browse files
authored
Merge pull request #1546 from mathjax/fix/locale-warning
Remove locale warning that is no longer needed, and fix a prettier issue.
2 parents 8299ff2 + f8dc440 commit 98619d6

3 files changed

Lines changed: 4 additions & 13 deletions

File tree

ts/core/MathDocument.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { BitField, BitFieldClass } from '../util/BitField.js';
3838
import { PrioritizedList } from '../util/PrioritizedList.js';
3939
import { handleRetriesFor } from '../util/Retries.js';
4040
import { localize } from './__locales__/Component.js';
41-
import { Locale } from '../util/Locale.js';
4241
import { mathjax } from '../mathjax.js';
4342

4443
/*****************************************************************/
@@ -800,12 +799,6 @@ export abstract class AbstractMathDocument<N, T, D> implements MathDocument<
800799
* @class
801800
*/
802801
constructor(document: D, adaptor: DOMAdaptor<N, T, D>, options: OptionList) {
803-
if (!Locale.initialized) {
804-
// FIXME: add URL when we have one.
805-
console.error(
806-
'MathJax locales not loaded. You may receive cryptic error messages.'
807-
);
808-
}
809802
const CLASS = this.constructor as typeof AbstractMathDocument;
810803
this.document = document;
811804
this.options = userOptions(defaultOptions({}, CLASS.OPTIONS), options);

ts/core/MathItem.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,10 @@ export abstract class AbstractMathItem<N, T, D> implements MathItem<N, T, D> {
388388
/**
389389
* @override
390390
*/
391-
public convert(document: MathDocument<N, T, D>, end: number = STATE.LAST): MmlNode | N {
391+
public convert(
392+
document: MathDocument<N, T, D>,
393+
end: number = STATE.LAST
394+
): MmlNode | N {
392395
return document.renderActions.renderConvert(this, document, end);
393396
}
394397

ts/util/Locale.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ export const COMPONENT = 'locale';
4040
* The Locale class for handling localized messages
4141
*/
4242
export class Locale {
43-
/**
44-
* Whether setLocale() has been called or not.
45-
*/
46-
public static initialized: boolean = false;
4743
/**
4844
* The current locale
4945
*/
@@ -271,7 +267,6 @@ export class Locale {
271267
}
272268
}
273269
this.current = locale;
274-
this.initialized = true;
275270
const promises = [];
276271
for (const [component, [directory, loaded]] of Object.entries(
277272
this.locations

0 commit comments

Comments
 (0)