MCPcopy Create free account
hub / github.com/5e-bits/5e-database / resolveTranslationContext

Function resolveTranslationContext

scripts/update/processor.ts:352–362  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

350}
351
352async function resolveTranslationContext(filepath: string): Promise<TranslationContext | null> {
353 const lang = getLocaleFromFilepath(filepath);
354 if (!lang) return null;
355 const filename = filepath.split('/').pop()!;
356 const indexName = getIndexName(filename);
357 if (!indexName) return null;
358 const enPath = getEnglishSourcePath(filepath);
359 if (!enPath) return null;
360 const enData = await readFileContent(enPath);
361 return { lang, indexName, enMap: buildIndexMap(enData) };
362}
363
364// --- Translation Handlers ---
365

Callers 2

Calls 5

getLocaleFromFilepathFunction · 0.90
getIndexNameFunction · 0.90
getEnglishSourcePathFunction · 0.90
buildIndexMapFunction · 0.90
readFileContentFunction · 0.85

Tested by

no test coverage detected