MCPcopy Create free account
hub / github.com/Devographics/Monorepo / processStringFile

Function processStringFile

api/src/helpers/locales.ts:265–290  ·  view source on GitHub ↗
({
    locale,
    stringFile,
    enStringFile,
    report
}: {
    locale: RawLocale
    stringFile: StringFile
    enStringFile?: StringFile
    report: any
})

Source from the content-addressed store, hash-verified

263
264*/
265export const processStringFile = ({
266 locale,
267 stringFile,
268 enStringFile,
269 report
270}: {
271 locale: RawLocale
272 stringFile: StringFile
273 enStringFile?: StringFile
274 report: any
275}) => {
276 let processedStringFile = resolveAliases({ enStringFile, stringFile, locale, report })
277 processedStringFile = parseMarkdown(processedStringFile)
278 if (enStringFile) {
279 processedStringFile = addFallbacks(processedStringFile, locale, enStringFile)
280 }
281 // add stringFile's context to every one of its strings
282 processedStringFile.strings = processedStringFile.strings.map(s => ({
283 ...s,
284 context: stringFile.context
285 }))
286
287 checkForDuplicates(locale, processedStringFile.strings, stringFile.context, report)
288
289 return processedStringFile
290}
291
292export const initLocaleReport = () => ({
293 missingContexts: [] as string[],

Callers 2

processLocaleFunction · 0.85
processLocalesFunction · 0.85

Calls 4

resolveAliasesFunction · 0.85
parseMarkdownFunction · 0.85
addFallbacksFunction · 0.85
checkForDuplicatesFunction · 0.85

Tested by

no test coverage detected