translatronx 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -490,6 +490,84 @@ translatronx retry --dry-run
490
490
 
491
491
  ---
492
492
 
493
+ ### `translatronx import`
494
+
495
+ Import existing translations into the ledger (for integrating with existing projects).
496
+
497
+ ```bash
498
+ translatronx import [options]
499
+ ```
500
+
501
+ **Options:**
502
+ - `--source <path>` - Source language file path (overrides config)
503
+ - `--targets <paths>` - Target language files (comma-separated)
504
+ - `--lang-map <json>` - JSON mapping of file paths to language codes
505
+ - `--dry-run` - Show what would be imported without making changes
506
+ - `--force` - Overwrite existing ledger entries
507
+
508
+ **Examples:**
509
+
510
+ ```bash
511
+ # Import from existing translation files (auto-detect from config)
512
+ translatronx import
513
+
514
+ # Import specific target files
515
+ translatronx import --targets "locales/fr.json,locales/de.json"
516
+
517
+ # Import with explicit language mapping
518
+ translatronx import --lang-map '{"locales/french.json":"fr","locales/german.json":"de"}'
519
+
520
+ # Preview import without making changes
521
+ translatronx import --dry-run
522
+ ```
523
+
524
+ **Use Cases:**
525
+
526
+ 1. **Migrating to Translatronx:**
527
+ ```bash
528
+ # You have existing translations in locales/
529
+ translatronx import
530
+ translatronx sync # Only translates new/missing keys
531
+ ```
532
+
533
+ 2. **Adding New Languages:**
534
+ ```bash
535
+ # You have 8 languages, want to add 2 more
536
+ # Update config with 10 target languages
537
+ translatronx sync # Automatically translates only the 2 new languages
538
+ ```
539
+
540
+ 3. **Partial Translations:**
541
+ ```bash
542
+ # Import what you have, sync fills in the gaps
543
+ translatronx import --targets "locales/fr.json" # 60% coverage
544
+ translatronx sync # Translates the missing 40%
545
+ ```
546
+
547
+ **Output:**
548
+ ```
549
+ 📊 Analyzing coverage...
550
+
551
+ fr:
552
+ Total keys: 127
553
+ Matched keys: 120
554
+ Missing keys: 7
555
+ Coverage: 94.5%
556
+
557
+ ✅ Import Statistics:
558
+
559
+ Total records: 120
560
+ Imported: 120
561
+ Skipped: 0
562
+ Errors: 0
563
+ Languages: fr
564
+ Duration: 245ms
565
+
566
+ 💡 Tip: Run "translatronx status" to verify the import
567
+ ```
568
+
569
+ ---
570
+
493
571
  ### `translatronx check`
494
572
 
495
573
  Validate target files without making changes.