(filepath: string)
| 34 | * e.g., 'src/2014/de/5e-SRD-Spells.json' -> 'src/2014/en/5e-SRD-Spells.json' |
| 35 | */ |
| 36 | export function getEnglishSourcePath(filepath: string): string | null { |
| 37 | const parts = filepath.split('/'); |
| 38 | const yearIdx = parts.findIndex((p) => YEAR_DIR_PATTERN.test(p)); |
| 39 | if (yearIdx < 0) return null; |
| 40 | const localeSegment = parts[yearIdx + 1]; |
| 41 | if (!localeSegment || !LOCALE_PATTERN.test(localeSegment)) return null; |
| 42 | const result = [...parts]; |
| 43 | result[yearIdx + 1] = 'en'; |
| 44 | return result.join('/'); |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Validates a single translation entry against the English source map and |
no outgoing calls
no test coverage detected