immosquare-translate 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 812bd63f44d434dc29f98e8b2707c16c68b28a8979c4b098d3f91b4a6b05f618
|
4
|
+
data.tar.gz: c2aaf90c499a6d079eb5d2ce067d4501b532c9502c5590592985d292b811fc73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f80c08d77141e8cb522f1274aeea0fa1658aa118b37cf7b8fb89d946b8e643e8d160ab6f93712417cafc175d80932e181f686414597df61638f2a082f78b90b
|
7
|
+
data.tar.gz: f6a7c90d9adc7414bcf170d4b01973c0521b25d3e6b53ffc4db6eb11067790b7349ed8b518c32a2cba3ffb7ed0319a9aa4f5c3f7786104caeb80420192d11a2e
|
@@ -28,7 +28,8 @@ module ImmosquareTranslate
|
|
28
28
|
|
29
29
|
prompt_system = "As a sophisticated translation AI, your role is to translate sentences from a specified source language to multiple target languages. " \
|
30
30
|
"It is imperative that you return the translations in a single, pure JSON string format. Use ISO 639-1 language codes for specifying languages. " \
|
31
|
-
"
|
31
|
+
"if string is html, you should return the translated html." \
|
32
|
+
"Ensure that the output does not include markdown (```json) or any other formatting characters. Adhere to the JSON structure meticulously."
|
32
33
|
|
33
34
|
|
34
35
|
prompt = "Translate the following sentences from '#{from_iso}' into the languages #{to_iso.join(", ")}, and format the output as a single, pure JSON string. " \
|
@@ -1,7 +1,7 @@
|
|
1
|
-
namespace :
|
1
|
+
namespace :immosquare_translate do
|
2
2
|
##============================================================##
|
3
3
|
## Function to translate translation files in rails app
|
4
|
-
## rake
|
4
|
+
## rake immosquare_translate:translate SOURCE_LOCALE=fr
|
5
5
|
##============================================================##
|
6
6
|
desc "Translate translation files in rails app"
|
7
7
|
task :translate => :environment do
|
@@ -17,7 +17,7 @@ namespace :immosquare_yaml do
|
|
17
17
|
puts("Translating from #{source_locale} to #{locales.join(", ")} with reset_translations=#{reset_translations}")
|
18
18
|
Dir.glob("#{Rails.root}/config/locales/**/*#{source_locale}.yml").each do |file|
|
19
19
|
locales.each do |locale|
|
20
|
-
|
20
|
+
ImmosquareTranslate::YmlTranslator.translate(file, locale, :reset_translations => reset_translations)
|
21
21
|
end
|
22
22
|
end
|
23
23
|
rescue StandardError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immosquare-translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IMMO SQUARE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
rubygems_version: 3.
|
98
|
+
rubygems_version: 3.5.7
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: AI-powered translations for Ruby applications, supporting a wide range of
|