ai-l10n-sdk 1.2.0 → 1.4.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,103 @@
1
+ # Changelog - ai-l10n-sdk
2
+
3
+ All notable changes to the SDK package will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.4.0] - 2026-04-02
9
+
10
+ ### Added
11
+ - **Multi-Format Support** - Translation now works with all text-based localization formats (YAML, PO/gettext, XLIFF, and any format accepted by the API). The `format` field is derived from the source file extension and sent in the request body. See [supported formats](https://l10n.dev/ws/translate-i18n-files#supported-formats)
12
+ - `I18nProjectManager.detectLanguagesFromProject()` now scans paired extensions: `.yaml`/`.yml` and `.xliff`/`.xlf` (same as `.json`/`.jsonc`)
13
+ - `TranslationRequest` has a new optional `format?: string` field
14
+
15
+ ### Changed
16
+ - `validateLanguageCode()` and `normalizeLanguageCode()` removed from `I18nProjectManager` — use these functions directly from `ai-l10n-core` instead
17
+ - Moved `ConsoleLogger` and `L10nTranslationService` tests to `ai-l10n-core` package
18
+ - Removed core-library API sections from README (`ILogger`, `ConsoleLogger`, `L10nTranslationService` and related types); now documented in [ai-l10n-core](https://www.npmjs.com/package/ai-l10n-core)
19
+
20
+ ### Migration
21
+ ```typescript
22
+ // Before
23
+ manager.validateLanguageCode(code);
24
+ manager.normalizeLanguageCode(code);
25
+ manager.extractLanguageCode(fileName);
26
+
27
+ // After
28
+ import { validateLanguageCode, normalizeLanguageCode, extractLanguageCode } from 'ai-l10n-core';
29
+ validateLanguageCode(code);
30
+ normalizeLanguageCode(code);
31
+ extractLanguageCode(fileName);
32
+ ```
33
+
34
+ ## [1.3.0] - 2026-02-12
35
+
36
+ ### Added
37
+ - **Metadata Translation Control** - Added `translateMetadata` configuration option (default: `false`)
38
+ - New optional parameter in `TranslationConfig` interface
39
+ - New optional parameter in `TranslationRequest` interface
40
+ - Allows control over whether metadata is translated along with UI strings
41
+ - For example, in Flutter ARB files, metadata entries like `@key` contain descriptions that can optionally be translated
42
+ - When disabled (default), metadata remains unchanged in target files
43
+
44
+ ## [1.2.0] - 2026-02-04
45
+
46
+ ### Added
47
+ - **JSONC Support** - Added support for `.jsonc` (JSON with Comments) file extension alongside `.json` files
48
+ - **Shopify Theme Localization** - Added support for Shopify theme localization file patterns:
49
+ - Automatically detects and handles files with `.default.` in the name (e.g., `en.default.schema.json`)
50
+ - Removes `.default.` from target file names while preserving language code
51
+ - Preserves `.schema.` suffix in translated files when present in source file
52
+ - Example: `en.default.schema.json` → `es-ES.schema.json`, `fr.schema.json`
53
+
54
+ ### Changed
55
+ - Enhanced `I18nProjectManager.detectLanguagesFromProject()` to scan for both `.json` and `.jsonc` files
56
+ - Updated `I18nProjectManager.extractLanguageCodeFromFileName()` to handle Shopify theme naming patterns
57
+ - Improved `I18nProjectManager.generateTargetFilePath()` to preserve `.schema` suffix in output files
58
+
59
+ ## [1.1.4] - 2025-12-16
60
+
61
+ ### Changed
62
+ - Version bumped to match main package (no functional changes to SDK)
63
+
64
+ ## [1.1.3] - 2025-12-16
65
+
66
+ ### Changed
67
+ - Version bumped to match main package (no functional changes to SDK)
68
+
69
+ ## [1.1.2] - 2025-12-15
70
+
71
+ ### Fixed
72
+ - **Type Exports** - Added missing type exports for better TypeScript support:
73
+ - `I18nProjectManager` class and related types
74
+ - `TranslationRequest`, `TranslationResult`, `FileSchema`, `FinishReason` from translation service
75
+ - `URLS` constants
76
+ - All types now properly accessible when importing from the package
77
+
78
+ ## [1.1.1] - 2025-12-15
79
+
80
+ ### Added
81
+ - **Initial Release** - Independent SDK package extracted from ai-l10n
82
+ - Core translation functionality:
83
+ - `AiTranslator` class with full translation API
84
+ - `L10nTranslationService` for direct API access
85
+ - `ApiKeyManager` for secure API key storage
86
+ - `I18nProjectManager` for project structure detection
87
+ - `ILogger` interface for custom logging
88
+ - `ConsoleLogger` implementation
89
+ - Complete TypeScript support with type definitions
90
+ - Comprehensive test suite (139 passing tests)
91
+ - Full documentation with API examples
92
+ - Support for JSON and ARB file formats
93
+ - Custom logger integration for VS Code extensions and other environments
94
+
95
+ ### Features
96
+ - Translate files to 165+ languages
97
+ - Context-aware AI translations
98
+ - Incremental translation (translate only new strings)
99
+ - Type-safe JSON handling
100
+ - Automatic language detection
101
+ - Plural forms generation
102
+ - Content filtering with separate filtered strings output
103
+ - Usage tracking and balance monitoring