Remove use of String.replaceAll for unit tests

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-08-02 19:26:44 +02:00
parent 0c749742ab
commit 383b3b6a78

View File

@@ -44,7 +44,7 @@ function setI18nLanguage(lang: string): string {
}
function setLanguageInDOM(lang: string): void {
const fixedLang = lang.replaceAll("_", "-");
const fixedLang = lang.replace(/_/g, "-");
const html = document.documentElement;
const documentLang = html.getAttribute("lang");
if (documentLang !== fixedLang) {