Skip to content

Commit

Permalink
Just check against the current document lang
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Sep 1, 2023
1 parent 02ab688 commit 56fd48c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 0 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"access": "public"
},
"dependencies": {
"@brightspace-ui/intl": "^3",
"@open-wc/testing": "^3",
"@rollup/plugin-node-resolve": "^15",
"@web/config-loader": "^0.2",
Expand Down
8 changes: 2 additions & 6 deletions src/browser/reset.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { sendMouse, setViewport } from '@web/test-runner-commands';
import { getDocumentLocaleSettings } from '@brightspace-ui/intl/lib/common.js';
import { nextFrame } from '@open-wc/testing';

const DEFAULT_LANG = 'en',
DEFAULT_MATHJAX_RENDER_LATEX = false,
DEFAULT_VIEWPORT_HEIGHT = 800,
DEFAULT_VIEWPORT_WIDTH = 800;

const documentLocaleSettings = getDocumentLocaleSettings();

let
currentMathjaxRenderLatex = DEFAULT_MATHJAX_RENDER_LATEX,
currentRtl = false,
Expand Down Expand Up @@ -60,9 +57,8 @@ export async function reset(opts = {}) {
currentRtl = opts.rtl;
}

if (opts.lang !== documentLocaleSettings.language) {
document.documentElement.setAttribute('lang', opts.lang);
documentLocaleSettings.language = opts.lang;
if (document.documentElement.lang !== opts.lang) {
document.documentElement.lang = opts.lang;
awaitNextFrame = true;
}

Expand Down

0 comments on commit 56fd48c

Please sign in to comment.