detecta
v2.1.7
Published
**Detecta** is a simple but powerful tool for developers and project managers to find text in their code that hasn't been translated yet. It scans your files for specific languages and tells you exactly where you might have forgotten to use a translation
Downloads
82
Readme
🔍 Detecta
Detecta is a simple but powerful tool for developers and project managers to find text in their code that hasn't been translated yet. It scans your files for specific languages and tells you exactly where you might have forgotten to use a translation system.
✨ What can it do?
- 🌍 Multiple Languages: Supports Spanish (🇲🇽), English (🇺🇸), German (🇩🇪), French (🇫🇷), Italian (🇮🇹), and Portuguese (🇵🇹).
- 🤖 Smart Auto-Detection: Detecta can figure out the language of each file automatically.
- 📂 Works Everywhere: Scans JS, TS, HTML, Vue, PHP, and JSON files.
- 🛠️ Auto-Fix: Can automatically wrap untranslated text in translation functions.
- 💬 Check Comments: Scans hidden developer notes (comments).
- 📊 Professional Reports: Create beautiful HTML or JSON reports.
- ⚡ Super Fast: Scans multiple files at once and remembers unchanged files to save time.
🚀 How to use it
1. Simple Scan
Find all Spanish text:
npx detecta es2. Automatic Fix
Automatically wrap found text in t('...') functions:
npx detecta es --fix3. Automatic Scan
Let the tool decide the language:
npx detecta --auto4. Interactive Review
Review findings one by one:
npx detecta en --interactive⚙️ Options at a Glance
| Option | Shortcut | What it does |
| :-------------- | :------- | :----------------------------------------------------------- |
| --auto | -a | Automatically detects the language of each file. |
| --fix | | New: Automatically wraps raw strings in t() functions. |
| --no-comments | -nc | Ignores code comments. |
| --interactive | -i | Review each finding one by one. |
| --ignore | -ig | Ignore specific extensions (e.g., .json,.html). |
| --only | -o | Only scan specific extensions (e.g., .tsx). |
| --format | | Choose output: text, json, or html. |
| --output | | Save the results to a specific file. |
🛠️ Configuration
Create a .detectarc (or .detectarc.json) to save your team's settings.
Advanced Options
// detecta-ignore: Add this comment to any line to ignore it forever.ignorePatterns: List of folders/files to skip using glob patterns.customWords: List of your brand names or technical terms to whitelist.
Example .detectarc
{
"language": "es",
"auto": false,
"noComments": false,
"ignorePatterns": ["tests/**", "dist/**", "legacy/*"],
"customWords": ["MyBrandName", "Qleen", "AppStore"],
"only": ".js,.jsx,.ts,.tsx",
"failOnRaw": true,
"format": "text"
}Detecta is built to help you launch global products with confidence. Never leave a "Hola" or "Hello" where it shouldn't be!
