Skip to content

Commit 4e4c5fb

Browse files
committed
API cleanup
1 parent 29a621a commit 4e4c5fb

File tree

13 files changed

+579
-598
lines changed

13 files changed

+579
-598
lines changed

api.py

Lines changed: 285 additions & 239 deletions
Large diffs are not rendered by default.

dialog_gtk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import gi
1111

12-
gi.require_version('Gtk', '3.0') #
12+
gi.require_version('Gtk', '3.0')
1313
from gi.repository import Gtk, Pango
1414

1515
from i18n import _

locale/bn.po

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: Dream Prompter 1.1.0\n"
99
"Report-Msgid-Bugs-To: quest@mac.com\n"
10-
"POT-Creation-Date: 2025-09-23 12:33-1000\n"
10+
"POT-Creation-Date: 2025-09-23 13:19-1000\n"
1111
"PO-Revision-Date: 2025-01-15 12:00+0000\n"
1212
"Last-Translator: Translation Team\n"
1313
"Language-Team: Bengali\n"
@@ -57,7 +57,7 @@ msgstr "AI প্রম্পট"
5757
msgid "AI-powered image creation/editing with Replicate models"
5858
msgstr "Replicate মডেলের সাথে AI চালিত ছবি তৈরি/সম্পাদনা"
5959

60-
#: api.py:56 dialog_threads.py:101 dialog_threads.py:135
60+
#: api.py:62 dialog_threads.py:101 dialog_threads.py:135
6161
msgid "API key is required"
6262
msgstr "API কী প্রয়োজন"
6363

@@ -79,7 +79,7 @@ msgstr "অতিরিক্ত ছবি (ঐচ্ছিক)"
7979
msgid "Aspect Ratio"
8080
msgstr "দিক অনুপাত"
8181

82-
#: api.py:110
82+
#: api.py:123
8383
msgid "Building Replicate edit request..."
8484
msgstr "Replicate সম্পাদনা অনুরোধ তৈরি করা হচ্ছে..."
8585

@@ -130,7 +130,7 @@ msgstr "পিক্সেলে কাস্টম উচ্চতা"
130130
msgid "Custom width in pixels"
131131
msgstr "পিক্সেলে কাস্টম প্রস্থ"
132132

133-
#: api.py:160 api.py:257
133+
#: api.py:403
134134
msgid "Downloading result..."
135135
msgstr "ফলাফল ডাউনলোড করা হচ্ছে..."
136136

@@ -151,9 +151,8 @@ msgid "Edit mode requires a selected layer"
151151
msgstr "সম্পাদনা মোডের জন্য একটি নির্বাচিত লেয়ার প্রয়োজন"
152152

153153
#: dialog_gtk.py:482
154-
#, fuzzy
155154
msgid "Enter your Replicate API key"
156-
msgstr "আপনার Replicate API কী প্রবেশ করান..."
155+
msgstr "আপনার Replicate API কী প্রবেশ করান"
157156

158157
#: dialog_threads.py:328
159158
#, python-brace-format
@@ -170,11 +169,11 @@ msgstr "ছবি তৈরি করতে ত্রুটি: {error}"
170169
msgid "Error running Dream Prompter: {error}"
171170
msgstr "Dream Prompter চালানোতে ত্রুটি: {error}"
172171

173-
#: api.py:179 api.py:277
172+
#: api.py:419
174173
msgid "Failed to convert any images from API response"
175174
msgstr "API প্রতিক্রিয়া থেকে ছবি রূপান্তর করতে ব্যর্থ"
176175

177-
#: api.py:107
176+
#: api.py:120
178177
msgid "Failed to export current image"
179178
msgstr "বর্তমান ছবি রপ্তানি করতে ব্যর্থ"
180179

@@ -199,7 +198,7 @@ msgstr "ছবিগুলি ক্রমিক বা সমান্তরা
199198
msgid "Generated {count} images"
200199
msgstr "{count}টি ছবি জেনারেট করা হয়েছে"
201200

202-
#: api.py:217
201+
#: api.py:176
203202
msgid "Generating image with Replicate..."
204203
msgstr "Replicate দিয়ে ছবি তৈরি করা হচ্ছে..."
205204

@@ -224,19 +223,19 @@ msgstr "API কী লুকান"
224223
msgid "Image Size"
225224
msgstr "ছবির আকার"
226225

227-
#: api.py:182
226+
#: api.py:423
228227
msgid "Image editing complete!"
229228
msgstr "ছবি সম্পাদনা সম্পূর্ণ!"
230229

231-
#: api.py:282
230+
#: api.py:425
232231
msgid "Image generation complete!"
233232
msgstr "ছবি উৎপাদন সম্পূর্ণ!"
234233

235234
#: dialog_events.py:127
236235
msgid "Initializing API request..."
237236
msgstr "API অনুরোধ শুরু করা হচ্ছে..."
238237

239-
#: api.py:144 api.py:291
238+
#: api.py:292
240239
msgid "Logs"
241240
msgstr "লগ"
242241

@@ -252,7 +251,7 @@ msgstr "জেনারেট করার জন্য সর্বোচ্চ
252251
msgid "Model Settings"
253252
msgstr "মডেল সেটিংস"
254253

255-
#: api.py:141 api.py:288
254+
#: api.py:289
256255
#, python-brace-format
257256
msgid "Model error: {error}"
258257
msgstr "মডেল ত্রুটি: {error}"
@@ -263,9 +262,9 @@ msgstr "Nano Banana (Gemini 2.5 Flash Image Preview)"
263262

264263
#: model_settings.py:241
265264
msgid "No"
266-
msgstr ""
265+
msgstr "না"
267266

268-
#: api.py:97
267+
#: api.py:107
269268
msgid "No GIMP image provided for editing"
270269
msgstr "সম্পাদনার জন্য কোনো GIMP ছবি প্রদান করা হয়নি"
271270

@@ -285,24 +284,23 @@ msgstr "API থেকে কোনো ছবির ডেটা পাওয়
285284
msgid "No layer available for editing"
286285
msgstr "সম্পাদনার জন্য কোনো স্তর উপলব্ধ নেই"
287286

288-
#: api.py:157 api.py:254
287+
#: api.py:400
289288
msgid "No output received from API"
290289
msgstr "API থেকে কোনো আউটপুট পাওয়া যায়নি"
291290

292-
#: api.py:167 api.py:264
291+
#: api.py:409
293292
msgid "No valid image data in API response"
294293
msgstr "API প্রতিক্রিয়ায় কোনো বৈধ ছবির ডেটা নেই"
295294

296295
#: model_settings.py:238
297296
msgid "Not set"
298-
msgstr ""
297+
msgstr "সেট করা হয়নি"
299298

300299
#: dialog_gtk.py:560
301300
msgid "Operation Mode"
302301
msgstr "অপারেশন মোড"
303302

304-
#: api.py:102 api.py:112 api.py:133 api.py:154 api.py:162 api.py:219 api.py:240
305-
#: api.py:251 api.py:259
303+
#: api.py:114 api.py:125 api.py:134 api.py:178 api.py:187 api.py:397 api.py:405
306304
msgid "Operation cancelled"
307305
msgstr "অপারেশন বাতিল হয়েছে"
308306

@@ -318,15 +316,11 @@ msgstr "অনুগ্রহ করে একটি প্রম্পট প
318316
msgid "Please enter your Replicate API key"
319317
msgstr "অনুগ্রহ করে আপনার Replicate API কী প্রবেশ করান"
320318

321-
#: api.py:100
319+
#: api.py:111
322320
msgid "Preparing current image for Replicate..."
323321
msgstr "Replicate এর জন্য বর্তমান ছবি প্রস্তুত করা হচ্ছে..."
324322

325-
#: api.py:152
326-
msgid "Processing Replicate edit response..."
327-
msgstr "Replicate সম্পাদনা প্রতিক্রিয়া প্রক্রিয়া করা হচ্ছে..."
328-
329-
#: api.py:249
323+
#: api.py:395
330324
msgid "Processing Replicate response..."
331325
msgstr "Replicate প্রতিক্রিয়া প্রক্রিয়া করা হচ্ছে..."
332326

@@ -347,12 +341,12 @@ msgstr "সম্পাদনা মোডের জন্য {max}টি রে
347341
msgid "Replicate API Key"
348342
msgstr "Replicate API কী"
349343

350-
#: api.py:147 api.py:295
344+
#: api.py:296
351345
#, python-brace-format
352346
msgid "Replicate API error: {error}"
353347
msgstr "Replicate API ত্রুটি: {error}"
354348

355-
#: api.py:52 api.py:94 api.py:213
349+
#: api.py:58 api.py:103 api.py:171
356350
msgid "Replicate API not available. Please install replicate"
357351
msgstr "Replicate API উপলব্ধ নেই। অনুগ্রহ করে replicate ইনস্টল করুন"
358352

@@ -381,11 +375,11 @@ msgstr "রেফারেন্স ছবি নির্বাচন করু
381375
msgid "Select up to {max} additional images"
382376
msgstr "সর্বোচ্চ {max}টি অতিরিক্ত ছবি নির্বাচন করুন"
383377

384-
#: api.py:131
378+
#: api.py:132
385379
msgid "Sending edit request to Replicate..."
386380
msgstr "Replicate এ সম্পাদনা অনুরোধ পাঠানো হচ্ছে..."
387381

388-
#: api.py:238
382+
#: api.py:185
389383
msgid "Sending request to Replicate..."
390384
msgstr "Replicate এ অনুরোধ পাঠানো হচ্ছে..."
391385

@@ -425,7 +419,7 @@ msgstr "ছবি সম্পাদনার সময় অপ্রত্য
425419
msgid "Unexpected error during image generation: {error}"
426420
msgstr "ছবি তৈরির সময় অপ্রত্যাশিত ত্রুটি: {error}"
427421

428-
#: api.py:187 api.py:300
422+
#: api.py:143 api.py:196
429423
#, python-brace-format
430424
msgid "Unexpected error: {error}"
431425
msgstr "অপ্রত্যাশিত ত্রুটি: {error}"
@@ -436,7 +430,7 @@ msgstr "প্রস্থ"
436430

437431
#: model_settings.py:241
438432
msgid "Yes"
439-
msgstr ""
433+
msgstr "হ্যাঁ"
440434

441435
#: dialog_gtk.py:684
442436
#, python-brace-format

locale/dream-prompter.pot

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Dream Prompter 1.1.0\n"
1010
"Report-Msgid-Bugs-To: quest@mac.com\n"
11-
"POT-Creation-Date: 2025-09-23 12:33-1000\n"
11+
"POT-Creation-Date: 2025-09-23 13:19-1000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,95 +17,90 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

20-
#: api.py:52 api.py:94 api.py:213
20+
#: api.py:58 api.py:103 api.py:171
2121
msgid "Replicate API not available. Please install replicate"
2222
msgstr ""
2323

24-
#: api.py:56 dialog_threads.py:101 dialog_threads.py:135
24+
#: api.py:62 dialog_threads.py:101 dialog_threads.py:135
2525
msgid "API key is required"
2626
msgstr ""
2727

28-
#: api.py:97
28+
#: api.py:107
2929
msgid "No GIMP image provided for editing"
3030
msgstr ""
3131

32-
#: api.py:100
32+
#: api.py:111
3333
msgid "Preparing current image for Replicate..."
3434
msgstr ""
3535

36-
#: api.py:102 api.py:112 api.py:133 api.py:154 api.py:162 api.py:219 api.py:240
37-
#: api.py:251 api.py:259
36+
#: api.py:114 api.py:125 api.py:134 api.py:178 api.py:187 api.py:397 api.py:405
3837
msgid "Operation cancelled"
3938
msgstr ""
4039

41-
#: api.py:107
40+
#: api.py:120
4241
msgid "Failed to export current image"
4342
msgstr ""
4443

45-
#: api.py:110
44+
#: api.py:123
4645
msgid "Building Replicate edit request..."
4746
msgstr ""
4847

49-
#: api.py:131
48+
#: api.py:132
5049
msgid "Sending edit request to Replicate..."
5150
msgstr ""
5251

53-
#: api.py:141 api.py:288
52+
#: api.py:143 api.py:196
53+
#, python-brace-format
54+
msgid "Unexpected error: {error}"
55+
msgstr ""
56+
57+
#: api.py:176
58+
msgid "Generating image with Replicate..."
59+
msgstr ""
60+
61+
#: api.py:185
62+
msgid "Sending request to Replicate..."
63+
msgstr ""
64+
65+
#: api.py:289
5466
#, python-brace-format
5567
msgid "Model error: {error}"
5668
msgstr ""
5769

58-
#: api.py:144 api.py:291
70+
#: api.py:292
5971
msgid "Logs"
6072
msgstr ""
6173

62-
#: api.py:147 api.py:295
74+
#: api.py:296
6375
#, python-brace-format
6476
msgid "Replicate API error: {error}"
6577
msgstr ""
6678

67-
#: api.py:152
68-
msgid "Processing Replicate edit response..."
79+
#: api.py:395
80+
msgid "Processing Replicate response..."
6981
msgstr ""
7082

71-
#: api.py:157 api.py:254
83+
#: api.py:400
7284
msgid "No output received from API"
7385
msgstr ""
7486

75-
#: api.py:160 api.py:257
87+
#: api.py:403
7688
msgid "Downloading result..."
7789
msgstr ""
7890

79-
#: api.py:167 api.py:264
91+
#: api.py:409
8092
msgid "No valid image data in API response"
8193
msgstr ""
8294

83-
#: api.py:179 api.py:277
95+
#: api.py:419
8496
msgid "Failed to convert any images from API response"
8597
msgstr ""
8698

87-
#: api.py:182
99+
#: api.py:423
88100
msgid "Image editing complete!"
89101
msgstr ""
90102

91-
#: api.py:187 api.py:300
92-
#, python-brace-format
93-
msgid "Unexpected error: {error}"
94-
msgstr ""
95-
96-
#: api.py:217
97-
msgid "Generating image with Replicate..."
98-
msgstr ""
99-
100-
#: api.py:238
101-
msgid "Sending request to Replicate..."
102-
msgstr ""
103-
104-
#: api.py:249
105-
msgid "Processing Replicate response..."
106-
msgstr ""
107-
108-
#: api.py:282
103+
#: api.py:425
109104
msgid "Image generation complete!"
110105
msgstr ""
111106

0 commit comments

Comments
 (0)