feat: separate i18n dict pages

This commit is contained in:
2026-09-27 16:24:31 +05:00
parent 7a3498c173
commit 9776e1d325
12 changed files with 613 additions and 357 deletions
+15 -1
View File
@@ -34,7 +34,7 @@ function selectOptions(
describe("полнота словарей для нового registry", () => {
it("у каждой страницы есть перевод ru с непустыми title/description", () => {
for (const page of PAGES) {
const strings = ru.tools[page.slug];
const strings = ru.pages?.[page.slug];
expect(strings, `нет перевода ru для ${page.slug}`).toBeDefined();
expect(strings?.title, `${page.slug}: title`).toBeTruthy();
expect(strings?.description, `${page.slug}: description`).toBeTruthy();
@@ -75,6 +75,20 @@ describe("полнота словарей для нового registry", () => {
}
});
it("в секции pages нет лишних страниц", () => {
const slugs = new Set(PAGES.map((page) => page.slug));
for (const [locale, dict] of [
["ru", ru],
["en", en],
] as const) {
for (const key of Object.keys(dict.pages ?? {})) {
expect(slugs.has(key), `лишняя страница в ${locale}: ${key}`).toBe(
true,
);
}
}
});
it("в словарях нет ключей без записи в реестре", () => {
const known = new Set([
...TOOLS.map((tool) => tool.id),