Remove use of String.replaceAll for unit tests
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
0c749742ab
commit
383b3b6a78
@ -44,7 +44,7 @@ function setI18nLanguage(lang: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setLanguageInDOM(lang: string): void {
|
function setLanguageInDOM(lang: string): void {
|
||||||
const fixedLang = lang.replaceAll("_", "-");
|
const fixedLang = lang.replace(/_/g, "-");
|
||||||
const html = document.documentElement;
|
const html = document.documentElement;
|
||||||
const documentLang = html.getAttribute("lang");
|
const documentLang = html.getAttribute("lang");
|
||||||
if (documentLang !== fixedLang) {
|
if (documentLang !== fixedLang) {
|
||||||
|
Loading…
Reference in New Issue
Block a user