i18next-mcp-server
Version:
A comprehensive Model Context Protocol (MCP) server for i18next translation management, health checking, and automated translation workflows
68 lines (67 loc) • 1.84 kB
TypeScript
import type { I18nConfig } from '../types/index.js';
export interface ScannerResult {
success: boolean;
extractedKeys: string[];
totalKeys: number;
affectedFiles: string[];
errors: string[];
scanTime: number;
outputPath?: string;
}
export interface MissingKeysAnalysis {
language: string;
namespace: string;
missingKeys: string[];
totalMissing: number;
}
export interface UsageAnalysis {
totalUsedKeys: number;
unusedKeys: string[];
orphanedKeys: string[];
keysByNamespace: Record<string, string[]>;
keysByFile: Record<string, string[]>;
}
export declare class I18nextScannerIntegration {
private config;
private projectRoot;
constructor(config: I18nConfig);
/**
* Run i18next-scanner to extract keys from codebase
*/
scanCodebase(options?: {
extract?: boolean;
clean?: boolean;
namespace?: string;
createBackup?: boolean;
}): Promise<ScannerResult>;
/**
* Analyze missing keys across all languages and namespaces
*/
analyzeMissingKeys(): Promise<MissingKeysAnalysis[]>;
/**
* Analyze key usage patterns and find orphaned keys
*/
analyzeKeyUsage(): Promise<UsageAnalysis>;
/**
* Synchronize missing keys across all languages
*/
syncMissingKeys(options?: {
sourceLanguage?: string;
targetLanguages?: string[];
namespaces?: string[];
placeholder?: string;
dryRun?: boolean;
}): Promise<{
success: boolean;
changes: Record<string, number>;
errors: string[];
}>;
private parseExtractedKeys;
private parseAffectedFiles;
private readJSONFile;
private writeJSONFile;
private flattenKeys;
private getNestedValue;
private setNestedValue;
private cleanupTempFiles;
}