@jjlmoya/utils-language 1.2.0 → 1.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-language",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -3,14 +3,14 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'sprachen',
5
5
  title: 'Werkzeuge zum Sprachenlernen',
6
- description: 'Private Browser Werkzeuge, die Sprachlernziele in praktische Lernplaene, Wochenroutinen und messbare Meilensteine verwandeln.',
6
+ description: 'Private Browser-Werkzeuge, die Sprachlernziele in praktische Lernpläne, Wochenroutinen und messbare Meilensteine verwandeln.',
7
7
  seo: [
8
- { type: 'title', text: 'Werkzeuge fuer eine praktische Sprachlernplanung', level: 2 },
9
- { type: 'paragraph', html: 'Eine Sprache lernt sich leichter, wenn aus einem grossen Ziel eine sichtbare Routine wird. Diese Sammlung beginnt mit einem Lernplaner, der GER Niveau, Zielniveau, Frist, Wochenzeit und bevorzugte Fertigkeiten verbindet.' },
10
- { type: 'title', text: 'Fortschritt planen ohne Sprachfliessigkeit zu versprechen', level: 2 },
11
- { type: 'paragraph', html: 'Der Planer nutzt breite Bereiche fuer angeleitetes Lernen, um den Arbeitsaufwand und die verfuegbare Zeit bis zur Frist zu schaetzen. Er ist eine Planungshilfe, kein Einstufungstest und keine Garantie.' },
12
- { type: 'title', text: 'Privat und auf jedem Geraet nuetzlich', level: 2 },
8
+ { type: 'title', text: 'Werkzeuge für eine praktische Sprachlernplanung', level: 2 },
9
+ { type: 'paragraph', html: 'Eine Sprache lernt sich leichter, wenn aus einem großen Ziel eine sichtbare Routine wird. Diese Sammlung beginnt mit einem Lernplaner, der GER-Niveau, Zielniveau, Frist, Wochenzeit und bevorzugte Fertigkeiten verbindet.' },
10
+ { type: 'title', text: 'Fortschritt planen ohne Sprachflüssigkeit zu versprechen', level: 2 },
11
+ { type: 'paragraph', html: 'Der Planer nutzt breite Bereiche für angeleitetes Lernen, um den Arbeitsaufwand und die verfügbare Zeit bis zur Frist zu schätzen. Er ist eine Planungshilfe, kein Einstufungstest und keine Garantie.' },
12
+ { type: 'title', text: 'Privat und auf jedem Gerät nützlich', level: 2 },
13
13
  { type: 'paragraph', html: 'Auswahl, Niveau, Frist und Zeitplan bleiben im Browser. Es ist kein Konto erforderlich und die Eingaben werden nicht an einen Server gesendet.' },
14
- { type: 'stats', items: [{ label: 'Werkzeug', value: '1', icon: 'mdi:tools' }, { label: 'Niveaus', value: 'A0 bis C2', icon: 'mdi:stairs-up' }, { label: 'Sprachen', value: '10', icon: 'mdi:translate' }, { label: 'Privatsphaere', value: 'Lokal', icon: 'mdi:shield-check' }] },
14
+ { type: 'stats', items: [{ label: 'Werkzeug', value: '1', icon: 'mdi:tools' }, { label: 'Niveaus', value: 'A0 bis C2', icon: 'mdi:stairs-up' }, { label: 'Sprachen', value: '10', icon: 'mdi:translate' }, { label: 'Privatsphäre', value: 'Lokal', icon: 'mdi:shield-check' }] },
15
15
  ],
16
16
  };
@@ -1,7 +1,7 @@
1
1
  import type { CategoryLocaleContent } from '../../types';
2
2
 
3
3
  export const content: CategoryLocaleContent = {
4
- slug: 'gengo',
4
+ slug: 'language',
5
5
  title: '語学学習ツール',
6
6
  description: '語学の目標を実用的な学習計画、毎週の学習時間、確認できる到達目安に変える、ブラウザーで使えるプライベートなツールです。',
7
7
  seo: [
@@ -1,7 +1,7 @@
1
1
  import type { CategoryLocaleContent } from '../../types';
2
2
 
3
3
  export const content: CategoryLocaleContent = {
4
- slug: 'eoneo',
4
+ slug: 'language',
5
5
  title: '언어 학습 도구',
6
6
  description: '언어 학습 목표를 실용적인 계획과 주간 학습 세션, 확인 가능한 중간 목표로 바꾸는 브라우저 기반 비공개 도구입니다.',
7
7
  seo: [
@@ -1,7 +1,7 @@
1
1
  import type { CategoryLocaleContent } from '../../types';
2
2
 
3
3
  export const content: CategoryLocaleContent = {
4
- slug: 'yuyan',
4
+ slug: 'language',
5
5
  title: '语言学习工具',
6
6
  description: '在浏览器中使用的隐私工具,将语言目标转化为实用的学习计划、每周练习和可衡量的阶段目标。',
7
7
  seo: [
@@ -0,0 +1,94 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { existsSync, readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { languageCategory } from '../data';
5
+
6
+ const EXPECTED_LOCALES = ['de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh'] as const;
7
+ const EXPECTED_SLUGS = {
8
+ de: 'sprachen', en: 'language', es: 'idiomas', fr: 'langues', id: 'bahasa',
9
+ it: 'lingue', ja: 'language', ko: 'language', nl: 'talen', pl: 'jezyki', pt: 'idiomas',
10
+ ru: 'yazyki', sv: 'sprak', tr: 'diller', zh: 'language',
11
+ } as const;
12
+ const CATEGORY_DIR = join(process.cwd(), 'src', 'category', 'i18n');
13
+ const SEO_TYPES = new Set(['title', 'paragraph', 'list', 'stats']);
14
+
15
+ type CategoryContent = {
16
+ slug: string;
17
+ title: string;
18
+ description: string;
19
+ seo: Array<Record<string, unknown>>;
20
+ };
21
+
22
+ function sectionText(section: Record<string, unknown>): string {
23
+ const value = section.text ?? section.html ?? '';
24
+ return typeof value === 'string' ? value.replace(/<[^>]*>/g, '').trim() : '';
25
+ }
26
+
27
+ describe('Language category quality', () => {
28
+ it('has one registered category with a usable icon and unique tools', () => {
29
+ expect(languageCategory.icon.trim()).not.toBe('');
30
+ expect(languageCategory.tools.length).toBeGreaterThan(0);
31
+ const ids = languageCategory.tools.map((tool) => tool.id);
32
+ expect(new Set(ids).size).toBe(ids.length);
33
+ });
34
+
35
+ it('declares every locale in the category registry', () => {
36
+ expect(Object.keys(languageCategory.i18n).sort()).toEqual([...EXPECTED_LOCALES].sort());
37
+ for (const locale of EXPECTED_LOCALES) {
38
+ expect(typeof languageCategory.i18n[locale]).toBe('function');
39
+ }
40
+ });
41
+
42
+ it('keeps each locale source independent and explicit about its slug', () => {
43
+ expect(existsSync(join(CATEGORY_DIR, 'shared.ts'))).toBe(false);
44
+ for (const locale of EXPECTED_LOCALES) {
45
+ const source = readFileSync(join(CATEGORY_DIR, `${locale}.ts`), 'utf8');
46
+ expect(source, `${locale}.ts must declare its own slug`).toMatch(/(?:const\s+slug\s*=|\bslug\s*:)/);
47
+ expect(source, `${locale}.ts must not import a shared category translation`).not.toContain("from './shared'");
48
+ }
49
+ });
50
+
51
+ it('uses valid localized slugs and complete metadata in every locale', async () => {
52
+ for (const locale of EXPECTED_LOCALES) {
53
+ const content = await languageCategory.i18n[locale]!() as CategoryContent;
54
+ expect(content.slug).toBe(EXPECTED_SLUGS[locale]);
55
+ expect(content.slug).toMatch(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
56
+ expect(content.title.length).toBeGreaterThanOrEqual(5);
57
+ expect(content.title.length).toBeLessThanOrEqual(70);
58
+ expect(content.description.length).toBeGreaterThanOrEqual(20);
59
+ expect(content.description.length).toBeLessThanOrEqual(220);
60
+ expect(content.title).not.toMatch(/[|]/);
61
+ expect(content.description).not.toContain('\uFFFD');
62
+ expect(content.seo.length).toBeGreaterThan(0);
63
+ }
64
+ });
65
+
66
+ it('keeps SEO structure and useful text in parity with English', async () => {
67
+ const english = await languageCategory.i18n.en!() as CategoryContent;
68
+ const englishTypes = english.seo.map((section) => section.type);
69
+
70
+ for (const locale of EXPECTED_LOCALES) {
71
+ const content = await languageCategory.i18n[locale]!() as CategoryContent;
72
+ expect(content.seo.map((section) => section.type), locale).toEqual(englishTypes);
73
+ if (locale !== 'en') {
74
+ expect(content.title).not.toBe(english.title);
75
+ }
76
+
77
+ for (const section of content.seo) {
78
+ expect(SEO_TYPES.has(String(section.type)), `${locale} has an unsupported SEO section type`).toBe(true);
79
+ const text = sectionText(section);
80
+ if (section.type === 'title') {
81
+ expect(text.length, `${locale} SEO title is empty`).toBeGreaterThanOrEqual(8);
82
+ }
83
+ if (section.type === 'paragraph') {
84
+ expect(text.length, `${locale} SEO paragraph is too short`).toBeGreaterThanOrEqual(20);
85
+ }
86
+ if (section.type === 'stats') {
87
+ expect(Array.isArray(section.items), `${locale} SEO stats need items`).toBe(true);
88
+ expect((section.items as unknown[]).length).toBeGreaterThan(0);
89
+ }
90
+ expect(JSON.stringify(section)).not.toContain('\uFFFD');
91
+ }
92
+ }
93
+ });
94
+ });
@@ -8,15 +8,15 @@ const EXPECTED_SLUGS = {
8
8
  fr: 'langues',
9
9
  id: 'bahasa',
10
10
  it: 'lingue',
11
- ja: 'gengo',
12
- ko: 'eoneo',
11
+ ja: 'language',
12
+ ko: 'language',
13
13
  nl: 'talen',
14
14
  pl: 'jezyki',
15
15
  pt: 'idiomas',
16
16
  ru: 'yazyki',
17
17
  sv: 'sprak',
18
18
  tr: 'diller',
19
- zh: 'yuyan',
19
+ zh: 'language',
20
20
  } as const;
21
21
 
22
22
  describe('Category slug localization', () => {
@@ -0,0 +1,31 @@
1
+ import { readdirSync, readFileSync, statSync } from 'node:fs';
2
+ import { join, relative } from 'node:path';
3
+
4
+ export const repositoryRoot = process.cwd();
5
+ export const toolRoot = join(repositoryRoot, 'src', 'tool');
6
+
7
+ export function listToolDirectories(): string[] {
8
+ return readdirSync(toolRoot)
9
+ .map((name) => join(toolRoot, name))
10
+ .filter((path) => statSync(path).isDirectory());
11
+ }
12
+
13
+ export function findFiles(directory: string, extensions: string[]): string[] {
14
+ const files: string[] = [];
15
+
16
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
17
+ const path = join(directory, entry.name);
18
+ if (entry.isDirectory()) files.push(...findFiles(path, extensions));
19
+ else if (extensions.some((extension) => entry.name.endsWith(extension))) files.push(path);
20
+ }
21
+
22
+ return files;
23
+ }
24
+
25
+ export function read(path: string): string {
26
+ return readFileSync(path, 'utf8');
27
+ }
28
+
29
+ export function displayPath(path: string): string {
30
+ return relative(repositoryRoot, path).replace(/\\/g, '/');
31
+ }
@@ -0,0 +1,50 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { ALL_TOOLS } from '../tools';
3
+ import type { ToolLocaleContent } from '../types';
4
+
5
+ interface LinkFailure {
6
+ tool: string;
7
+ message: string;
8
+ }
9
+
10
+ function validateLink(tool: string, entry: { url: string }, seen: Set<string>): LinkFailure[] {
11
+ const failures: LinkFailure[] = [];
12
+ let url: URL;
13
+ try {
14
+ url = new URL(entry.url);
15
+ } catch {
16
+ return [{ tool, message: `invalid URL: ${entry.url}` }];
17
+ }
18
+
19
+ if (url.protocol !== 'https:') {
20
+ failures.push({ tool, message: `non-HTTPS URL: ${entry.url}` });
21
+ }
22
+ if (url.pathname === '/' && !url.search && !url.hash) {
23
+ failures.push({ tool, message: `generic homepage, cite the exact document: ${entry.url}` });
24
+ }
25
+ if (seen.has(url.href)) {
26
+ failures.push({ tool, message: `duplicate source URL: ${entry.url}` });
27
+ }
28
+ seen.add(url.href);
29
+ return failures;
30
+ }
31
+
32
+ async function validateTool(tool: typeof ALL_TOOLS[number]): Promise<LinkFailure[]> {
33
+ const loader = tool.entry.i18n.en;
34
+ if (!loader) {
35
+ return [{ tool: tool.entry.id, message: 'English locale loader is missing' }];
36
+ }
37
+
38
+ const content = (await loader()) as ToolLocaleContent;
39
+ const seen = new Set<string>();
40
+ return (content.bibliography ?? []).flatMap((entry) => validateLink(tool.entry.id, entry, seen));
41
+ }
42
+
43
+ describe('QA: bibliography links are specific and usable', () => {
44
+ it('uses unique HTTPS links to exact source pages instead of generic homepages', async () => {
45
+ const failures = (await Promise.all(ALL_TOOLS.map(validateTool))).flat();
46
+
47
+ const messages = failures.map(({ tool, message }) => `${tool}: ${message}`);
48
+ expect(messages, `Bibliography hygiene failures:\n${messages.join('\n')}`).toEqual([]);
49
+ });
50
+ });
@@ -0,0 +1,68 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { existsSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { displayPath, listToolDirectories, read } from './qa-test-helpers';
5
+
6
+ const evidenceClaims = [
7
+ /\bofficial algorithm\b/i,
8
+ /\balgoritmo oficial\b/i,
9
+ /\b(?:records|data|rates|tables) updated(?:\s+(?:to|through)\s+20\d{2})?\b/i,
10
+ /\b(?:registros|datos|tasas|tablas) actualizad[oa]s?(?:\s+(?:a|hasta)\s+20\d{2})?\b/i,
11
+ /\b(?:validated|verified) (?:method|algorithm|calculation)\b/i,
12
+ /\b(?:método|algoritmo|cálculo) (?:validado|verificado)\b/i,
13
+ /\b(?:guarantees|ensures)\b/i,
14
+ /\bgarantiza\b/i,
15
+ /\bofficial (?:data|rate|calculation)\b/i,
16
+ /\b(?:datos|tasa|cálculo) oficial(?:es)?\b/i,
17
+ ];
18
+
19
+ const requiredEvidenceFields = [
20
+ 'reviewedAt',
21
+ 'methodology',
22
+ 'sources',
23
+ 'referenceCases',
24
+ 'limitations',
25
+ ];
26
+
27
+ describe('QA: strong factual claims are traceable', () => {
28
+ it('requires machine-readable validation evidence beside tools making strong claims', () => {
29
+ const failures: string[] = [];
30
+
31
+ for (const directory of listToolDirectories()) {
32
+ const localePaths = ['en', 'es']
33
+ .map((locale) => join(directory, 'i18n', `${locale}.ts`))
34
+ .filter(existsSync);
35
+ const claims = localePaths.flatMap((path) => {
36
+ const source = read(path);
37
+ return evidenceClaims
38
+ .filter((pattern) => pattern.test(source))
39
+ .map((pattern) => `${displayPath(path)} matches ${pattern.source}`);
40
+ });
41
+ if (claims.length === 0) continue;
42
+
43
+ const evidencePath = join(directory, 'validation.ts');
44
+ if (!existsSync(evidencePath)) {
45
+ failures.push(`${displayPath(evidencePath)} missing; claims: ${claims.join(' | ')}`);
46
+ continue;
47
+ }
48
+
49
+ const evidence = read(evidencePath);
50
+ const missingFields = requiredEvidenceFields.filter(
51
+ (field) => !new RegExp(`\\b${field}\\s*:`).test(evidence),
52
+ );
53
+ if (missingFields.length > 0) {
54
+ failures.push(`${displayPath(evidencePath)} missing fields: ${missingFields.join(', ')}`);
55
+ }
56
+ }
57
+
58
+ expect(
59
+ failures,
60
+ [
61
+ 'Claims such as official, validated, guaranteed or updated need inspectable evidence.',
62
+ 'Add validation.ts with reviewedAt, methodology, sources, referenceCases and limitations,',
63
+ 'or weaken/remove the unsupported claim.',
64
+ ...failures,
65
+ ].join('\n'),
66
+ ).toEqual([]);
67
+ });
68
+ });
@@ -0,0 +1,45 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { basename, join } from 'node:path';
3
+ import { existsSync } from 'node:fs';
4
+ import {
5
+ displayPath,
6
+ findFiles,
7
+ listToolDirectories,
8
+ read,
9
+ repositoryRoot,
10
+ } from './qa-test-helpers';
11
+
12
+ function hasDedicatedLogicTest(toolDirectory: string): boolean {
13
+ const localCandidates = [
14
+ join(toolDirectory, 'logic.test.ts'),
15
+ join(toolDirectory, 'logic.spec.ts'),
16
+ join(toolDirectory, '__tests__', 'logic.test.ts'),
17
+ join(toolDirectory, '__tests__', 'logic.spec.ts'),
18
+ ];
19
+ if (localCandidates.some(existsSync)) return true;
20
+
21
+ const toolName = basename(toolDirectory);
22
+ const centralTests = findFiles(join(repositoryRoot, 'src', 'tests'), ['.test.ts', '.spec.ts']);
23
+ return centralTests.some((testPath) => {
24
+ const source = read(testPath).replace(/\\/g, '/');
25
+ return source.includes(`/tool/${toolName}/logic`) || source.includes(`../tool/${toolName}/logic`);
26
+ });
27
+ }
28
+
29
+ describe('QA: calculation logic has reference tests', () => {
30
+ it('gives every public calculator logic module its own behavioral test suite', () => {
31
+ const failures = listToolDirectories()
32
+ .filter((directory) => existsSync(join(directory, 'logic.ts')))
33
+ .filter((directory) => !hasDedicatedLogicTest(directory))
34
+ .map((directory) => `${displayPath(join(directory, 'logic.ts'))} -> no test imports this module`);
35
+
36
+ expect(
37
+ failures,
38
+ [
39
+ 'Add behavioral tests through each logic module public API.',
40
+ 'At minimum cover a documented reference case, boundaries, invalid input and invariants.',
41
+ ...failures,
42
+ ].join('\n'),
43
+ ).toEqual([]);
44
+ });
45
+ });
@@ -0,0 +1,99 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { basename, join } from 'node:path';
3
+ import { existsSync } from 'node:fs';
4
+ import {
5
+ displayPath,
6
+ findFiles,
7
+ listToolDirectories,
8
+ read,
9
+ repositoryRoot,
10
+ } from './qa-test-helpers';
11
+
12
+ interface VisibleLiteral {
13
+ line: number;
14
+ value: string;
15
+ }
16
+
17
+ const domTextAssignment = /\.(?:innerText|textContent|innerHTML)\s*=/;
18
+ const quotedLiteral = /(['"`])((?:\\.|(?!\1).)*)\1/g;
19
+
20
+ function visibleWords(value: string): string {
21
+ return value
22
+ .replace(/\$\{[^}]*\}/g, ' ')
23
+ .replace(/<[^>]+>/g, ' ')
24
+ .replace(/&[a-z]+;/gi, ' ')
25
+ .replace(/[\d\p{P}\p{S}_]+/gu, ' ')
26
+ .replace(/\s+/g, ' ')
27
+ .trim();
28
+ }
29
+
30
+ function isTechnicalLiteral(value: string): boolean {
31
+ return ['.', '#', '['].some((prefix) => value.startsWith(prefix))
32
+ || /^data-[a-z0-9-]+$/i.test(value);
33
+ }
34
+
35
+ function hardcodedVisibleLiterals(source: string): VisibleLiteral[] {
36
+ const failures: VisibleLiteral[] = [];
37
+
38
+ source.split(/\r?\n/).forEach((line, index) => {
39
+ if (!domTextAssignment.test(line)) return;
40
+
41
+ const assignment = line.slice(line.search(domTextAssignment));
42
+ for (const match of assignment.matchAll(quotedLiteral)) {
43
+ if (isTechnicalLiteral(match[2])) continue;
44
+ const words = visibleWords(match[2]);
45
+ if (words && /\p{L}/u.test(words)) {
46
+ failures.push({ line: index + 1, value: match[2] });
47
+ }
48
+ }
49
+ });
50
+
51
+ return failures;
52
+ }
53
+
54
+ function runtimeSources(toolDirectory: string): string {
55
+ return findFiles(toolDirectory, ['.astro', '.ts', '.js'])
56
+ .filter((path) => !path.includes(`${join(toolDirectory, 'i18n')}`))
57
+ .filter((path) => basename(path) !== 'ui.ts')
58
+ .map(read)
59
+ .join('\n');
60
+ }
61
+
62
+ describe('QA: runtime copy is localized', () => {
63
+ const componentFiles = findFiles(join(repositoryRoot, 'src', 'tool'), ['.astro']);
64
+
65
+ it('does not write user-facing string literals directly into the DOM', () => {
66
+ const failures = componentFiles.flatMap((path) =>
67
+ hardcodedVisibleLiterals(read(path)).map(
68
+ ({ line, value }) => `${displayPath(path)}:${line} -> ${JSON.stringify(value)}`,
69
+ ),
70
+ );
71
+
72
+ expect(
73
+ failures,
74
+ `Move visible browser copy to the tool UI locale contract:\n${failures.join('\n')}`,
75
+ ).toEqual([]);
76
+ });
77
+
78
+ it('uses every string declared by each UI locale contract', () => {
79
+ const failures: string[] = [];
80
+
81
+ for (const directory of listToolDirectories()) {
82
+ const uiPath = join(directory, 'ui.ts');
83
+ if (!existsSync(uiPath)) continue;
84
+
85
+ const keys = Array.from(read(uiPath).matchAll(/^\s*(\w+)\??:\s*string\s*;/gm), (match) => match[1]);
86
+ const runtime = runtimeSources(directory);
87
+ const unused = keys.filter((key) => !new RegExp(`\\b${key}\\b`).test(runtime));
88
+
89
+ if (unused.length > 0) {
90
+ failures.push(`${displayPath(uiPath)} -> unused: ${unused.join(', ')}`);
91
+ }
92
+ }
93
+
94
+ expect(
95
+ failures,
96
+ `Unused locale keys are dead copy or may mean the browser bypasses translations:\n${failures.join('\n')}`,
97
+ ).toEqual([]);
98
+ });
99
+ });
@@ -1,4 +1,11 @@
1
- export { languageLearningStudyPlanPlanner, LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL } from './entry';
1
+ import type { ToolDefinition } from '../../types';
2
+ import {
3
+ LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL as languageLearningStudyPlanPlannerDefinition,
4
+ } from './entry';
5
+
6
+ export { languageLearningStudyPlanPlanner } from './entry';
2
7
  export type { LanguagePlannerUI, LanguageLearningStudyPlanPlannerLocaleContent } from './entry';
3
8
  export { calculateStudyPlan, GUIDED_HOURS_FROM_BEGINNER, LEVEL_LABELS, PRIORITY_ALLOCATIONS, STUDY_LEVELS } from './logic';
4
9
  export type { LanguagePlannerInputs, PlanStatus, SkillAllocation, StudyLevel, StudyMilestone, StudyPlan } from './types';
10
+
11
+ export const LANGUAGE_LEARNING_STUDY_PLAN_PLANNER_TOOL: ToolDefinition = languageLearningStudyPlanPlannerDefinition;
@@ -0,0 +1,15 @@
1
+ export const validation = {
2
+ reviewedAt: '2026-08-29',
3
+ methodology: 'The planner uses broad guided-learning hour ranges as a planning estimate, subtracts the current level range from the target level range, and compares the result with weeks available at the selected weekly pace.',
4
+ sources: [
5
+ 'https://www.coe.int/en/web/common-european-framework-reference-languages',
6
+ 'https://www.cambridge.org/elt/blog/2020/08/19/how-long-learn-language/',
7
+ ],
8
+ referenceCases: [
9
+ { currentLevel: 'A1', targetLevel: 'B1', expectedHoursRange: '260-300' },
10
+ ],
11
+ limitations: [
12
+ 'The ranges are planning estimates, not a placement test or a guarantee of fluency.',
13
+ 'Language distance, previous exposure, study quality, and real-world practice can materially change the time required.',
14
+ ],
15
+ };