Open KonradLinkowski opened 2 years ago
maybe, you can try converting to js in the transform function of the config.js file
Use a custom transform, you can easily compile ts/tsx file to ES5/ES6 and extract translations.
Maybe a bit late. Anyhow, this is what we use to scan tsx files:
rm -rf tmp/i18n && npx tsc --skipLibCheck -target es6 --module esnext --jsx preserve --outDir tmp/i18n && npx i18next-scanner --config i18next-scanner.config.js tmp/i18n/**/*.{js,jsx} && rm -rf tmp/i18n
Don't know about plans, but this should help parsing ts files https://github.com/i18next/i18next-scanner/issues/88#issuecomment-562446459
https://github.com/lingui/js-lingui supports extraction from ts files no problem, you can try that for i18n
🚀 Feature Proposal
Support for TypeScript files
Motivation
It's impossible to parse
.ts
and.tsx
files now which makes it hard to use with any modern projectExample
It would fix errors like:
It would close #88 and #179