({
locale,
stringFile,
enStringFile,
report
}: {
locale: RawLocale
stringFile: StringFile
enStringFile?: StringFile
report: any
})
| 263 | |
| 264 | */ |
| 265 | export 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 | |
| 292 | export const initLocaleReport = () => ({ |
| 293 | missingContexts: [] as string[], |
no test coverage detected