Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement โ†’
Sign In

localize-ai

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

localize-ai - npm Package Compare versions

Comparing version
1.5.0
to
1.5.1
+1
-1
package.json
{
"name": "localize-ai",
"version": "1.5.0",
"version": "1.5.1",
"description": "AI-powered React localization with AST-based extraction, namespace-based loading, smart caching, debug mode and multi-provider support",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -43,2 +43,3 @@ # localize-ai

- ๐Ÿž Debug mode (highlight translated & missing strings in UI)
- ๐Ÿงช Dry-run mode (preview extraction & translation without modifying files)

@@ -126,2 +127,85 @@ ---

## ๐Ÿž Debug Mode
localize-ai provides a built-in debug mode to visualize translation status directly in your UI.
Enable debug mode:
```
<LanguageContextProvider debug={true}>
<App />
</LanguageContextProvider>
```
Behavior:
๐ŸŸข Translated strings โ†’ highlighted in green
๐ŸŸก Missing translations โ†’ highlighted in custom color
Configure debug color:
```
// localize.config.js
export default {
sourceLanguage: "en",
translationLanguages: ["hi", "fr", "es", "ar"],
provider: "gemini",
apikey: "VITE_GEMINI_API_KEY",
debugColor: "yellow",
context: "Kit kat condolence message page"
};
```
๐Ÿ‘‰ Helps quickly identify missing translations during development.
---
## ๐Ÿงช Dry Run Mode
localize-ai supports a dry-run mode to preview the entire localization pipeline without writing any translations.
Run dry-run:
```
npx localize-ai translate --dry-run
```
What it does:
* Extracts strings using AST
* Validates template literals
* Detects missing / partial translations
* Shows summary without modifying files
* Example output:
```
๐Ÿงช Running dry-run (no translations will be made)...
โŒ Invalid template literal detected
๐Ÿ“„ File: src/App.jsx
๐Ÿ“ Line: 82
๐Ÿ‘‰ Use {{var}} instead of ${var}
โœ… Extraction complete with namespaces
โœ… Cleaned namespaces: 2
๐Ÿš€ Starting localization pipeline
โ„น๏ธ Provider: gemini
โ„น๏ธ Source Language: en
โ„น๏ธ Target Languages: hi, fr, es, ar
๐Ÿ“Š Summary:
Total input strings: 22
๐Ÿ†• New strings: 0
๐ŸŒ Missing translations: 0
โš ๏ธ Partial translations: 0
Translated now: 0
Total stored translations: 22
โœ… Done
```
Why use dry-run?
๐Ÿ›ก๏ธ Safe preview before running translations
๐Ÿ” Catch errors (like invalid template literals)
๐Ÿ“Š Understand translation coverage
๐Ÿ‘‰ Ideal for CI checks and debugging.
---
## ๐Ÿ“ฆ Installation

@@ -309,2 +393,3 @@

npx localize-ai delete-sync # delete dead translations
npx localize-ai translate --dry-run # preview without writing files
```

@@ -311,0 +396,0 @@