fastlane-plugin-translate_gpt 0.1.2 → 0.1.3
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: 162ac503b51db5c9395059702dfeedca75cbcd3bb26f68702059f45eb4540ffc
|
4
|
+
data.tar.gz: d73722901b8e2d68c3287187687761930962e4392e7016847bfc9946d57c3748
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b260653373ca72b56e753aad327338559eeb330e64e602f905720b12d8cb6e6c35d0c5750e8be8199169d41cc7549dc19cd4f30a19caf652465ce3a6d10f54b1
|
7
|
+
data.tar.gz: 21df8623e7bce11bf1c3658917dd498bd95929e77236dc32509ca8f3245c8491450cecee1996f2b40147e834aa2a76582facea074dcaa17b8e916a652e964193
|
@@ -24,19 +24,26 @@ module Fastlane
|
|
24
24
|
UI.message "Translating #{to_translate.size} strings..."
|
25
25
|
|
26
26
|
to_translate.each_with_index do |(key, string), index|
|
27
|
-
prompt = "
|
27
|
+
prompt = "I want you to act as a translator for a mobile application strings. " + \
|
28
|
+
"You need to answer only with translation and nothing else. No commentaries. " + \
|
29
|
+
"Try to keep length of the translated text. " + \
|
30
|
+
"I will send you a text and you translate it from #{params[:source_language]} to #{params[:target_language]}. "
|
31
|
+
if params[:context] && !params[:context].empty?
|
32
|
+
prompt += "This app is #{params[:context]}. "
|
33
|
+
end
|
28
34
|
context = string.comment
|
29
35
|
if context && !context.empty?
|
30
|
-
prompt += "
|
31
|
-
end
|
32
|
-
if params[:context] && !params[:context].empty?
|
33
|
-
prompt += "\n\nCommon context:\n#{params[:context]}"
|
36
|
+
prompt += "Additional context is #{context}. "
|
34
37
|
end
|
38
|
+
prompt += "Source text:\n#{string.value}"
|
39
|
+
|
35
40
|
# translate the source string to the target language
|
36
41
|
response = client.chat(
|
37
42
|
parameters: {
|
38
43
|
model: params[:model_name],
|
39
|
-
messages: [
|
44
|
+
messages: [
|
45
|
+
{ role: "user", content: prompt }
|
46
|
+
],
|
40
47
|
temperature: params[:temperature],
|
41
48
|
}
|
42
49
|
)
|
@@ -97,6 +104,7 @@ module Fastlane
|
|
97
104
|
key: :request_timeout,
|
98
105
|
env_name: "GPT_REQUEST_TIMEOUT",
|
99
106
|
description: "Timeout for the request in seconds",
|
107
|
+
type: Integer,
|
100
108
|
default_value: 30
|
101
109
|
),
|
102
110
|
FastlaneCore::ConfigItem.new(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-translate_gpt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksei Cherepanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-openai
|
@@ -209,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
rubygems_version: 3.4.
|
212
|
+
rubygems_version: 3.4.13
|
213
213
|
signing_key:
|
214
214
|
specification_version: 4
|
215
215
|
summary: This fastlane plugin provides an easy way to use the OpenAI GPT language
|