@jjlmoya/utils-finance 1.4.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 +2 -1
- package/src/category/i18n/de.ts +158 -0
- package/src/category/i18n/id.ts +158 -0
- package/src/category/i18n/it.ts +158 -0
- package/src/category/i18n/ja.ts +158 -0
- package/src/category/i18n/ko.ts +158 -0
- package/src/category/i18n/nl.ts +158 -0
- package/src/category/i18n/pl.ts +158 -0
- package/src/category/i18n/pt.ts +158 -0
- package/src/category/i18n/ru.ts +158 -0
- package/src/category/i18n/sv.ts +158 -0
- package/src/category/i18n/tr.ts +158 -0
- package/src/category/i18n/zh.ts +158 -0
- package/src/category/index.ts +13 -1
- package/src/tests/category_validation.test.ts +73 -0
- 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 +3 -0
- package/src/tests/slug_language_code_format.test.ts +23 -0
- package/src/tests/slug_uniqueness.test.ts +81 -0
- package/src/tests/title_quality.test.ts +1 -1
- package/src/tool/compoundInterest/i18n/de.ts +208 -0
- package/src/tool/compoundInterest/i18n/id.ts +208 -0
- package/src/tool/compoundInterest/i18n/it.ts +208 -0
- package/src/tool/compoundInterest/i18n/ja.ts +207 -0
- package/src/tool/compoundInterest/i18n/ko.ts +207 -0
- package/src/tool/compoundInterest/i18n/nl.ts +208 -0
- package/src/tool/compoundInterest/i18n/pl.ts +208 -0
- package/src/tool/compoundInterest/i18n/pt.ts +208 -0
- package/src/tool/compoundInterest/i18n/ru.ts +208 -0
- package/src/tool/compoundInterest/i18n/sv.ts +208 -0
- package/src/tool/compoundInterest/i18n/tr.ts +208 -0
- package/src/tool/compoundInterest/i18n/zh.ts +202 -0
- package/src/tool/compoundInterest/index.ts +15 -7
- package/src/tool/courtFeeCalculator/i18n/de.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/fr.ts +1 -1
- package/src/tool/courtFeeCalculator/i18n/id.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/it.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/ja.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/ko.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/nl.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/pl.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/pt.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/ru.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/sv.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/tr.ts +152 -0
- package/src/tool/courtFeeCalculator/i18n/zh.ts +152 -0
- package/src/tool/courtFeeCalculator/index.ts +16 -8
- package/src/tool/debtSnowball/i18n/de.ts +160 -0
- package/src/tool/debtSnowball/i18n/id.ts +160 -0
- package/src/tool/debtSnowball/i18n/it.ts +160 -0
- package/src/tool/debtSnowball/i18n/ja.ts +157 -0
- package/src/tool/debtSnowball/i18n/ko.ts +160 -0
- package/src/tool/debtSnowball/i18n/nl.ts +160 -0
- package/src/tool/debtSnowball/i18n/pl.ts +160 -0
- package/src/tool/debtSnowball/i18n/pt.ts +160 -0
- package/src/tool/debtSnowball/i18n/ru.ts +160 -0
- package/src/tool/debtSnowball/i18n/sv.ts +160 -0
- package/src/tool/debtSnowball/i18n/tr.ts +160 -0
- package/src/tool/debtSnowball/i18n/zh.ts +160 -0
- package/src/tool/debtSnowball/index.ts +17 -9
- package/src/tool/fireCalculator/i18n/de.ts +261 -0
- package/src/tool/fireCalculator/i18n/id.ts +261 -0
- package/src/tool/fireCalculator/i18n/it.ts +261 -0
- package/src/tool/fireCalculator/i18n/ja.ts +261 -0
- package/src/tool/fireCalculator/i18n/ko.ts +261 -0
- package/src/tool/fireCalculator/i18n/nl.ts +261 -0
- package/src/tool/fireCalculator/i18n/pl.ts +261 -0
- package/src/tool/fireCalculator/i18n/pt.ts +261 -0
- package/src/tool/fireCalculator/i18n/ru.ts +261 -0
- package/src/tool/fireCalculator/i18n/sv.ts +261 -0
- package/src/tool/fireCalculator/i18n/tr.ts +261 -0
- package/src/tool/fireCalculator/i18n/zh.ts +261 -0
- package/src/tool/fireCalculator/index.ts +15 -7
- package/src/tool/ibanBicSwiftConverter/i18n/de.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/id.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/it.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/ja.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/ko.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/nl.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/pl.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/pt.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/ru.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/sv.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/tr.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/i18n/zh.ts +128 -0
- package/src/tool/ibanBicSwiftConverter/index.ts +15 -7
- package/src/tool/inflation/i18n/de.ts +297 -0
- package/src/tool/inflation/i18n/id.ts +297 -0
- package/src/tool/inflation/i18n/it.ts +297 -0
- package/src/tool/inflation/i18n/ja.ts +297 -0
- package/src/tool/inflation/i18n/ko.ts +297 -0
- package/src/tool/inflation/i18n/nl.ts +297 -0
- package/src/tool/inflation/i18n/pl.ts +297 -0
- package/src/tool/inflation/i18n/pt.ts +297 -0
- package/src/tool/inflation/i18n/ru.ts +297 -0
- package/src/tool/inflation/i18n/sv.ts +297 -0
- package/src/tool/inflation/i18n/tr.ts +297 -0
- package/src/tool/inflation/i18n/zh.ts +297 -0
- package/src/tool/inflation/index.ts +17 -9
- package/src/tool/lateInterest/i18n/de.ts +224 -0
- package/src/tool/lateInterest/i18n/id.ts +224 -0
- package/src/tool/lateInterest/i18n/it.ts +224 -0
- package/src/tool/lateInterest/i18n/ja.ts +224 -0
- package/src/tool/lateInterest/i18n/ko.ts +224 -0
- package/src/tool/lateInterest/i18n/nl.ts +224 -0
- package/src/tool/lateInterest/i18n/pl.ts +224 -0
- package/src/tool/lateInterest/i18n/pt.ts +224 -0
- package/src/tool/lateInterest/i18n/ru.ts +224 -0
- package/src/tool/lateInterest/i18n/sv.ts +224 -0
- package/src/tool/lateInterest/i18n/tr.ts +224 -0
- package/src/tool/lateInterest/i18n/zh.ts +224 -0
- package/src/tool/lateInterest/index.ts +17 -9
- package/src/tool/legalInterestRate/i18n/de.ts +143 -0
- package/src/tool/legalInterestRate/i18n/id.ts +143 -0
- package/src/tool/legalInterestRate/i18n/it.ts +143 -0
- package/src/tool/legalInterestRate/i18n/ja.ts +143 -0
- package/src/tool/legalInterestRate/i18n/ko.ts +143 -0
- package/src/tool/legalInterestRate/i18n/nl.ts +143 -0
- package/src/tool/legalInterestRate/i18n/pl.ts +143 -0
- package/src/tool/legalInterestRate/i18n/pt.ts +143 -0
- package/src/tool/legalInterestRate/i18n/ru.ts +143 -0
- package/src/tool/legalInterestRate/i18n/sv.ts +143 -0
- package/src/tool/legalInterestRate/i18n/tr.ts +143 -0
- package/src/tool/legalInterestRate/i18n/zh.ts +143 -0
- package/src/tool/legalInterestRate/index.ts +17 -9
- package/src/tool/lotteryOptimizer/i18n/de.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/id.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/it.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/ja.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/ko.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/nl.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/pl.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/pt.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/ru.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/sv.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/tr.ts +177 -0
- package/src/tool/lotteryOptimizer/i18n/zh.ts +177 -0
- package/src/tool/lotteryOptimizer/index.ts +17 -9
- package/src/tool/mortgage/i18n/de.ts +223 -0
- package/src/tool/mortgage/i18n/id.ts +219 -0
- package/src/tool/mortgage/i18n/it.ts +223 -0
- package/src/tool/mortgage/i18n/ja.ts +219 -0
- package/src/tool/mortgage/i18n/ko.ts +219 -0
- package/src/tool/mortgage/i18n/nl.ts +219 -0
- package/src/tool/mortgage/i18n/pl.ts +219 -0
- package/src/tool/mortgage/i18n/pt.ts +219 -0
- package/src/tool/mortgage/i18n/ru.ts +219 -0
- package/src/tool/mortgage/i18n/sv.ts +219 -0
- package/src/tool/mortgage/i18n/tr.ts +219 -0
- package/src/tool/mortgage/i18n/zh.ts +219 -0
- package/src/tool/mortgage/index.ts +15 -7
- package/src/tool/percentageCalculator/i18n/de.ts +229 -0
- package/src/tool/percentageCalculator/i18n/id.ts +229 -0
- package/src/tool/percentageCalculator/i18n/it.ts +229 -0
- package/src/tool/percentageCalculator/i18n/ja.ts +229 -0
- package/src/tool/percentageCalculator/i18n/ko.ts +229 -0
- package/src/tool/percentageCalculator/i18n/nl.ts +229 -0
- package/src/tool/percentageCalculator/i18n/pl.ts +229 -0
- package/src/tool/percentageCalculator/i18n/pt.ts +229 -0
- package/src/tool/percentageCalculator/i18n/ru.ts +229 -0
- package/src/tool/percentageCalculator/i18n/sv.ts +229 -0
- package/src/tool/percentageCalculator/i18n/tr.ts +229 -0
- package/src/tool/percentageCalculator/i18n/zh.ts +229 -0
- package/src/tool/percentageCalculator/index.ts +15 -7
- package/src/tool/rentIncreaseCalculator/i18n/de.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/id.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/it.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/ja.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/ko.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/nl.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/pl.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/pt.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/ru.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/sv.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/tr.ts +136 -0
- package/src/tool/rentIncreaseCalculator/i18n/zh.ts +136 -0
- package/src/tool/rentIncreaseCalculator/index.ts +17 -9
- package/src/types.ts +1 -1
package/src/category/index.ts
CHANGED
|
@@ -16,9 +16,21 @@ export const financeCategory: FinanceCategoryEntry = {
|
|
|
16
16
|
icon: 'mdi:finance',
|
|
17
17
|
tools: [compoundInterest, mortgage, inflation, percentageCalculator, lateInterest, ibanBicSwift, rentIncrease, lotteryOptimizer, courtFeeCalculator, legalInterestRate, fireCalculator, debtSnowball],
|
|
18
18
|
i18n: {
|
|
19
|
-
es: () => import('./i18n/es').then((m) => m.content),
|
|
20
19
|
en: () => import('./i18n/en').then((m) => m.content),
|
|
20
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
21
21
|
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
22
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
23
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
24
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
25
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
26
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
27
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
28
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
29
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
30
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
31
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
32
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
33
|
+
zh: () => import('./i18n/zh').then((m) => m.content),
|
|
22
34
|
},
|
|
23
35
|
};
|
|
24
36
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { financeCategory as toolsCategory } from '../category/index';
|
|
3
|
+
import type { CategoryLocaleContent } from '../types';
|
|
4
|
+
|
|
5
|
+
const EXPECTED_LOCALES = [
|
|
6
|
+
'de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh'
|
|
7
|
+
];
|
|
8
|
+
|
|
9
|
+
const sharingLocales = ['ja', 'ko', 'zh'];
|
|
10
|
+
|
|
11
|
+
describe('Category Validation', () => {
|
|
12
|
+
it('should have all 15 required locales', () => {
|
|
13
|
+
const registeredLocales = Object.keys(toolsCategory.i18n);
|
|
14
|
+
EXPECTED_LOCALES.forEach((locale) => {
|
|
15
|
+
expect(
|
|
16
|
+
registeredLocales,
|
|
17
|
+
`Category is missing locale "${locale}"`,
|
|
18
|
+
).toContain(locale);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('Category Slug Validation', () => {
|
|
23
|
+
it('every locale should have a unique, translated slug and follow format rules', async () => {
|
|
24
|
+
const slugs = new Map<string, string>();
|
|
25
|
+
const locales = Object.keys(toolsCategory.i18n);
|
|
26
|
+
|
|
27
|
+
let enSlug = '';
|
|
28
|
+
if (locales.includes('en')) {
|
|
29
|
+
const enLoader = toolsCategory.i18n['en' as keyof typeof toolsCategory.i18n];
|
|
30
|
+
const enContent = (await enLoader?.()) as CategoryLocaleContent;
|
|
31
|
+
enSlug = enContent.slug;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
for (const locale of locales) {
|
|
35
|
+
const loader = toolsCategory.i18n[locale as keyof typeof toolsCategory.i18n];
|
|
36
|
+
const content = (await loader?.()) as CategoryLocaleContent;
|
|
37
|
+
|
|
38
|
+
expect(
|
|
39
|
+
content.slug,
|
|
40
|
+
`Category locale "${locale}" has an invalid slug ("${content.slug}"). Slugs must be transliterated (only a-z, 0-9, and -).`,
|
|
41
|
+
).toMatch(/^[a-z0-9-]+$/);
|
|
42
|
+
|
|
43
|
+
expect(
|
|
44
|
+
content.slug,
|
|
45
|
+
`Category locale "${locale}" slug ("${content.slug}") cannot end with a 2-letter language code (e.g., -ja, -ru, -ko).`,
|
|
46
|
+
).not.toMatch(/-[a-z]{2}$/);
|
|
47
|
+
|
|
48
|
+
if (locale !== 'en') {
|
|
49
|
+
if (sharingLocales.includes(locale)) {
|
|
50
|
+
expect(
|
|
51
|
+
content.slug,
|
|
52
|
+
`Category locale "${locale}" must use the same slug as "en" ("${enSlug}").`,
|
|
53
|
+
).toBe(enSlug);
|
|
54
|
+
} else {
|
|
55
|
+
expect(
|
|
56
|
+
content.slug,
|
|
57
|
+
`Category locale "${locale}" has the same slug as "en" ("${enSlug}"). Cada slug tiene que estar en su propio idioma`,
|
|
58
|
+
).not.toBe(enSlug);
|
|
59
|
+
|
|
60
|
+
if (slugs.has(content.slug)) {
|
|
61
|
+
const previousLocale = slugs.get(content.slug);
|
|
62
|
+
expect(
|
|
63
|
+
false,
|
|
64
|
+
`Category locales "${locale}" and "${previousLocale}" share the same slug ("${content.slug}"). Cada slug tiene que estar en su propia idioma`,
|
|
65
|
+
).toBe(true);
|
|
66
|
+
}
|
|
67
|
+
slugs.set(content.slug, locale);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
@@ -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('Slug Language Code Format Validation', () => {
|
|
6
|
+
ALL_TOOLS.forEach((tool) => {
|
|
7
|
+
describe(`Tool: ${tool.entry.id}`, () => {
|
|
8
|
+
it('slug should not end with 2-letter language codes like -ja, -ru, -ko', async () => {
|
|
9
|
+
const locales = Object.keys(tool.entry.i18n);
|
|
10
|
+
|
|
11
|
+
for (const locale of locales) {
|
|
12
|
+
const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
|
|
13
|
+
const content = (await loader?.()) as ToolLocaleContent;
|
|
14
|
+
|
|
15
|
+
expect(
|
|
16
|
+
content.slug,
|
|
17
|
+
`Tool "${tool.entry.id}" locale "${locale}" slug ("${content.slug}") cannot end with a 2-letter language code (e.g., -ja, -ru, -ko).`,
|
|
18
|
+
).not.toMatch(/-[a-z]{2}$/);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { ALL_TOOLS } from '../tools';
|
|
3
|
+
import type { ToolLocaleContent } from '../types';
|
|
4
|
+
|
|
5
|
+
const sharingLocales = ['ja', 'ko', 'zh'];
|
|
6
|
+
|
|
7
|
+
interface ValidateParams {
|
|
8
|
+
toolId: string;
|
|
9
|
+
locale: string;
|
|
10
|
+
content: ToolLocaleContent;
|
|
11
|
+
enSlug: string;
|
|
12
|
+
slugs: Map<string, string>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const validateLocaleSlug = ({
|
|
16
|
+
toolId,
|
|
17
|
+
locale,
|
|
18
|
+
content,
|
|
19
|
+
enSlug,
|
|
20
|
+
slugs,
|
|
21
|
+
}: ValidateParams) => {
|
|
22
|
+
expect(
|
|
23
|
+
content.slug,
|
|
24
|
+
`Tool "${toolId}" locale "${locale}" has an invalid slug ("${content.slug}"). Slugs must be transliterated (only a-z, 0-9, and -).`,
|
|
25
|
+
).toMatch(/^[a-z0-9-]+$/);
|
|
26
|
+
|
|
27
|
+
if (locale === 'en') {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (sharingLocales.includes(locale)) {
|
|
32
|
+
expect(
|
|
33
|
+
content.slug,
|
|
34
|
+
`Tool "${toolId}" locale "${locale}" must use the same slug as "en" ("${enSlug}").`,
|
|
35
|
+
).toBe(enSlug);
|
|
36
|
+
} else {
|
|
37
|
+
expect(
|
|
38
|
+
content.slug,
|
|
39
|
+
`Tool "${toolId}" locale "${locale}" has the same slug as "en" ("${enSlug}"). Cada slug tiene que estar en su propia idioma`,
|
|
40
|
+
).not.toBe(enSlug);
|
|
41
|
+
|
|
42
|
+
if (slugs.has(content.slug)) {
|
|
43
|
+
const previousLocale = slugs.get(content.slug);
|
|
44
|
+
expect(
|
|
45
|
+
false,
|
|
46
|
+
`Tool "${toolId}" locales "${locale}" and "${previousLocale}" share the same slug ("${content.slug}"). Cada slug tiene que estar en su propia idioma`,
|
|
47
|
+
).toBe(true);
|
|
48
|
+
}
|
|
49
|
+
slugs.set(content.slug, locale);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
describe('Slug Localization and Uniqueness Validation', () => {
|
|
54
|
+
ALL_TOOLS.forEach((tool) => {
|
|
55
|
+
describe(`Tool: ${tool.entry.id}`, () => {
|
|
56
|
+
it('every locale should have a unique, translated slug', async () => {
|
|
57
|
+
const slugs = new Map<string, string>();
|
|
58
|
+
const locales = Object.keys(tool.entry.i18n);
|
|
59
|
+
|
|
60
|
+
let enSlug = '';
|
|
61
|
+
if (locales.includes('en')) {
|
|
62
|
+
const enLoader = tool.entry.i18n['en' as keyof typeof tool.entry.i18n];
|
|
63
|
+
const enContent = (await enLoader?.()) as ToolLocaleContent;
|
|
64
|
+
enSlug = enContent.slug;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
for (const locale of locales) {
|
|
68
|
+
const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
|
|
69
|
+
const content = (await loader?.()) as ToolLocaleContent;
|
|
70
|
+
validateLocaleSlug({
|
|
71
|
+
toolId: tool.entry.id,
|
|
72
|
+
locale,
|
|
73
|
+
content,
|
|
74
|
+
enSlug,
|
|
75
|
+
slugs,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
});
|
|
@@ -41,7 +41,7 @@ describe('Project Titles - Separator Validation', () => {
|
|
|
41
41
|
let match;
|
|
42
42
|
while ((match = pattern.exec(content)) !== null) {
|
|
43
43
|
const title = match[1];
|
|
44
|
-
if (title
|
|
44
|
+
if (title.includes('|') || title.includes('-')) {
|
|
45
45
|
findings.push(title);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dts';
|
|
2
|
+
import type { ToolLocaleContent } from '../../../types';
|
|
3
|
+
import type { CompoundInterestUI } from '../ui';
|
|
4
|
+
|
|
5
|
+
const slug = 'zinseszins-rechner';
|
|
6
|
+
const title = 'Zinseszinsrechner: Visualisieren Sie Ihren zukünftigen Reichtum';
|
|
7
|
+
const description =
|
|
8
|
+
'Entdecken Sie, wie aus kleinen Investitionen große Vermögen werden. Das ultimative Werkzeug zur Planung Ihrer finanziellen Freiheit und Altersvorsorge.';
|
|
9
|
+
|
|
10
|
+
const faqData = [
|
|
11
|
+
{
|
|
12
|
+
question: 'Was ist Zinseszins?',
|
|
13
|
+
answer:
|
|
14
|
+
'Es sind Zinsen, die auf das ursprüngliche Kapital und auch auf die aufgelaufenen Zinsen früherer Perioden berechnet werden. Dies führt im Laufe der Zeit zu einem exponentiellen Wachstum der Investition.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
question: 'Was ist der Unterschied zum einfachen Zins?',
|
|
18
|
+
answer:
|
|
19
|
+
'Beim einfachen Zins werden die Zinsen nur auf das ursprüngliche Kapital berechnet. Beim Zinseszins werden die Zinsen reinvestiert, was bedeutet, dass „Ihre Zinsen weitere Zinsen generieren“.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
question: 'Was ist die „72er-Regel“?',
|
|
23
|
+
answer:
|
|
24
|
+
'Es ist eine Faustformel zur Schätzung, wie lange es dauert, bis sich eine Investition verdoppelt: Teilen Sie 72 durch die jährliche Rendite. Beispiel: Bei 8 % pro Jahr verdoppeln Sie Ihr Geld in 9 Jahren.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
question: 'Warum ist es wichtig, jung mit dem Investieren zu beginnen?',
|
|
28
|
+
answer:
|
|
29
|
+
'Aufgrund des exponentiellen Effekts ist der entscheidendste Faktor nicht die Menge des gesparten Geldes, sondern die Zeit. Ein paar Jahre früher anzufangen, kann aufgrund der Kapitalisierung zu einem viel größeren Endvermögen führen.',
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
const howToData = [
|
|
34
|
+
{
|
|
35
|
+
name: 'Startkapital eingeben',
|
|
36
|
+
text: 'Geben Sie den Geldbetrag ein, mit dem Sie Ihren Investitionsplan beginnen möchten.',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Regelmäßige Beiträge festlegen',
|
|
40
|
+
text: 'Geben Sie an, wie viel Geld Sie zusätzlich jeden Monat oder jedes Jahr sparen und investieren werden.',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Jährliche Rendite schätzen',
|
|
44
|
+
text: 'Geben Sie den Prozentsatz an jährlichem Gewinn ein, den Sie erwarten (z. B. 7 % für den historischen S&P 500).',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Zeithorizont anpassen',
|
|
48
|
+
text: 'Wählen Sie aus, wie viele Jahre Sie die Investition halten möchten, um das exponentielle Wachstum Ihres Kapitals zu visualisieren.',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
const faqSchema: WithContext<FAQPage> = {
|
|
53
|
+
'@context': 'https://schema.org',
|
|
54
|
+
'@type': 'FAQPage',
|
|
55
|
+
mainEntity: faqData.map((item) => ({
|
|
56
|
+
'@type': 'Question',
|
|
57
|
+
name: item.question,
|
|
58
|
+
acceptedAnswer: { '@type': 'Answer', text: item.answer },
|
|
59
|
+
})),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const howToSchema: WithContext<HowTo> = {
|
|
63
|
+
'@context': 'https://schema.org',
|
|
64
|
+
'@type': 'HowTo',
|
|
65
|
+
name: title,
|
|
66
|
+
description,
|
|
67
|
+
step: howToData.map((step, i) => ({
|
|
68
|
+
'@type': 'HowToStep',
|
|
69
|
+
position: i + 1,
|
|
70
|
+
name: step.name,
|
|
71
|
+
text: step.text,
|
|
72
|
+
})),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const appSchema: WithContext<SoftwareApplication> = {
|
|
76
|
+
'@context': 'https://schema.org',
|
|
77
|
+
'@type': 'SoftwareApplication',
|
|
78
|
+
name: title,
|
|
79
|
+
description,
|
|
80
|
+
applicationCategory: 'FinanceApplication',
|
|
81
|
+
operatingSystem: 'All',
|
|
82
|
+
offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
|
|
83
|
+
inLanguage: 'de',
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export const content: ToolLocaleContent<CompoundInterestUI> = {
|
|
87
|
+
slug,
|
|
88
|
+
title,
|
|
89
|
+
description,
|
|
90
|
+
faqTitle: 'Häufig gestellte Fragen',
|
|
91
|
+
faq: faqData,
|
|
92
|
+
bibliographyTitle: 'Quellen und Referenzen',
|
|
93
|
+
bibliography: [
|
|
94
|
+
{
|
|
95
|
+
name: 'Investopedia: Compound Interest Definition',
|
|
96
|
+
url: 'https://www.investopedia.com/terms/c/compoundinterest.asp',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'Investopedia: Rule of 72',
|
|
100
|
+
url: 'https://www.investopedia.com/terms/r/ruleof72.asp',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'Khan Academy: Interest and Debt',
|
|
104
|
+
url: 'https://www.khanacademy.org/economics-finance-domain/core-finance/interest-tutorial',
|
|
105
|
+
},
|
|
106
|
+
],
|
|
107
|
+
howTo: howToData,
|
|
108
|
+
schemas: [faqSchema, howToSchema, appSchema],
|
|
109
|
+
seo: [
|
|
110
|
+
{
|
|
111
|
+
type: 'title',
|
|
112
|
+
text: 'Die Magie des Zinseszinses: Bauen Sie Ihren Reichtum exponentiell auf',
|
|
113
|
+
level: 2,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
type: 'paragraph',
|
|
117
|
+
html: 'Albert Einstein nannte ihn das „achte Weltwunder“. Der <strong>Zinseszins</strong> ist der mächtigste Mechanismus, um langfristig Reichtum zu generieren. Man muss kein Finanzexperte sein, um ihn zu nutzen: Man braucht nur Zeit, Geduld und investiertes Geld.',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: 'title',
|
|
121
|
+
text: 'Einfacher Zins vs. Zinseszins: Die Metapher des Schneeballs',
|
|
122
|
+
level: 3,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
type: 'paragraph',
|
|
126
|
+
html: 'Stellen Sie sich vor, Sie haben einen Schneeball oben auf einem Hügel. Der <strong>einfache Zins</strong> ist so, als würde man diesen Ball hinunterrollen und manuell jeden Meter Schnee hinzufügen müssen, damit er wächst. Der <strong>Zinseszins</strong> ist so, als würde man den Ball von selbst rollen lassen: Er sammelt von alleine Schnee auf, und je größer er wird, desto mehr Oberfläche hat er, um bei jeder Drehung <em>noch mehr</em> Schnee aufzusammeln.',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: 'comparative',
|
|
130
|
+
columns: 2,
|
|
131
|
+
items: [
|
|
132
|
+
{
|
|
133
|
+
title: 'Einfacher Zins',
|
|
134
|
+
description: 'Die Zinsen werden immer nur auf das ursprüngliche Kapital berechnet.',
|
|
135
|
+
points: [
|
|
136
|
+
'Formel: Kapital × Zinssatz × Zeit',
|
|
137
|
+
'Lineares und vorhersehbares Wachstum',
|
|
138
|
+
'Verwendet bei kurzfristigen Krediten',
|
|
139
|
+
'Keine Reinvestition von Gewinnen',
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: 'Zinseszins',
|
|
144
|
+
description: 'Zinsen werden zum Kapital addiert und generieren neue Zinsen.',
|
|
145
|
+
highlight: true,
|
|
146
|
+
points: [
|
|
147
|
+
'Formel: Kapital × (1 + Zinssatz)^Zeit',
|
|
148
|
+
'Beschleunigtes exponentielles Wachstum',
|
|
149
|
+
'Grundlage jeder langfristigen Investition',
|
|
150
|
+
'Ihre Gewinne generieren weitere Gewinne',
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
type: 'paragraph',
|
|
157
|
+
html: 'Mathematisch gesehen generieren Ihre Gewinne neue Gewinne. In den ersten Jahren scheint es langsam zu sein, aber nach dem „Wendepunkt“ schießt die Kurve vertikal nach oben. Hier entstehen die wahren Vermögen.',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
type: 'title',
|
|
161
|
+
text: 'Warum ist Zeit Ihr größter Verbündeter?',
|
|
162
|
+
level: 3,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'paragraph',
|
|
166
|
+
html: 'Der entscheidendste Faktor ist nicht die Geldmenge, die Sie investieren, sondern <strong>wie viele Jahre Sie es wachsen lassen</strong>. 10 Jahre früher anzufangen kann zu einem 2- oder 3-mal größeren Endvermögen führen, selbst wenn Sie insgesamt weniger Geld investieren. Dieser exponentielle Effekt ist der Grund, warum junge Investoren einen unvergleichlichen Vorteil haben.',
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
type: 'tip',
|
|
170
|
+
title: 'Die 72er Regel',
|
|
171
|
+
html: '<p>Teilen Sie 72 durch Ihre jährliche Rendite, um zu wissen, wie viele Jahre es dauert, bis sich <strong>Ihr Geld verdoppelt</strong>.</p><p><em>Beispiel: Bei 8% verdoppeln Sie alle 9 Jahre (72/8 = 9).</em></p><p>Diese magische Formel funktioniert für jede Rendite und hilft Ihnen, das Wachstum Ihrer Investitionen schnell abzuschätzen.</p>',
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
type: 'tip',
|
|
175
|
+
title: 'Tipp 2026',
|
|
176
|
+
html: '<p>Die Inflation bleibt ein Faktor. Stellen Sie sicher, dass Ihre Nettorendite mindestens 2-3 % pro Jahr übersteigt, um keine Kaufkraft zu verlieren. Investieren Sie in Vermögenswerte, die schneller wachsen als die Inflation.</p>',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: 'title',
|
|
180
|
+
text: 'Zinskapitalisierung: Spielt sie eine Rolle?',
|
|
181
|
+
level: 3,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
type: 'paragraph',
|
|
185
|
+
html: 'Zinsen können jährlich, halbjährlich, vierteljährlich, monatlich oder sogar täglich kapitalisiert werden. Je <strong>häufiger die Kapitalisierung</strong> erfolgt, desto größer ist der Zinseszinseffekt. Ein gleiches Kapital mit demselben Zinssatz wächst stärker, wenn die Zinsverrechnung monatlich erfolgt als wenn sie nur jährlich durchgeführt wird.',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
ui: {
|
|
189
|
+
labelTitle: 'Investitionssimulator',
|
|
190
|
+
labelRealtime: 'Echtzeit',
|
|
191
|
+
labelInitial: 'Startkapital',
|
|
192
|
+
labelMonthly: 'Monatlicher Beitrag',
|
|
193
|
+
labelRate: 'Rendite p.a.',
|
|
194
|
+
labelYears: 'Jahre',
|
|
195
|
+
labelMyMoney: 'Ihr Geld',
|
|
196
|
+
labelProfit: 'Gewinn (Zinsen)',
|
|
197
|
+
labelTotal: 'Gesamtguthaben',
|
|
198
|
+
labelYear: 'Jahr',
|
|
199
|
+
labelPrincipal: 'Ihr Geld (Stammkapital)',
|
|
200
|
+
labelInterest: 'Generierte Zinsen',
|
|
201
|
+
insightPrefix: '[TIPP] Im Jahr ',
|
|
202
|
+
insightSuffix:
|
|
203
|
+
', werden Ihre jährlich generierten Zinsen Ihre Beiträge übersteigen. Das Geld arbeitet bereits mehr als Sie!',
|
|
204
|
+
currencySymbol: '€',
|
|
205
|
+
currencyCode: 'EUR',
|
|
206
|
+
currencyLocale: 'de-DE',
|
|
207
|
+
},
|
|
208
|
+
};
|