MCPcopy
hub / github.com/lingodotdev/lingo.dev / TranslationCache

Interface TranslationCache

packages/new-compiler/src/translators/cache.ts:15–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13 * Implementations can be local disk, remote server, memory, etc.
14 */
15export interface TranslationCache {
16 /**
17 * Get cached translations for a locale
18 * Returns empty object if no cache exists
19 */
20 get(locale: LocaleCode): Promise<Record<string, string>>;
21 get(locale: LocaleCode, hashes: string[]): Promise<Record<string, string>>;
22
23 /**
24 * Update cache with new translations
25 * Merges with existing cache (doesn't replace)
26 */
27 update(
28 locale: LocaleCode,
29 translations: Record<string, string>,
30 ): Promise<void>;
31
32 /**
33 * Replace entire cache for a locale
34 */
35 set(locale: LocaleCode, translations: Record<string, string>): Promise<void>;
36
37 /**
38 * Check if cache exists for a locale
39 */
40 has(locale: LocaleCode): Promise<boolean>;
41
42 /**
43 * Clear cache for a specific locale
44 */
45 clear(locale: LocaleCode): Promise<void>;
46
47 /**
48 * Clear all cached translations
49 */
50 clearAll(): Promise<void>;
51}
52
53/**
54 * Configuration for local disk cache

Callers 34

getLocaleFromCookiesFunction · 0.65
loadLocaleFromCookiesFunction · 0.65
loadLocaleFromHeadersFunction · 0.65
loadLocaleFromCookiesFunction · 0.65
getAstByKeyFunction · 0.65
ProgramFunction · 0.65
CallExpressionFunction · 0.65
JSXExpressionContainerFunction · 0.65
getDistinctIdFunction · 0.65
closePullRequestMethod · 0.65
createDatoClientFunction · 0.65
getDistinctIdFunction · 0.65

Implementers 2

LocalTranslationCachepackages/new-compiler/src/translators/
MemoryTranslationCachepackages/new-compiler/src/translators/

Calls

no outgoing calls

Tested by

no test coverage detected