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