Fix locale test JSON parsing with UTF-8 BOM support
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { readJsonFile } from "./helpers/readJsonFile";
|
||||
|
||||
const root = process.cwd();
|
||||
const componentPath = join(root, "src/components/displays/buttons/ActionSettingsWheelButton.vue");
|
||||
@@ -8,7 +9,7 @@ const activeLocales = ["da", "en", "sv", "de", "no"];
|
||||
const translationCallPattern = /(?:\$t|\bt)\(\s*(["'])([^"'\\]*(?:\\.[^"'\\]*)*)\1/g;
|
||||
|
||||
const readLocale = (locale) => {
|
||||
return JSON.parse(readFileSync(join(root, `src/i18n/locales/${locale}.json`), "utf8"));
|
||||
return readJsonFile(join(root, `src/i18n/locales/${locale}.json`));
|
||||
};
|
||||
|
||||
const extractLiteralTranslationKeys = (source) => {
|
||||
|
||||
Reference in New Issue
Block a user