@imgly/plugin-ai-generation-web 0.2.14 → 0.2.16

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 CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.2.16] - 2026-01-16
6
+
7
+ ### New Features
8
+
9
+ - [all] **Translatable Action Labels**: AI plugin action labels now support full i18n through `labelKey` property, enabling dynamic translation resolution based on the current locale.
10
+ - [generation-web] **setDefaultTranslations Utility**: Added `setDefaultTranslations()` function that only sets translation keys that don't already exist, allowing integrators to customize translations before plugins load without being overwritten.
11
+ - [all] **External Translation Files**: Plugin translations are now loaded from external `translations.json` files, making it easier to review and customize available translation keys.
12
+
13
+ ### Improvements
14
+
15
+ - [all] **Translation Override Pattern**: All AI plugins now use `setDefaultTranslations()` instead of `setTranslations()`, ensuring integrator-provided translations take priority over plugin defaults.
16
+ - [apps-web] **Dynamic Card Labels**: AI Apps panel now resolves card labels dynamically using `labelKey` from action metadata, enabling proper i18n for app cards.
17
+
18
+ ### Documentation
19
+
20
+ - [all] Added comprehensive i18n documentation to README files explaining how to customize translations before plugin initialization.
21
+
22
+ ## [0.2.15] - 2026-01-12
23
+
24
+ ### New Features
25
+
26
+ - [all] **EachLabs Partner Integration**: Added EachLabs as a new AI provider service with unified API access to multiple image and video generation models.
27
+ - **Image Generation**: Flux 2 Pro, Flux 2, Flux 2 Flex, Nano Banana Pro, OpenAI GPT Image, Seedream v4.5, Gemini 3 Pro (all with text-to-image and image-to-image variants)
28
+ - **Video Generation**: Kling v2.6 Pro, Kling O1, Veo 3.1 (text-to-video and image-to-video variants)
29
+
5
30
  ## [0.2.14] - 2025-12-15
6
31
 
7
32
  ## [0.2.13] - 2025-12-15
package/README.md CHANGED
@@ -1505,6 +1505,116 @@ interface QuickActionDefinition<Q extends Record<string, any>> {
1505
1505
  }
1506
1506
  ```
1507
1507
 
1508
- ## Translations
1508
+ ## Internationalization (i18n)
1509
1509
 
1510
- For customization and localization, see the [translations.json](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web/translations.json) file which contains base translation keys that can be overridden for all AI plugins.
1510
+ The AI plugins support full internationalization, allowing integrators to customize all user-facing text. The translation system is designed to let integrators override default translations **before** plugins are loaded.
1511
+
1512
+ ### Custom Translations
1513
+
1514
+ To customize translations, call `cesdk.i18n.setTranslations()` **before** adding the AI plugins:
1515
+
1516
+ ```typescript
1517
+ import CreativeEditorSDK from '@cesdk/cesdk-js';
1518
+ import AiApps from '@imgly/plugin-ai-apps-web';
1519
+
1520
+ CreativeEditorSDK.create(domElement, {
1521
+ license: 'your-license-key',
1522
+ locale: 'de' // Set your desired locale
1523
+ }).then(async (cesdk) => {
1524
+ // Set custom translations BEFORE adding plugins
1525
+ cesdk.i18n.setTranslations({
1526
+ en: {
1527
+ // Override AI Apps labels
1528
+ '@imgly/plugin-ai-image-generation-web.action.label': 'Create Image',
1529
+ '@imgly/plugin-ai-video-generation-web.action.label': 'Create Video',
1530
+
1531
+ // Override provider-specific labels
1532
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.style': 'Art Style',
1533
+ 'ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.style.realistic_image': 'Photo Realistic'
1534
+ },
1535
+ de: {
1536
+ // German translations
1537
+ '@imgly/plugin-ai-image-generation-web.action.label': 'Bild erstellen',
1538
+ '@imgly/plugin-ai-video-generation-web.action.label': 'Video erstellen',
1539
+ 'common.generate': 'Generieren',
1540
+ 'panel.ly.img.ai.apps': 'KI'
1541
+ }
1542
+ });
1543
+
1544
+ // Now add the plugins - they won't override your custom translations
1545
+ await cesdk.addPlugin(AiApps({ providers: { /* ... */ } }));
1546
+ });
1547
+ ```
1548
+
1549
+ ### How It Works
1550
+
1551
+ The AI plugins use `setDefaultTranslations()` internally, which only sets translation keys that don't already exist. This means:
1552
+
1553
+ 1. **Your translations take priority**: Any translations you set before loading plugins are preserved
1554
+ 2. **Fallback to defaults**: Keys you don't customize will use the plugin's default English translations
1555
+ 3. **Locale support**: Set translations for any locale supported by CE.SDK
1556
+
1557
+ ### Translation Key Structure
1558
+
1559
+ Translation keys follow a consistent naming pattern:
1560
+
1561
+ ```
1562
+ ly.img.plugin-ai-{type}-generation-web.{provider-id}.property.{property-name}.{value}
1563
+ ```
1564
+
1565
+ For example:
1566
+ - `ly.img.plugin-ai-image-generation-web.fal-ai/recraft-v3.property.style.realistic_image`
1567
+ - `ly.img.plugin-ai-video-generation-web.fal-ai/veo-3.property.duration.5s`
1568
+
1569
+ ### Action Labels
1570
+
1571
+ Each AI plugin registers an action with a translatable label. The action uses both a static `label` (for backwards compatibility) and a `labelKey` for dynamic i18n resolution:
1572
+
1573
+ | Plugin | Label Key |
1574
+ |--------|-----------|
1575
+ | Image Generation | `@imgly/plugin-ai-image-generation-web.action.label` |
1576
+ | Video Generation | `@imgly/plugin-ai-video-generation-web.action.label` |
1577
+ | Audio Generation (Sound) | `@imgly/plugin-ai-audio-generation-web.sound.action.label` |
1578
+ | Audio Generation (Speech) | `@imgly/plugin-ai-audio-generation-web.speech.action.label` |
1579
+ | Sticker Generation | `@imgly/plugin-ai-sticker-generation-web.action.label` |
1580
+
1581
+ ### Translation Files
1582
+
1583
+ Each AI plugin includes a `translations.json` file with all available translation keys:
1584
+
1585
+ - [Base translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web/translations.json) - Core translation keys
1586
+ - [AI Apps translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-apps-web/translations.json) - AI Apps panel labels
1587
+ - [Image generation translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-image-generation-web/translations.json) - Image generation interfaces
1588
+ - [Video generation translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-video-generation-web/translations.json) - Video generation interfaces
1589
+ - [Text generation translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-text-generation-web/translations.json) - Text generation interfaces
1590
+ - [Audio generation translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-audio-generation-web/translations.json) - Audio generation interfaces
1591
+ - [Sticker generation translations](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-sticker-generation-web/translations.json) - Sticker generation interfaces
1592
+
1593
+ ### Exported Utilities
1594
+
1595
+ The package exports translation utilities for use in custom providers:
1596
+
1597
+ ```typescript
1598
+ import {
1599
+ setDefaultTranslations,
1600
+ createTranslationCallback,
1601
+ buildTranslationKeys
1602
+ } from '@imgly/plugin-ai-generation-web';
1603
+
1604
+ // Set translations that won't override existing keys
1605
+ setDefaultTranslations(cesdk, {
1606
+ en: { 'my.key': 'My Value' }
1607
+ });
1608
+
1609
+ // Create a translation callback for asset sources
1610
+ const translateLabel = createTranslationCallback(cesdk, 'my-provider', 'style', 'image');
1611
+
1612
+ // Build translation keys with fallback order
1613
+ const keys = buildTranslationKeys('my-provider', 'style', 'realistic', 'image');
1614
+ // Returns: [
1615
+ // 'ly.img.plugin-ai-image-generation-web.my-provider.property.style.realistic',
1616
+ // 'ly.img.plugin-ai-generation-web.property.style.realistic',
1617
+ // 'ly.img.plugin-ai-image-generation-web.my-provider.defaults.property.style.realistic',
1618
+ // 'ly.img.plugin-ai-generation-web.defaults.property.style.realistic'
1619
+ // ]
1620
+ ```