Skip to content

Commit c6e9dee

Browse files
authored
image-compressor@schorschii: Add translation support and add German translation (#804)
* Fixes #802
1 parent e8fee98 commit c6e9dee

23 files changed

Lines changed: 914 additions & 139 deletions

File tree

image-compressor@schorschii/files/image-compressor@schorschii/compress-images.py

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@
1010
TARGET_WIDTH = 1920
1111
TARGET_QUALITY = 75
1212

13+
import gettext
14+
UUID = "image-compressor@schorschii"
15+
HOME = os.path.expanduser("~")
16+
gettext.bindtextdomain(UUID, os.path.join(HOME, ".local/share/locale"))
17+
gettext.textdomain(UUID)
18+
19+
def _(message: str) -> str:
20+
return gettext.gettext(message)
21+
1322
class ImageWorker(Thread):
1423
def __init__(self, mainFrame):
1524
Thread.__init__(self)
@@ -32,7 +41,7 @@ def run(self):
3241
i += 1
3342
print("Processing " + str(i) + ": " + file)
3443
wx.CallAfter(self.frame.progress.SetValue, (i-1)/n*100)
35-
wx.CallAfter(self.frame.SetTitle, "Compressing Images " + str(i) + "/" + str(n) + "...")
44+
wx.CallAfter(self.frame.SetTitle, _("Compressing Images") + " " + str(i) + "/" + str(n) + "...")
3645

3746
path = pathlib.Path(file)
3847
filename = path.stem
@@ -59,7 +68,7 @@ def run(self):
5968
self.frame.sizeBefore = sizeBefore
6069
self.frame.sizeAfter = sizeAfter
6170
wx.CallAfter(self.frame.progress.SetValue, 100)
62-
wx.CallAfter(self.frame.SetTitle, "Compressing Images " + str(n) + "/" + str(n) + "...")
71+
wx.CallAfter(self.frame.SetTitle, _("Compressing Images") + " " + str(n) + "/" + str(n) + "...")
6372
wx.CallAfter(self.frame.Close)
6473

6574
class ProgressFrame(wx.Frame):
@@ -78,18 +87,18 @@ def InitUI(self):
7887

7988
# Window Settings
8089
self.SetSize(450, 65)
81-
self.SetTitle("Please Wait...")
90+
self.SetTitle(_("Please Wait..."))
8291
self.Centre()
8392

8493
def OnClose(self, event):
8594
if(self.files > 0):
8695
dlg = wx.MessageDialog(self,
87-
"Files Processed: "+str(self.files)+"\n" +
88-
"Original Size: "+str(round(self.sizeBefore/1024))+" KiB\n" +
89-
"Compressed Size: "+str(round(self.sizeAfter/1024))+" KiB\n" +
90-
"Saving: "+str(round(100-(self.sizeAfter*100/self.sizeBefore)))+"%\n\n" +
91-
"Attention: compression reduced image size and quality.",
92-
"Image Compressing Finished",
96+
_("Files Processed:")+" "+str(self.files)+"\n" +
97+
_("Original Size:")+" "+str(round(self.sizeBefore/1024))+" KiB\n" +
98+
_("Compressed Size:")+" "+str(round(self.sizeAfter/1024))+" KiB\n" +
99+
_("Saving:")+" "+str(round(100-(self.sizeAfter*100/self.sizeBefore)))+"%\n\n" +
100+
_("Attention: compression reduced image size and quality."),
101+
_("Image Compressing Finished"),
93102
wx.OK
94103
)
95104
dlg.ShowModal()
Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# COMPRESS IMAGES
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# schorschii, 2024
44
#
55
#, fuzzy
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: image-compressor@schorschii 1.0\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-actions/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-02-05 14:59-0500\n"
11+
"POT-Creation-Date: 2026-07-12 07:36-0400\n"
1212
"PO-Revision-Date: 2024-07-24 01:11+0200\n"
1313
"Last-Translator: Odyssey <odysseyhyd@gmail.com>\n"
1414
"Language-Team: \n"
@@ -18,20 +18,53 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"X-Generator: Poedit 3.4.2\n"
2020

21+
#. compress-images.py:44 compress-images.py:71
22+
#, fuzzy
23+
msgid "Compressing Images"
24+
msgstr "Comprimeix imatges"
25+
26+
#. compress-images.py:90
27+
msgid "Please Wait..."
28+
msgstr ""
29+
30+
#. compress-images.py:96
31+
msgid "Files Processed:"
32+
msgstr ""
33+
34+
#. compress-images.py:97
35+
msgid "Original Size:"
36+
msgstr ""
37+
38+
#. compress-images.py:98
39+
#, fuzzy
40+
msgid "Compressed Size:"
41+
msgstr "Comprimeix imatges"
42+
43+
#. compress-images.py:99
44+
msgid "Saving:"
45+
msgstr ""
46+
47+
#. compress-images.py:100
48+
msgid "Attention: compression reduced image size and quality."
49+
msgstr ""
50+
51+
#. compress-images.py:101
52+
msgid "Image Compressing Finished"
53+
msgstr ""
54+
2155
#. metadata.json->description
2256
msgid "Quickly compress images for e.g. sending it via email"
23-
msgstr ""
24-
"Comprimeix imatges ràpidament, per exemple, per enviar-les per correu"
57+
msgstr "Comprimeix imatges ràpidament, per exemple, per enviar-les per correu"
2558

2659
#. metadata.json->name
27-
#. Name
60+
#. image-compressor@schorschii.nemo_action.in->Name
2861
msgid "Compress images"
2962
msgstr "Comprimeix imatges"
3063

31-
#. Comment
64+
#. image-compressor@schorschii.nemo_action.in->Comment
3265
msgid ""
3366
"Compresses the selected images and saves it with suffix '_converted' (e.g. "
3467
"for sending them via email)"
3568
msgstr ""
36-
"Comprimeix les imatges seleccionades i les guarda amb el sufix "
37-
"'_converted' (per exemple, per enviar-les per correu)"
69+
"Comprimeix les imatges seleccionades i les guarda amb el sufix '_converted' "
70+
"(per exemple, per enviar-les per correu)"

image-compressor@schorschii/files/image-compressor@schorschii/po/cs.po

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# COMPRESS IMAGES
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# schorschii, 2024
44
#
55
msgid ""
66
msgstr ""
77
"Project-Id-Version: image-compressor@schorschii 1.0\n"
88
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-actions/"
99
"issues\n"
10-
"POT-Creation-Date: 2024-02-05 14:59-0500\n"
10+
"POT-Creation-Date: 2026-07-12 07:36-0400\n"
1111
"PO-Revision-Date: 2024-11-26 09:26+0100\n"
1212
"Last-Translator: CZmisaCZ <CZmisaCZ@email.cz>\n"
1313
"Language-Team: \n"
@@ -18,16 +18,50 @@ msgstr ""
1818
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n>=2 && n<=4 ? 1 : 2);\n"
1919
"X-Generator: Poedit 3.4.2\n"
2020

21+
#. compress-images.py:44 compress-images.py:71
22+
#, fuzzy
23+
msgid "Compressing Images"
24+
msgstr "Komprese obrázků"
25+
26+
#. compress-images.py:90
27+
msgid "Please Wait..."
28+
msgstr ""
29+
30+
#. compress-images.py:96
31+
msgid "Files Processed:"
32+
msgstr ""
33+
34+
#. compress-images.py:97
35+
msgid "Original Size:"
36+
msgstr ""
37+
38+
#. compress-images.py:98
39+
#, fuzzy
40+
msgid "Compressed Size:"
41+
msgstr "Komprese obrázků"
42+
43+
#. compress-images.py:99
44+
msgid "Saving:"
45+
msgstr ""
46+
47+
#. compress-images.py:100
48+
msgid "Attention: compression reduced image size and quality."
49+
msgstr ""
50+
51+
#. compress-images.py:101
52+
msgid "Image Compressing Finished"
53+
msgstr ""
54+
2155
#. metadata.json->description
2256
msgid "Quickly compress images for e.g. sending it via email"
2357
msgstr "Rychlá komprese obrázků pro např. odeslání e-mailem"
2458

2559
#. metadata.json->name
26-
#. Name
60+
#. image-compressor@schorschii.nemo_action.in->Name
2761
msgid "Compress images"
2862
msgstr "Komprese obrázků"
2963

30-
#. Comment
64+
#. image-compressor@schorschii.nemo_action.in->Comment
3165
msgid ""
3266
"Compresses the selected images and saves it with suffix '_converted' (e.g. "
3367
"for sending them via email)"
Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# SOME DESCRIPTIVE TITLE.
1+
# COMPRESS IMAGES
22
# This file is put in the public domain.
3-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3+
# schorschii, 2024
44
#
55
#, fuzzy
66
msgid ""
77
msgstr ""
88
"Project-Id-Version: image-compressor@schorschii 1.0\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-actions/"
1010
"issues\n"
11-
"POT-Creation-Date: 2024-02-05 14:59-0500\n"
11+
"POT-Creation-Date: 2026-07-12 07:36-0400\n"
1212
"PO-Revision-Date: 2025-10-05 15:31+0200\n"
1313
"Last-Translator: Alan Mortensen <alanmortensen.am@gmail.com>\n"
1414
"Language-Team: \n"
@@ -18,19 +18,53 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"X-Generator: Poedit 3.4.2\n"
2020

21+
#. compress-images.py:44 compress-images.py:71
22+
#, fuzzy
23+
msgid "Compressing Images"
24+
msgstr "Komprimér billeder"
25+
26+
#. compress-images.py:90
27+
msgid "Please Wait..."
28+
msgstr ""
29+
30+
#. compress-images.py:96
31+
msgid "Files Processed:"
32+
msgstr ""
33+
34+
#. compress-images.py:97
35+
msgid "Original Size:"
36+
msgstr ""
37+
38+
#. compress-images.py:98
39+
#, fuzzy
40+
msgid "Compressed Size:"
41+
msgstr "Komprimér billeder"
42+
43+
#. compress-images.py:99
44+
msgid "Saving:"
45+
msgstr ""
46+
47+
#. compress-images.py:100
48+
msgid "Attention: compression reduced image size and quality."
49+
msgstr ""
50+
51+
#. compress-images.py:101
52+
msgid "Image Compressing Finished"
53+
msgstr ""
54+
2155
#. metadata.json->description
2256
msgid "Quickly compress images for e.g. sending it via email"
2357
msgstr "Komprimér hurtigt billeder (f.eks. til e-mail)"
2458

2559
#. metadata.json->name
26-
#. Name
60+
#. image-compressor@schorschii.nemo_action.in->Name
2761
msgid "Compress images"
2862
msgstr "Komprimér billeder"
2963

30-
#. Comment
64+
#. image-compressor@schorschii.nemo_action.in->Comment
3165
msgid ""
3266
"Compresses the selected images and saves it with suffix '_converted' (e.g. "
3367
"for sending them via email)"
3468
msgstr ""
35-
"Komprimerer de valgte billeder og gemmer dem med suffikset “_converted” (f."
36-
"eks. til afsendelse via e-mail)"
69+
"Komprimerer de valgte billeder og gemmer dem med suffikset “_converted” "
70+
"(f.eks. til afsendelse via e-mail)"

image-compressor@schorschii/files/image-compressor@schorschii/po/de.po

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
msgid ""
66
msgstr ""
77
"Project-Id-Version: 1.0\n"
8-
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-actions/issues\n"
9-
"POT-Creation-Date: 2024-02-05 14:59-0500\n"
8+
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-actions/"
9+
"issues\n"
10+
"POT-Creation-Date: 2026-07-12 07:36-0400\n"
1011
"PO-Revision-Date: \n"
1112
"Last-Translator: Georg Sieber\n"
1213
"Language-Team: \n"
@@ -16,16 +17,52 @@ msgstr ""
1617
"Content-Transfer-Encoding: 8bit\n"
1718
"X-Generator: Poedit 3.4\n"
1819

20+
#. compress-images.py:44 compress-images.py:71
21+
msgid "Compressing Images"
22+
msgstr "Komprimiere Bilder"
23+
24+
#. compress-images.py:90
25+
msgid "Please Wait..."
26+
msgstr "Bitte warten..."
27+
28+
#. compress-images.py:96
29+
msgid "Files Processed:"
30+
msgstr "Verarbeitete Dateien:"
31+
32+
#. compress-images.py:97
33+
msgid "Original Size:"
34+
msgstr "Originalgröße:"
35+
36+
#. compress-images.py:98
37+
msgid "Compressed Size:"
38+
msgstr "Komprimierte Größe:"
39+
40+
#. compress-images.py:99
41+
msgid "Saving:"
42+
msgstr "Ersparnis:"
43+
44+
#. compress-images.py:100
45+
msgid "Attention: compression reduced image size and quality."
46+
msgstr "Achtung: Komprimierung reduziert Bildgröße und Qualität."
47+
48+
#. compress-images.py:101
49+
msgid "Image Compressing Finished"
50+
msgstr "Bildkomprimierung abgeschlossen"
51+
1952
#. metadata.json->description
2053
msgid "Quickly compress images for e.g. sending it via email"
2154
msgstr "Einfache Bilderkomprimierung z.B. für E-Mail-Versand"
2255

2356
#. metadata.json->name
24-
#. Name
57+
#. image-compressor@schorschii.nemo_action.in->Name
2558
msgid "Compress images"
2659
msgstr "Bilder komprimieren"
2760

28-
#. Comment
61+
#. image-compressor@schorschii.nemo_action.in->Comment
2962
#, fuzzy
30-
msgid "Compresses the selected images and saves it with suffix '_converted' (e.g. for sending them via email)"
31-
msgstr "Komprimiert die ausgewählten Bilder und speichert sie mit der Endung \"_converted\" (z.B. für E-Mail-Versand)"
63+
msgid ""
64+
"Compresses the selected images and saves it with suffix '_converted' (e.g. "
65+
"for sending them via email)"
66+
msgstr ""
67+
"Komprimiert die ausgewählten Bilder und speichert sie mit der Endung "
68+
"\"_converted\" (z.B. für E-Mail-Versand)"

0 commit comments

Comments
 (0)