lingodotdev 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +5 -6
- data/lib/lingodotdev/version.rb +1 -1
- data/lib/lingodotdev.rb +6 -6
- data/spec/lingo_dot_dev/engine_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28c83f0fada39ed4eec6b9d0b67917fac54a45fc6d8d11b50389f282f49a322c
|
|
4
|
+
data.tar.gz: bdca77419544b1253dd3aecc752f07a92c3acab361f8693d7069f3d74d247160
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 458753b774866b16fd4d960ba5e52bcff42b8c322ea3bab294943590ba0a04a09206182fbffcbf9c0fdd51269c542214a689da47893c9519efc7ee8961b2b730
|
|
7
|
+
data.tar.gz: e002510b545296b9b358713113e86d8f1a6aa08d233c2770b04e89730ad291fa6a77e85f2167cf32d3e3c574da048b6d48a3f08264287f1ce42657ed45a5c728
|
data/README.md
CHANGED
|
@@ -210,13 +210,12 @@ result = engine.localize_text(
|
|
|
210
210
|
|
|
211
211
|
### Reference context
|
|
212
212
|
|
|
213
|
-
Provide
|
|
213
|
+
Provide existing translations as reference to improve translation accuracy. The `reference` hash maps locale codes to key-value content objects:
|
|
214
214
|
|
|
215
215
|
```ruby
|
|
216
216
|
reference = {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
domain: 'business'
|
|
217
|
+
'es' => { 'greeting' => 'Hola', 'farewell' => 'Adiós' },
|
|
218
|
+
'fr' => { 'greeting' => 'Bonjour', 'farewell' => 'Au revoir' }
|
|
220
219
|
}
|
|
221
220
|
|
|
222
221
|
result = engine.localize_text(
|
|
@@ -314,7 +313,7 @@ Localizes a string to the target locale.
|
|
|
314
313
|
- `text` (String): Text to localize
|
|
315
314
|
- `target_locale` (String): Target locale code (e.g., 'es', 'fr', 'ja')
|
|
316
315
|
- `source_locale` (String): Source locale code (e.g., 'en')
|
|
317
|
-
- `reference` (Hash, optional):
|
|
316
|
+
- `reference` (Hash, optional): Existing translations keyed by locale code, e.g. `{ 'es' => { 'key' => 'valor' } }`
|
|
318
317
|
- `on_progress` (Proc, optional): Progress callback
|
|
319
318
|
- `concurrent` (Boolean): Enable concurrent processing
|
|
320
319
|
- `&block`: Alternative progress callback
|
|
@@ -342,7 +341,7 @@ Localizes an HTML document while preserving structure and formatting. Handles bo
|
|
|
342
341
|
- `html` (String): HTML document string to localize
|
|
343
342
|
- `target_locale` (String): Target locale code (e.g., 'es', 'fr', 'ja')
|
|
344
343
|
- `source_locale` (String): Source locale code (e.g., 'en')
|
|
345
|
-
- `reference` (Hash, optional):
|
|
344
|
+
- `reference` (Hash, optional): Existing translations keyed by locale code, e.g. `{ 'es' => { 'key' => 'valor' } }`
|
|
346
345
|
- `on_progress` (Proc, optional): Progress callback
|
|
347
346
|
- `concurrent` (Boolean): Enable concurrent processing
|
|
348
347
|
- `&block`: Alternative progress callback
|
data/lib/lingodotdev/version.rb
CHANGED
data/lib/lingodotdev.rb
CHANGED
|
@@ -190,7 +190,7 @@ module LingoDotDev
|
|
|
190
190
|
# @param target_locale [String] the target locale code (e.g., 'es', 'fr', 'ja')
|
|
191
191
|
# @param source_locale [String] the source locale code (e.g., 'en')
|
|
192
192
|
# @param fast [Boolean, nil] enable fast mode for quicker results (optional)
|
|
193
|
-
# @param reference [Hash, nil]
|
|
193
|
+
# @param reference [Hash, nil] existing translations keyed by locale code, e.g. { 'es' => { 'key' => 'valor' } } (optional)
|
|
194
194
|
# @param on_progress [Proc, nil] callback for progress updates (optional)
|
|
195
195
|
# @param concurrent [Boolean] enable concurrent processing (default: false)
|
|
196
196
|
#
|
|
@@ -237,7 +237,7 @@ module LingoDotDev
|
|
|
237
237
|
# @param target_locale [String] the target locale code (e.g., 'es', 'fr', 'ja')
|
|
238
238
|
# @param source_locale [String] the source locale code (e.g., 'en')
|
|
239
239
|
# @param fast [Boolean, nil] enable fast mode for quicker results (optional)
|
|
240
|
-
# @param reference [Hash, nil]
|
|
240
|
+
# @param reference [Hash, nil] existing translations keyed by locale code, e.g. { 'es' => { 'key' => 'valor' } } (optional)
|
|
241
241
|
# @param on_progress [Proc, nil] callback for progress updates (optional)
|
|
242
242
|
# @param concurrent [Boolean] enable concurrent processing (default: false)
|
|
243
243
|
#
|
|
@@ -283,7 +283,7 @@ module LingoDotDev
|
|
|
283
283
|
# @param target_locale [String] the target locale code (e.g., 'es', 'fr', 'ja')
|
|
284
284
|
# @param source_locale [String] the source locale code (e.g., 'en')
|
|
285
285
|
# @param fast [Boolean, nil] enable fast mode for quicker results (optional)
|
|
286
|
-
# @param reference [Hash, nil]
|
|
286
|
+
# @param reference [Hash, nil] existing translations keyed by locale code, e.g. { 'es' => { 'key' => 'valor' } } (optional)
|
|
287
287
|
# @param on_progress [Proc, nil] callback for progress updates (optional)
|
|
288
288
|
# @param concurrent [Boolean] enable concurrent processing (default: false)
|
|
289
289
|
#
|
|
@@ -341,7 +341,7 @@ module LingoDotDev
|
|
|
341
341
|
# @param target_locale [String] the target locale code (e.g., 'es', 'fr', 'ja')
|
|
342
342
|
# @param source_locale [String] the source locale code (e.g., 'en')
|
|
343
343
|
# @param fast [Boolean, nil] enable fast mode for quicker results (optional)
|
|
344
|
-
# @param reference [Hash, nil]
|
|
344
|
+
# @param reference [Hash, nil] existing translations keyed by locale code, e.g. { 'es' => { 'key' => 'valor' } } (optional)
|
|
345
345
|
# @param on_progress [Proc, nil] callback for progress updates (optional)
|
|
346
346
|
# @param concurrent [Boolean] enable concurrent processing (default: false)
|
|
347
347
|
#
|
|
@@ -514,7 +514,7 @@ module LingoDotDev
|
|
|
514
514
|
# @param target_locales [Array<String>] array of target locale codes
|
|
515
515
|
# @param source_locale [String] the source locale code (e.g., 'en')
|
|
516
516
|
# @param fast [Boolean, nil] enable fast mode for quicker results (optional)
|
|
517
|
-
# @param reference [Hash, nil]
|
|
517
|
+
# @param reference [Hash, nil] existing translations keyed by locale code, e.g. { 'es' => { 'key' => 'valor' } } (optional)
|
|
518
518
|
# @param concurrent [Boolean] enable concurrent processing (default: false)
|
|
519
519
|
#
|
|
520
520
|
# @return [Array<String>] array of localized strings in the same order as target_locales
|
|
@@ -565,7 +565,7 @@ module LingoDotDev
|
|
|
565
565
|
# @param target_locale [String] the target locale code (e.g., 'es', 'fr', 'ja')
|
|
566
566
|
# @param source_locale [String] the source locale code (e.g., 'en')
|
|
567
567
|
# @param fast [Boolean, nil] enable fast mode for quicker results (optional)
|
|
568
|
-
# @param reference [Hash, nil]
|
|
568
|
+
# @param reference [Hash, nil] existing translations keyed by locale code, e.g. { 'es' => { 'key' => 'valor' } } (optional)
|
|
569
569
|
# @param concurrent [Boolean] enable concurrent processing (default: false)
|
|
570
570
|
#
|
|
571
571
|
# @return [Array<Hash>] array of localized Hash objects in the same order as input
|
|
@@ -69,7 +69,7 @@ RSpec.describe LingoDotDev::Engine do
|
|
|
69
69
|
|
|
70
70
|
it 'localizes text with reference context' do
|
|
71
71
|
engine = described_class.new(api_key: api_key, engine_id: engine_id)
|
|
72
|
-
reference = {
|
|
72
|
+
reference = { 'es' => { 'text' => 'Hola' } }
|
|
73
73
|
result = engine.localize_text(
|
|
74
74
|
'Hello',
|
|
75
75
|
target_locale: target_locale,
|