mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-18 16:12:11 +00:00
feat(i18n): complete v1.34.1 locale reconciliation
This commit is contained in:
1 parent
163aa73e01
commit
b41b32d472
6 files changed
+60
-36
No files matched your search
@@ -95,11 +95,7 @@ function readCatalog(locale: (typeof LOCALES)[number]): Catalog {
|
||||
function resolveLeaf(catalog: Catalog, dottedKey: string): string | undefined {
|
||||
let value: unknown = catalog;
|
||||
for (const segment of dottedKey.split(".")) {
|
||||
if (
|
||||
typeof value !== "object" ||
|
||||
value === null ||
|
||||
!(segment in value)
|
||||
) {
|
||||
if (typeof value !== "object" || value === null || !(segment in value)) {
|
||||
return undefined;
|
||||
}
|
||||
value = (value as Record<string, unknown>)[segment];
|
||||
@@ -123,7 +119,7 @@ describe("v1.34.1 locale reconciliation", () => {
|
||||
const source = readFileSync(join(ROOT, relativePath), "utf8");
|
||||
for (const key of keys) {
|
||||
expect(source, `${relativePath} must translate ${key}`).toMatch(
|
||||
new RegExp(`\\bt\\(["']${key.replaceAll(".", "\\.")}["']`),
|
||||
new RegExp(`\\bt\\(\\s*["']${key.replaceAll(".", "\\.")}["']`),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,13 +360,11 @@ describe("i18n locale file integrity", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("Health Score transparency keys resolve in every locale", () => {
|
||||
it("retained Health Score transparency keys resolve in every locale", () => {
|
||||
const transparencyKeys = [
|
||||
"insights.healthScore.algorithmChanged",
|
||||
"insights.healthScore.method",
|
||||
"insights.healthScore.composition",
|
||||
"insights.healthScore.bandSetter",
|
||||
"insights.healthScore.versionAndNoise",
|
||||
"insights.healthScore.methodVersion",
|
||||
"insights.healthScore.observed",
|
||||
"insights.healthScore.reference",
|
||||
"insights.healthScore.source",
|
||||
|
||||
Reference in new issue
Block a user