UNPKG

i18n-ai-translate

Version:

AI-powered localization CLI, Node library, and GitHub Action. Translate i18next JSON, Gettext PO, Java .properties, and iOS .strings with ChatGPT, Claude, Gemini, or local Ollama models.

30 lines (29 loc) 906 B
import type { Model } from "../types"; export type TranslationCacheParams = { model: Model; inputLanguageCode: string; outputLanguageCode: string; keyPath: string; originalValue: string; }; type ConfigureParams = { enabled: boolean; cacheDirectory?: string; }; export default class TranslationCache { private static cache; private static loaded; private static enabled; private static cacheDirectory; private static readonly cacheFilename; static configure({ enabled, cacheDirectory, }: ConfigureParams): void; static isEnabled(): boolean; static get(params: TranslationCacheParams): string | undefined; static set(params: TranslationCacheParams, translatedValue: string): void; static clear(): void; private static ensureLoaded; private static persist; private static cacheFilePath; private static buildKey; } export {};