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
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

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) {