Skip to content
Draft
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
5d7c396
Initial implementation of Locale framework, with updates to asyncLoad…
dpvc Dec 23, 2025
8b4913a
Remove unneeded Locale.test.js file
dpvc Dec 31, 2025
42f772e
Update test framework to copy locale and other assets
dpvc Jan 16, 2026
32eb9fc
Fix prettier issues (now that we are doing that in tests)
dpvc Mar 29, 2026
15d8eb2
Rebase refactor/l10n_texerrors as single commit
dpvc May 15, 2026
73ade9b
move all error files
zorkow May 3, 2026
1cc0857
merge error fixes
zorkow May 3, 2026
4820791
fix style issues
zorkow May 3, 2026
da89b40
missing error
zorkow May 3, 2026
c093fc9
fix up json files
zorkow May 3, 2026
b41d202
get all tests working for majority of packages
zorkow May 3, 2026
f6a6557
fix ams problems
zorkow May 3, 2026
b647594
fix for errors without locales from third party libraries
zorkow May 4, 2026
5878675
fix many locales
zorkow May 4, 2026
c043818
fix missing quotes
zorkow May 4, 2026
0566723
correct braket error
zorkow May 4, 2026
d69a418
correct physics error
zorkow May 4, 2026
f782ff9
fix column parser
zorkow May 4, 2026
d2a6952
fix remaining tex errors
zorkow May 4, 2026
854c339
ensure all locales are copied
zorkow May 4, 2026
6ad39a9
more missing quotes
zorkow May 4, 2026
8dc5441
add missing locales
zorkow May 4, 2026
efca1fd
refactors the components into a loading structure
zorkow May 6, 2026
1567078
add missing copyright messages to files
zorkow May 6, 2026
3798f57
prettier and linting
zorkow May 6, 2026
d60b0b0
localize the internal error
zorkow May 6, 2026
10f8b02
correctly loads and uses default locale
zorkow May 6, 2026
656ed9a
import/export components when needed locally
zorkow May 6, 2026
92a499e
fix tests for missing locale files
zorkow May 6, 2026
f480c78
sorts all the english locales
zorkow May 6, 2026
b2e1d10
first german locale file
zorkow May 8, 2026
04049b4
all german locale files
zorkow May 8, 2026
1f66258
rename locales directories
zorkow May 11, 2026
a018a60
rename all imports
zorkow May 11, 2026
1c423ce
fix scripts and tests
zorkow May 11, 2026
e56940b
Add missing tests for Locale.ts
zorkow May 11, 2026
382b09b
Add an excludes option to the copy configuration block for components.
dpvc May 16, 2026
9a18e3d
Copy __locales__ for all components, and improve default json loading.
dpvc May 17, 2026
7c35e7f
Fix formatting for prettier
dpvc May 18, 2026
71b8965
incorporate review comments
zorkow May 19, 2026
99aaa50
Merge branch 'feature/locale_plus' into feature/locale_plus2
zorkow May 19, 2026
86bd7b6
Merge branch 'feature/locale_plus2' into feature/locale_de
zorkow May 19, 2026
30e520b
add copy commands to all config files
zorkow May 15, 2026
6235c8e
remove reference to base locale from top level
zorkow May 15, 2026
46b2b9b
remove duplicates from locales
zorkow May 15, 2026
5baca16
Merge branch 'feature/locale_de' into feature/locale_plus3
zorkow May 19, 2026
1e350e3
Merge pull request #1472 from mathjax/feature/locale_de
zorkow May 19, 2026
736bb7e
Merge pull request #1473 from mathjax/feature/locale_plus3
zorkow May 19, 2026
fa74507
Merge pull request #1470 from mathjax/feature/locale_plus
zorkow May 19, 2026
11365b8
Merge pull request #1471 from mathjax/feature/locale_plus2
zorkow May 19, 2026
6f617ae
Merge branch 'feature/locale' into feature/copy-excludes
dpvc May 19, 2026
81bb6bf
Fixed typo in jsdoc.
dpvc May 19, 2026
71ceba6
Merge remote-tracking branch 'origin/feature/copy-excludes' into feat…
dpvc May 19, 2026
0935d37
Merge pull request #1475 from mathjax/feature/copy-excludes
dpvc May 19, 2026
5b1abbf
Merge branch 'feature/locale' into feature/copy-locales
dpvc May 19, 2026
f71899e
Merge pull request #1476 from mathjax/feature/copy-locales
dpvc May 19, 2026
bf6db9e
Remove unneeded copy blocks from braket and texhtml component config …
dpvc May 19, 2026
a09a1fa
Fix braket and texhtml loading wrong locale component files
dpvc May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ jobs:
- name: Compile MathJax
run: |
pnpm -s mjs:compile
components/bin/makeAll --mjs --terse --build components/mjs
pnpm -s copy:assets mjs
components/bin/makeAll --mjs --terse --build --copy components/mjs
pnpm -s cjs:compile
pnpm -s cjs:components:src:build
components/bin/makeAll --cjs --terse --build components/cjs
pnpm -s copy:assets cjs
components/bin/makeAll --cjs --terse --build --copy components/cjs
pnpm -s copy:pkg cjs

- name: Build tests
Expand Down
2 changes: 2 additions & 0 deletions components/json.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module.exports.json = async function (file) {return require(file)};
module.exports.require = require;
17 changes: 13 additions & 4 deletions components/mjs/core/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import './locale.js';
import './lib/core.js';

import {HTMLHandler} from '#js/handlers/html/HTMLHandler.js';
import {browserAdaptor} from '#js/adaptors/browserAdaptor.js';
import {Package} from '#js/components/package.js';

if (MathJax.startup) {
MathJax.startup.registerConstructor('HTMLHandler', HTMLHandler);
Expand All @@ -11,9 +13,16 @@ if (MathJax.startup) {
}
if (MathJax.loader) {
const config = MathJax.config.loader;
MathJax._.mathjax.mathjax.asyncLoad = (
(name) => name.substring(0, 5) === 'node:'
const {mathjax} = MathJax._.mathjax;
mathjax.asyncLoad = (name => {
if (name.match(/\.json$/)) {
if (name.charAt(0) === '[') {
name = Package.resolvePath(name);
}
return (config.json || mathjax.json)(name).then((data) => data.default ?? data);
}
return name.substring(0, 5) === 'node:'
? config.require(name)
: MathJax.loader.load(name).then(result => result[0])
);
: MathJax.loader.load(name).then(result => result[0]);
});
}
4 changes: 4 additions & 0 deletions components/mjs/core/locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import {Locale} from '#js/util/Locale.js';

Locale.isComponent = true;

12 changes: 12 additions & 0 deletions components/mjs/input/tex/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@
],
"excludeSubdirs": true
},
"copy": [
{
"to": "[bundle]/input/tex",
"from": "[ts]/input/tex",
"copy": ["__locales__"]
},
{
"to": "[bundle]/input/tex/extensions/base",
"from": "[ts]/input/tex/base",
"copy": ["__locales__"]
}
],
"webpack": {
"name": "input/tex",
"libs": [
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/ams/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/ams",
"component": "input/tex/extensions/ams",
"targets": ["input/tex/ams"]
"targets": [
"input/tex/ams"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/ams",
"from": "[ts]/input/tex/ams",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/ams",
Expand Down
6 changes: 6 additions & 0 deletions components/mjs/input/tex/extensions/bbox/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@

{
"build": {
"id": "[tex]/bbox",
"component": "input/tex/extensions/bbox",
"targets": ["input/tex/bbox"]
},
"copy": {
"to": "[bundle]/input/tex/extensions/bbox",
"from": "[ts]/input/tex/bbox",
"copy": ["__locales__"]
},
"webpack": {
"name": "input/tex/extensions/bbox",
"libs": [
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/begingroup/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/begingroup",
"component": "input/tex/extensions/begingroup",
"targets": ["input/tex/begingroup"]
"targets": [
"input/tex/begingroup"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/begingroup",
"from": "[ts]/input/tex/begingroup",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/begingroup",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/braket/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/braket",
"component": "input/tex/extensions/braket",
"targets": ["input/tex/braket"]
"targets": [
"input/tex/braket"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/braket",
"from": "[ts]/input/tex/braket",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/braket",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/bussproofs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/bussproofs",
"component": "input/tex/extensions/bussproofs",
"targets": ["input/tex/bussproofs"]
"targets": [
"input/tex/bussproofs"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/bussproofs",
"from": "[ts]/input/tex/bussproofs",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/bussproofs",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/cases/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/cases",
"component": "input/tex/extensions/cases",
"targets": ["input/tex/cases"]
"targets": [
"input/tex/cases"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/cases",
"from": "[ts]/input/tex/cases",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/cases",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/color/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/color",
"component": "input/tex/extensions/color",
"targets": ["input/tex/color"]
"targets": [
"input/tex/color"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/color",
"from": "[ts]/input/tex/color",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/color",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/colortbl/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/colortbl",
"component": "input/tex/extensions/colortbl",
"targets": ["input/tex/colortbl"]
"targets": [
"input/tex/colortbl"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/colortbl",
"from": "[ts]/input/tex/colortbl",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/colortbl",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/empheq/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/empheq",
"component": "input/tex/extensions/empheq",
"targets": ["input/tex/empheq"]
"targets": [
"input/tex/empheq"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/empheq",
"from": "[ts]/input/tex/empheq",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/empheq",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/extpfeil/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/extpfeil",
"component": "input/tex/extensions/extpfeil",
"targets": ["input/tex/extpfeil"]
"targets": [
"input/tex/extpfeil"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/extpfeil",
"from": "[ts]/input/tex/extpfeil",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/extpfeil",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/html/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/html",
"component": "input/tex/extensions/html",
"targets": ["input/tex/html"]
"targets": [
"input/tex/html"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/html",
"from": "[ts]/input/tex/html",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/html",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/mathtools/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/mathtools",
"component": "input/tex/extensions/mathtools",
"targets": ["input/tex/mathtools"]
"targets": [
"input/tex/mathtools"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/mathtools",
"from": "[ts]/input/tex/mathtools",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/mathtools",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/newcommand/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/newcommand",
"component": "input/tex/extensions/newcommand",
"targets": ["input/tex/newcommand"]
"targets": [
"input/tex/newcommand"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/newcommand",
"from": "[ts]/input/tex/newcommand",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/newcommand",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/physics/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/physics",
"component": "input/tex/extensions/physics",
"targets": ["input/tex/physics"]
"targets": [
"input/tex/physics"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/physics",
"from": "[ts]/input/tex/physics",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/physics",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/require/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/require",
"component": "input/tex/extensions/require",
"targets": ["input/tex/require"]
"targets": [
"input/tex/require"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/require",
"from": "[ts]/input/tex/require",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/require",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/setoptions/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/setoptions",
"component": "input/tex/extensions/setoptions",
"targets": ["input/tex/setoptions"]
"targets": [
"input/tex/setoptions"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/setoptions",
"from": "[ts]/input/tex/setoptions",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/setoptions",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/texhtml/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/texhtml",
"component": "input/tex/extensions/texhtml",
"targets": ["input/tex/texhtml"]
"targets": [
"input/tex/texhtml"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/texhtml",
"from": "[ts]/input/tex/texhtml",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/texhtml",
Expand Down
11 changes: 10 additions & 1 deletion components/mjs/input/tex/extensions/textmacros/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
"build": {
"id": "[tex]/textmacros",
"component": "input/tex/extensions/textmacros",
"targets": ["input/tex/textmacros"]
"targets": [
"input/tex/textmacros"
]
},
"copy": {
"to": "[bundle]/input/tex/extensions/textmacros",
"from": "[ts]/input/tex/textmacros",
"copy": [
"__locales__"
]
},
"webpack": {
"name": "input/tex/extensions/textmacros",
Expand Down
Loading
Loading