@jjlmoya/utils-babies 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +67 -66
- package/src/category/i18n/de.ts +48 -0
- package/src/category/i18n/en.ts +10 -10
- package/src/category/i18n/fr.ts +10 -10
- package/src/category/i18n/id.ts +48 -0
- package/src/category/i18n/it.ts +48 -0
- package/src/category/i18n/ja.ts +48 -0
- package/src/category/i18n/ko.ts +48 -0
- package/src/category/i18n/nl.ts +48 -0
- package/src/category/i18n/pl.ts +48 -0
- package/src/category/i18n/pt.ts +48 -0
- package/src/category/i18n/ru.ts +48 -0
- package/src/category/i18n/sv.ts +48 -0
- package/src/category/i18n/tr.ts +48 -0
- package/src/category/i18n/zh.ts +48 -0
- package/src/category/index.ts +13 -1
- package/src/tests/faq_count.test.ts +1 -1
- package/src/tests/i18n_coverage.test.ts +36 -0
- package/src/tests/locale_completeness.test.ts +1 -1
- package/src/tests/schemas_fulfillment.test.ts +23 -0
- package/src/tests/seo_length.test.ts +1 -2
- package/src/tests/title_quality.test.ts +55 -0
- package/src/tool/baby-feeding-calculator/i18n/de.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/id.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/it.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/ja.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/ko.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/nl.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/pl.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/pt.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/ru.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/sv.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/tr.ts +162 -0
- package/src/tool/baby-feeding-calculator/i18n/zh.ts +162 -0
- package/src/tool/baby-feeding-calculator/index.ts +12 -0
- package/src/tool/baby-percentile-calculator/i18n/de.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/id.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/it.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/ja.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/ko.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/nl.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/pl.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/pt.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/ru.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/sv.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/tr.ts +245 -0
- package/src/tool/baby-percentile-calculator/i18n/zh.ts +245 -0
- package/src/tool/baby-percentile-calculator/index.ts +12 -0
- package/src/tool/baby-size-converter/i18n/de.ts +203 -0
- package/src/tool/baby-size-converter/i18n/fr.ts +1 -1
- package/src/tool/baby-size-converter/i18n/id.ts +203 -0
- package/src/tool/baby-size-converter/i18n/it.ts +203 -0
- package/src/tool/baby-size-converter/i18n/ja.ts +203 -0
- package/src/tool/baby-size-converter/i18n/ko.ts +203 -0
- package/src/tool/baby-size-converter/i18n/nl.ts +203 -0
- package/src/tool/baby-size-converter/i18n/pl.ts +203 -0
- package/src/tool/baby-size-converter/i18n/pt.ts +203 -0
- package/src/tool/baby-size-converter/i18n/ru.ts +203 -0
- package/src/tool/baby-size-converter/i18n/sv.ts +203 -0
- package/src/tool/baby-size-converter/i18n/tr.ts +203 -0
- package/src/tool/baby-size-converter/i18n/zh.ts +203 -0
- package/src/tool/baby-size-converter/index.ts +12 -0
- package/src/tool/fertile-days-estimator/i18n/de.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/id.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/it.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/ja.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/ko.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/nl.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/pl.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/pt.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/ru.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/sv.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/tr.ts +262 -0
- package/src/tool/fertile-days-estimator/i18n/zh.ts +262 -0
- package/src/tool/fertile-days-estimator/index.ts +12 -0
- package/src/tool/pregnancy-calculator/i18n/de.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/id.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/it.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/ja.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/ko.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/nl.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/pl.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/pt.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/ru.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/sv.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/tr.ts +467 -0
- package/src/tool/pregnancy-calculator/i18n/zh.ts +467 -0
- package/src/tool/pregnancy-calculator/index.ts +13 -1
- package/src/tool/vaccination-calendar/i18n/de.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/fr.ts +99 -95
- package/src/tool/vaccination-calendar/i18n/id.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/it.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/ja.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/ko.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/nl.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/pl.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/pt.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/ru.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/sv.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/tr.ts +194 -0
- package/src/tool/vaccination-calendar/i18n/zh.ts +194 -0
- package/src/tool/vaccination-calendar/index.ts +13 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CategoryLocaleContent } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const content: CategoryLocaleContent = {
|
|
4
|
+
slug: 'mladency',
|
|
5
|
+
title: 'Калькуляторы для Младенцев',
|
|
6
|
+
description: 'Инструменты и калькуляторы для ухода и мониторинга развития вашего ребенка.',
|
|
7
|
+
seo: [
|
|
8
|
+
{
|
|
9
|
+
type: 'summary',
|
|
10
|
+
title: 'Доступные Инструменты',
|
|
11
|
+
items: [
|
|
12
|
+
'Калькулятор кормления по возрасту и весу',
|
|
13
|
+
'Калькулятор процентилей роста (ВОЗ)',
|
|
14
|
+
'Конвертер размеров одежды по брендам',
|
|
15
|
+
'Оценка фертильных дней',
|
|
16
|
+
'Индивидуальный календарь прививок',
|
|
17
|
+
'Калькулятор беременности и срока гестации',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'title',
|
|
22
|
+
text: 'Мониторинг Развития вашего Ребенка',
|
|
23
|
+
level: 2,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'paragraph',
|
|
27
|
+
html: 'Детские калькуляторы помогут вам точно отслеживать рост и развитие вашего ребенка. От расчета порций молока в зависимости от возраста и веса до проверки процентилей ВОЗ — эти инструменты разработаны для предоставления полезной информации на каждом этапе.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'title',
|
|
31
|
+
text: 'Питание и Нутрициология',
|
|
32
|
+
level: 2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'paragraph',
|
|
36
|
+
html: 'Калькулятор кормления оценивает количество грудного молока или смеси, необходимое вашему ребенку в зависимости от возраста в днях, неделях или месяцах и текущего веса. Расчеты следуют стандартным педиатрическим рекомендациям для обеспечения правильного питания.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'title',
|
|
40
|
+
text: 'Рост и Процентили',
|
|
41
|
+
level: 2,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'paragraph',
|
|
45
|
+
html: 'Калькулятор процентилей использует справочные таблицы Всемирной организации здравоохранения (ВОЗ) для размещения веса, роста и ИМТ вашего ребенка в распределении детского населения. 50-й процентиль указывает на то, что ребенок находится на среднем уровне.',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CategoryLocaleContent } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const content: CategoryLocaleContent = {
|
|
4
|
+
slug: 'bebisar',
|
|
5
|
+
title: 'Babykalkylatorer',
|
|
6
|
+
description: 'Verktyg och kalkylatorer för vård och övervakning av din bebis utveckling.',
|
|
7
|
+
seo: [
|
|
8
|
+
{
|
|
9
|
+
type: 'summary',
|
|
10
|
+
title: 'Tillgängliga Verktyg',
|
|
11
|
+
items: [
|
|
12
|
+
'Matningskalkylator efter ålder och vikt',
|
|
13
|
+
'Groeicentil-kalkylator (WHO)',
|
|
14
|
+
'Klädstorleks-omvandlare per märke',
|
|
15
|
+
'Ägglossnings-simulator',
|
|
16
|
+
'Personligt vaccinationsschema',
|
|
17
|
+
'Kalkylator för graviditet och veckor',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'title',
|
|
22
|
+
text: 'Övervakning av din Bebis Utveckling',
|
|
23
|
+
level: 2,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'paragraph',
|
|
27
|
+
html: 'Babykalkylatorerna hjälper dig att noggrant följa ditt barns tillväxt och utveckling. Från att beräkna mjölkmatningar efter ålder och vikt till att kontrollera WHO-centiler, dessa verktyg är utformade för att ge användbar information i varje steg.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'title',
|
|
31
|
+
text: 'Matning och Nutrition',
|
|
32
|
+
level: 2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'paragraph',
|
|
36
|
+
html: 'Matningskalkylatorn uppskattar mängden bröstmjölk eller ersättning din bebis behöver baserat på ålder i dagar, veckor eller månader och aktuell vikt. Beräkningarna följer pediatriska riktlinjer för att säkerställa korrekt näring.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'title',
|
|
40
|
+
text: 'Tillväxt och Centiler',
|
|
41
|
+
level: 2,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'paragraph',
|
|
45
|
+
html: 'Centilkalkylatorn använder Världshälsoorganisationens (WHO) referensdiagram för att plotta din bebis vikt, längd och BMI inom barnpopulationens fördelning. En 50:e centil indikerar att bebisen är vid medianen.',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CategoryLocaleContent } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const content: CategoryLocaleContent = {
|
|
4
|
+
slug: 'bebekler',
|
|
5
|
+
title: 'Bebek Hesaplayıcıları',
|
|
6
|
+
description: 'Bebeğinizin gelişimini izlemek ve bakımı için araçlar ve hesaplayıcılar.',
|
|
7
|
+
seo: [
|
|
8
|
+
{
|
|
9
|
+
type: 'summary',
|
|
10
|
+
title: 'Mevcut Araçlar',
|
|
11
|
+
items: [
|
|
12
|
+
'Yaş ve ağırlığa göre beslenme hesaplayıcı',
|
|
13
|
+
'Büyüme persentil hesaplayıcı (WHO)',
|
|
14
|
+
'Markaya göre kıyafet bedeni dönüştürücü',
|
|
15
|
+
'Doğurganlık günleri tahmini',
|
|
16
|
+
'Kişiselleştirilmiş aşılama takvimi',
|
|
17
|
+
'Hamilelik ve gestasyon haftası hesaplayıcı',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'title',
|
|
22
|
+
text: 'Bebeğinizin Gelişimini İzleme',
|
|
23
|
+
level: 2,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'paragraph',
|
|
27
|
+
html: 'Bebek hesaplayıcıları, çocuğunuzun büyümesini ve gelişimini doğru bir şekilde takip etmenize yardımcı olur. Yaş ve ağırlığa göre süt miktarını hesaplamaktan WHO persentillerini kontrol etmeye kadar bu araçlar, her aşamada yararlı bilgiler sağlamak üzere tasarlanmıştır.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'title',
|
|
31
|
+
text: 'Beslenme ve Nutrisyon',
|
|
32
|
+
level: 2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'paragraph',
|
|
36
|
+
html: 'Beslenme hesaplayıcı, bebeğinizin gün, hafta veya ay cinsinden yaşına ve güncel ağırlığına göre ihtiyaç duyduğu anne sütü veya mama miktarını tahmin eder. Hesaplamalar, uygun beslenmeyi sağlamak için standart pediatrik yönergeleri takip eder.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'title',
|
|
40
|
+
text: 'Büyüme ve Persentiller',
|
|
41
|
+
level: 2,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'paragraph',
|
|
45
|
+
html: 'Persentil hesaplayıcı, bebeğinizin ağırlığını, boyunu ve BMI\'sini (Vücut Kitle İndeksi) çocuk popülasyonu dağılımı içinde konumlandırmak için Dünya Sağlık Örgütü (WHO) referans tablolarını kullanır. 50. persentil, bebeğin ortalamada olduğunu gösterir.',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CategoryLocaleContent } from '../../types';
|
|
2
|
+
|
|
3
|
+
export const content: CategoryLocaleContent = {
|
|
4
|
+
slug: 'babies',
|
|
5
|
+
title: '婴儿计算器',
|
|
6
|
+
description: '用于宝宝护理和发育监测的工具及计算器。',
|
|
7
|
+
seo: [
|
|
8
|
+
{
|
|
9
|
+
type: 'summary',
|
|
10
|
+
title: '可用工具',
|
|
11
|
+
items: [
|
|
12
|
+
'按月龄和体重计算喂养量',
|
|
13
|
+
'生长百分位数计算器 (WHO)',
|
|
14
|
+
'按品牌转换衣服尺码',
|
|
15
|
+
'排卵日估算',
|
|
16
|
+
'个性化疫苗接种时间表',
|
|
17
|
+
'怀孕和孕周计算器',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'title',
|
|
22
|
+
text: '监测宝宝的发育',
|
|
23
|
+
level: 2,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
type: 'paragraph',
|
|
27
|
+
html: '婴儿计算器帮助您准确追踪孩子的成长和发育。从根据月龄和体重计算奶量到查询世卫组织 (WHO) 百分位数,这些工具旨在为每个阶段提供有用的信息。',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
type: 'title',
|
|
31
|
+
text: '喂养与营养',
|
|
32
|
+
level: 2,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: 'paragraph',
|
|
36
|
+
html: '喂养计算器根据宝宝按天、周或月计算的月龄及当前体重估算所需的母乳或配方奶量。计算结果遵循标准儿科指南,以确保充足的营养。',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: 'title',
|
|
40
|
+
text: '成长与百分位数',
|
|
41
|
+
level: 2,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: 'paragraph',
|
|
45
|
+
html: '百分位数计算器使用世界卫生组织 (WHO) 的参考图表,将宝宝的体重、身高和 BMI 置于儿童人口分布中。第 50 百分位数表示宝宝处于平均水平。',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
package/src/category/index.ts
CHANGED
|
@@ -17,8 +17,20 @@ export const babiesCategory: BabiesCategoryEntry = {
|
|
|
17
17
|
pregnancyCalculator,
|
|
18
18
|
],
|
|
19
19
|
i18n: {
|
|
20
|
-
|
|
20
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
21
21
|
en: () => import('./i18n/en').then((m) => m.content),
|
|
22
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
22
23
|
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
24
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
25
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
26
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
27
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
28
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
29
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
30
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
31
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
32
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
33
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
34
|
+
zh: () => import('./i18n/zh').then((m) => m.content),
|
|
23
35
|
},
|
|
24
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import type * as DATA from '../data';
|
|
3
3
|
|
|
4
|
-
const TOOLS: typeof DATA.
|
|
4
|
+
const TOOLS: typeof DATA.audiovisualCategory[] = [];
|
|
5
5
|
|
|
6
6
|
describe('FAQ Content Validation', () => {
|
|
7
7
|
TOOLS.forEach((entry) => {
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { ALL_TOOLS } from '../tools';
|
|
3
|
+
|
|
4
|
+
const EXPECTED_LOCALES = [
|
|
5
|
+
'de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh'
|
|
6
|
+
];
|
|
7
|
+
|
|
8
|
+
describe('I18n Coverage Validation', () => {
|
|
9
|
+
it('all tools should be registered', () => {
|
|
10
|
+
expect(ALL_TOOLS.length).toBeGreaterThan(0);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
ALL_TOOLS.forEach(({ entry }: { entry: any }) => {
|
|
14
|
+
describe(`Tool: ${entry.id}`, () => {
|
|
15
|
+
it('should have all 15 required locales', () => {
|
|
16
|
+
const registeredLocales = Object.keys(entry.i18n);
|
|
17
|
+
EXPECTED_LOCALES.forEach((locale) => {
|
|
18
|
+
expect(
|
|
19
|
+
registeredLocales,
|
|
20
|
+
`Tool "${entry.id}" is missing locale "${locale}"`,
|
|
21
|
+
).toContain(locale);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('all locale loaders should be functions', () => {
|
|
26
|
+
EXPECTED_LOCALES.forEach((locale) => {
|
|
27
|
+
const loader = entry.i18n[locale as keyof typeof entry.i18n];
|
|
28
|
+
expect(
|
|
29
|
+
typeof loader,
|
|
30
|
+
`Tool "${entry.id}" locale "${locale}" loader is not a function`,
|
|
31
|
+
).toBe('function');
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { ALL_TOOLS } from '../tools';
|
|
3
|
+
import type { ToolLocaleContent } from '../types';
|
|
4
|
+
|
|
5
|
+
describe('Schemas Fulfillment Validation', () => {
|
|
6
|
+
ALL_TOOLS.forEach((tool) => {
|
|
7
|
+
describe(`Tool: ${tool.entry.id}`, () => {
|
|
8
|
+
Object.keys(tool.entry.i18n).forEach((locale) => {
|
|
9
|
+
it(`Locale: ${locale} should have faqSchema, appSchema and howToSchema`, async () => {
|
|
10
|
+
const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
|
|
11
|
+
if (!loader) return;
|
|
12
|
+
const content = (await loader()) as ToolLocaleContent;
|
|
13
|
+
|
|
14
|
+
const schemaTypes = content.schemas.map((s: any) => s['@type']);
|
|
15
|
+
|
|
16
|
+
expect(schemaTypes, `Tool "${tool.entry.id}" locale "${locale}" is missing FAQPage schema`).toContain('FAQPage');
|
|
17
|
+
expect(schemaTypes, `Tool "${tool.entry.id}" locale "${locale}" is missing SoftwareApplication schema`).toContain('SoftwareApplication');
|
|
18
|
+
expect(schemaTypes, `Tool "${tool.entry.id}" locale "${locale}" is missing HowTo schema`).toContain('HowTo');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -10,8 +10,7 @@ describe('SEO Content Length Validation', () => {
|
|
|
10
10
|
describe(`Tool: ${entry.id}`, () => {
|
|
11
11
|
Object.keys(entry.i18n).forEach((locale) => {
|
|
12
12
|
it(`${locale}: SEO section should exist`, async () => {
|
|
13
|
-
const loader = (entry.i18n as Record<string, (
|
|
14
|
-
if (!loader) return;
|
|
13
|
+
const loader = (entry.i18n as Record<string, () => Promise<{ seo?: unknown[] }>>)[locale];
|
|
15
14
|
const content = await loader();
|
|
16
15
|
if (!content.seo) return;
|
|
17
16
|
expect(Array.isArray(content.seo)).toBe(true);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, it } from 'vitest';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
function getFiles(dir: string, ext: string[]): string[] {
|
|
6
|
+
const results: string[] = [];
|
|
7
|
+
if (!fs.existsSync(dir)) return results;
|
|
8
|
+
const list = fs.readdirSync(dir);
|
|
9
|
+
for (const file of list) {
|
|
10
|
+
const fullPath = path.join(dir, file);
|
|
11
|
+
const stat = fs.statSync(fullPath);
|
|
12
|
+
if (stat && stat.isDirectory()) {
|
|
13
|
+
results.push(...getFiles(fullPath, ext));
|
|
14
|
+
} else if (ext.some((e) => file.endsWith(e))) {
|
|
15
|
+
results.push(fullPath);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return results;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const SRC_DIR = path.join(process.cwd(), 'src');
|
|
22
|
+
|
|
23
|
+
describe('Project Titles - Separator Validation', () => {
|
|
24
|
+
const files = [
|
|
25
|
+
...getFiles(path.join(SRC_DIR, 'tool'), ['.ts']),
|
|
26
|
+
...getFiles(path.join(SRC_DIR, 'category'), ['.ts']),
|
|
27
|
+
].filter(f => f.includes('i18n'));
|
|
28
|
+
|
|
29
|
+
it.each(files)('Verify that titles in %s do not contain | or -', (filePath) => {
|
|
30
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
31
|
+
const relativePath = path.relative(process.cwd(), filePath);
|
|
32
|
+
|
|
33
|
+
const titlePatterns = [
|
|
34
|
+
/const\s+title\s*=\s*['"]([^'"]+)['"]/g,
|
|
35
|
+
/title\s*:\s*['"]([^'"]+)['"]/g,
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const findings: string[] = [];
|
|
39
|
+
|
|
40
|
+
for (const pattern of titlePatterns) {
|
|
41
|
+
let match;
|
|
42
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
43
|
+
const title = match[1];
|
|
44
|
+
if (title.includes('|') || title.includes('-')) {
|
|
45
|
+
findings.push(title);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (findings.length > 0) {
|
|
51
|
+
const list = findings.map((f) => ` - "${f}"`).join('\n');
|
|
52
|
+
throw new Error(`Forbidden separators (| or -) found in titles in ${relativePath}:\n${list}`);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { BabyFeedingCalculatorLocaleContent } from '../index';
|
|
2
|
+
import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
|
|
3
|
+
|
|
4
|
+
const slug = 'baby-futter-rechner';
|
|
5
|
+
const title = 'Baby Fütterungsrechner';
|
|
6
|
+
const description = 'Berechnen Sie, wie viel Milch Ihr Baby basierend auf Gewicht und Alter benötigt. Empfohlene Mahlzeiten, Milliliter pro Mahlzeit sowie Hunger- und Sättigungssignale.';
|
|
7
|
+
|
|
8
|
+
const faq = [
|
|
9
|
+
{
|
|
10
|
+
question: 'Wie viel Milch benötigt ein Neugeborenes?',
|
|
11
|
+
answer: 'Am ersten Lebenstag hat der Magen des Babys die Größe einer Kirsche und benötigt nur 5 bis 7 ml pro Mahlzeit. Ab dem fünften Tag wächst die Kapazität auf 45–60 ml an, und die Bedürfnisse steigen progressiv.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
question: 'Wie oft sollte ein Baby essen?',
|
|
15
|
+
answer: 'Neugeborene benötigen zwischen 8 und 12 Mahlzeiten am Tag. Mit 3 Monaten liegen sie meist bei 7–8 Mahlzeiten, und mit 6 Monaten bei etwa 5 Mahlzeiten täglich.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
question: 'Woher weiß ich, ob mein Baby genug isst?',
|
|
19
|
+
answer: 'Die zuverlässigsten Indikatoren sind: angemessene Gewichtszunahme, mindestens 5–6 nasse Windeln pro Tag und dass das Baby nach den Mahlzeiten Sättigungssignale zeigt.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
question: 'Haben Muttermilch und Formelnahrung die gleichen Mengen?',
|
|
23
|
+
answer: 'Bei Muttermilch wird empfohlen, nach Bedarf zu füttern, ohne Volumina zu messen. Bei Formelnahrung ist der übliche Richtwert 150 ml pro kg Körpergewicht pro Tag, verteilt auf die Anzahl der Mahlzeiten je nach Alter.',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const howTo = [
|
|
28
|
+
{
|
|
29
|
+
name: 'Wählen Sie das Alter des Babys',
|
|
30
|
+
text: 'Wählen Sie die Einheit (Tage, Wochen oder Monate) und passen Sie den Wert mit dem Schieberegler oder den Tasten an.',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Geben Sie das Gewicht des Babys ein',
|
|
34
|
+
text: 'Verwenden Sie den Gewichts-Schieberegler oder die Tasten, um das aktuelle Gewicht des Babys in Kilogramm einzustellen.',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Wählen Sie die Ernährungsart',
|
|
38
|
+
text: 'Wählen Sie zwischen Stillen, Mischfütterung oder Formelnahrung, um die am besten angepasste Anleitung zu erhalten.',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Konsultieren Sie den empfohlenen Plan',
|
|
42
|
+
text: 'Der Rechner zeigt die Anzahl der Mahlzeiten, Milliliter pro Mahlzeit und die geschätzte tägliche Gesamtmenge an.',
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
47
|
+
'@context': 'https://schema.org',
|
|
48
|
+
'@type': 'FAQPage',
|
|
49
|
+
mainEntity: faq.map((item) => ({
|
|
50
|
+
'@type': 'Question',
|
|
51
|
+
name: item.question,
|
|
52
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
53
|
+
})),
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const howToSchema: WithContext<HowTo> = {
|
|
57
|
+
'@context': 'https://schema.org',
|
|
58
|
+
'@type': 'HowTo',
|
|
59
|
+
name: title,
|
|
60
|
+
description,
|
|
61
|
+
step: howTo.map((step) => ({
|
|
62
|
+
'@type': 'HowToStep',
|
|
63
|
+
name: step.name,
|
|
64
|
+
text: step.text,
|
|
65
|
+
})),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
69
|
+
'@context': 'https://schema.org',
|
|
70
|
+
'@type': 'SoftwareApplication',
|
|
71
|
+
name: title,
|
|
72
|
+
description,
|
|
73
|
+
applicationCategory: 'UtilitiesApplication',
|
|
74
|
+
operatingSystem: 'Web',
|
|
75
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
76
|
+
inLanguage: 'de',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const content: BabyFeedingCalculatorLocaleContent = {
|
|
80
|
+
slug,
|
|
81
|
+
title,
|
|
82
|
+
description,
|
|
83
|
+
ui: {
|
|
84
|
+
labelConfig: 'Aktuelle Konfiguration',
|
|
85
|
+
labelPlan: 'Empfohlener Plan',
|
|
86
|
+
unitDays: 'Tage',
|
|
87
|
+
unitWeeks: 'Wochen',
|
|
88
|
+
unitMonths: 'Monate',
|
|
89
|
+
labelWeight: 'Gewicht des Babys',
|
|
90
|
+
labelFeedType: 'Ernährungsart',
|
|
91
|
+
feedBreast: 'Stillen',
|
|
92
|
+
feedMixed: 'Mischfütterung',
|
|
93
|
+
feedFormula: 'Formelnahrung',
|
|
94
|
+
labelFreeDemand: 'Füttern nach Bedarf',
|
|
95
|
+
labelMlPerFeed: 'ml pro Mahlzeit',
|
|
96
|
+
labelFeedsCount: 'Mahlzeiten / 24h',
|
|
97
|
+
labelDailyTotal: 'Tagesgesamtmenge (gesch.)',
|
|
98
|
+
labelHunger: 'Hungersignale',
|
|
99
|
+
labelFullness: 'Sättigungssignale',
|
|
100
|
+
faqTitle: 'Häufig gestellte Fragen',
|
|
101
|
+
bibliographyTitle: 'Referenzen',
|
|
102
|
+
},
|
|
103
|
+
seo: [
|
|
104
|
+
{ type: 'summary', title: 'Zusammenfassung: Baby Ernährung', items: [
|
|
105
|
+
'Die Magenkapazität des Neugeborenen beträgt am ersten Tag nur etwa 5–7 ml.',
|
|
106
|
+
'Der allgemeine Richtwert für Formelnahrung liegt bei 150 ml pro kg Körpergewicht pro Tag.',
|
|
107
|
+
'Stillen erfolgt nach Bedarf ohne feste Mengen.',
|
|
108
|
+
'Die Häufigkeit nimmt mit dem Alter ab: von 8–12 Mahlzeiten auf 4–5 in 6 Monaten.',
|
|
109
|
+
]},
|
|
110
|
+
{ type: 'title', text: 'Wie viel Milch benötigt mein Baby basierend auf Gewicht und Alter?', level: 2 },
|
|
111
|
+
{ type: 'paragraph', html: 'Der Milchbedarf ändert sich in den ersten Monaten schnell. Der Rechner schätzt die Menge basierend auf dem aktuellen Gewicht und Alter des Babys gemäß den pädiatrischen Richtlinien der WHO und der AAP.' },
|
|
112
|
+
{ type: 'stats', columns: 3, items: [
|
|
113
|
+
{ value: '5–7 ml', label: 'Tag 1 (Kirschgröße)' },
|
|
114
|
+
{ value: '150 ml/kg', label: 'Tageswert Formel' },
|
|
115
|
+
{ value: '8–12', label: 'Mahlzeiten/Tag Neugeb.' },
|
|
116
|
+
]},
|
|
117
|
+
{ type: 'title', text: 'Magengröße nach Alter', level: 3 },
|
|
118
|
+
{ type: 'table', headers: ['Alter', 'Ref.-Größe', 'Kapazität', 'Mahlzeiten/Tag'], rows: [
|
|
119
|
+
['Tag 1', 'Kirsche', '5–7 ml', '8–12'],
|
|
120
|
+
['Tag 2–4', 'Walnuss', '22–27 ml', '8–12'],
|
|
121
|
+
['Tag 5–30', 'Ei', '45–60 ml', '8–10'],
|
|
122
|
+
['1–3 Monate', 'Maximal', '90–120 ml', '7–8'],
|
|
123
|
+
['3–6 Monate', 'Maximal', '120–150 ml', '5–6'],
|
|
124
|
+
['6+ Monate', 'Maximal', '150–180 ml', '4–5'],
|
|
125
|
+
]},
|
|
126
|
+
{ type: 'tip', html: 'Ein zuverlässiger Indikator für eine angemessene Ernährung ist die Anzahl der nassen Windeln: Zwischen 5 und 6 pro Tag ab dem fünften Tag deuten auf eine gute Hydratation hin.' },
|
|
127
|
+
{ type: 'title', text: 'Stillen vs. Formelnahrung', level: 3 },
|
|
128
|
+
{ type: 'comparative', columns: 2, items: [
|
|
129
|
+
{ title: 'Stillen', description: 'Natürliche Ernährung nach Bedarf.', points: ['Kein fester Zeitplan', 'Aktive Antikörper', 'Variable Zusammensetzung', 'Schwer zu quantifizieren'] },
|
|
130
|
+
{ title: 'Formelnahrung', description: 'Geplante Mahlzeiten mit berechenbarem Volumen.', points: ['Alle 3–4 Stunden', 'Stabile Zusammensetzung', 'Einfache Kontrolle der Menge', 'Erfordert sterile Zubereitung'] },
|
|
131
|
+
]},
|
|
132
|
+
{ type: 'list', items: [
|
|
133
|
+
'Angemessene Gewichtszunahme: 150–200 g/Woche im ersten Monat',
|
|
134
|
+
'Mindestens 5–6 nasse Windeln pro Tag',
|
|
135
|
+
'Das Baby zeigt sich nach den Mahlzeiten ruhig',
|
|
136
|
+
'Klarer oder sehr hellgelber Urin',
|
|
137
|
+
]},
|
|
138
|
+
],
|
|
139
|
+
faqTitle: "Häufig gestellte Fragen",
|
|
140
|
+
faq,
|
|
141
|
+
bibliographyTitle: "Referenzen",
|
|
142
|
+
bibliography: [
|
|
143
|
+
{
|
|
144
|
+
name: 'WHO - Ernährung von Säuglingen und Kleinkindern',
|
|
145
|
+
url: 'https://www.who.int/news-room/fact-sheets/detail/infant-and-young-child-feeding',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
name: 'American Academy of Pediatrics - Breastfeeding Guidelines',
|
|
149
|
+
url: 'https://www.aap.org/en/patient-care/breastfeeding/',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'La Leche Liga International',
|
|
153
|
+
url: 'https://www.llli.org',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: 'Deutsche Gesellschaft für Kinder- und Jugendmedizin (DGKJ)',
|
|
157
|
+
url: 'https://www.dgkj.de',
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
howTo,
|
|
161
|
+
schemas: [faqSchema as any, howToSchema as any, appSchema],
|
|
162
|
+
};
|