From bac386dd98958e11929deb1c46092ece53b631c4 Mon Sep 17 00:00:00 2001 From: ABelliqueux Date: Fri, 23 Feb 2024 12:02:24 +0100 Subject: [PATCH] Fix message centering, fr l10n --- locales/fr/LC_MESSAGES/template.mo | Bin 1488 -> 1739 bytes locales/fr/LC_MESSAGES/template.pot | 13 +++++++++++-- main_c.py | 10 +++++----- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/locales/fr/LC_MESSAGES/template.mo b/locales/fr/LC_MESSAGES/template.mo index 6bf59851e07e3475c7c7bd2b38d8a50734589a4a..9a8df21a75ac3ba50ae340eedb6d62d61e5d2724 100644 GIT binary patch delta 711 zcmZ9}y=xRf7{KA#%f*j7qe+xN;siN64!1xhf;Bt)}#?P8U+`|K0#$R|IXJ>`DhRf(5bO(Jwk8un4@G2hSf*1>N zL}!VKzf+e^)Cb+b>&$PUe|ds_-AkOu4@f;#-xuhE8mh%Z~p+>PJ+z< delta 443 zcmXZYze~eV5Ww+Ee62rf{Y|A-UdqGG!O_jZ zMO?&15SMJ-I=DE9i;Jt@OLB1e+~p-N_wrGU3sG;v+z2s7&XTv}wALOM;tE%=iDi7i zBEI7&c5x2BvOe#N%+QyxfXk@Qt!4c#j?nL6MI@3FidAl0XA7@5P9NhGn||Up{a>Gm z#SN1Va)6WcEnL73>H(fn2k4^i^NS@kxzq~kdsSTI`?5u$Ck(R(?ot273-bMBT1bLf zk~M9ZCkZ{}FsY~1KhsYRkprX#+ekjC(hKv*pqA_QJan;FEpOJ&j>4L)2bcCZXw(mF f5Ze95MRUn{{^{eB|K_ diff --git a/locales/fr/LC_MESSAGES/template.pot b/locales/fr/LC_MESSAGES/template.pot index 5123ded..8c2ca14 100644 --- a/locales/fr/LC_MESSAGES/template.pot +++ b/locales/fr/LC_MESSAGES/template.pot @@ -14,18 +14,27 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: pygettext.py 1.5\n" +#: ../main_c.py:96 +msgid "No configuration file found, using defaults." +msgstr "Aucun fichier de configuration trouvé, utilisation des valeurs par défaut." #: ../main_c.py:87 msgid "Found configuration file in {}" msgstr "Fichier de configuration trouvé dans {}" +#: ../main_c.py:156 +msgid "No images yet! Start shooting..." +msgstr "Aucune image! Commencez à tourner..." + #: ../main_c.py:144 msgid "Warning: Some settings are not set to the recommended value!" msgstr "Attention: certains paramètres ne sont pas optimaux!" #: ../main_c.py:146 -msgid "Camera not found or busy." -msgstr "Caméra introuvable ou occupée." +msgid "" +"\n" +"Camera not found or busy." +msgstr "\nCaméra introuvable ou occupée." #: ../main_c.py:256 msgid "A previous session was found in {}, resume shooting ?" diff --git a/main_c.py b/main_c.py index ec728b7..6e858f0 100644 --- a/main_c.py +++ b/main_c.py @@ -26,10 +26,11 @@ import collections import gettext # DLSR support import gphoto2 as gp +from io import BytesIO from itertools import count import locale import os -from PIL import Image, ImageTk, ImageFilter +from PIL import Image, ImageTk, ImageFilter, ImageDraw, ImageFont import sys import threading import time @@ -59,6 +60,7 @@ from send2trash import send2trash # X Allow opening and exporting without a camera connected # o Better settings names # o webcam support (pygame, win and linux only) +# o picam support (picamera2) # o notify export ending running_from_folder = os.path.realpath(__file__) @@ -216,14 +218,12 @@ class KISStopmo(tk.Tk): return options def generate_splashscreen(self): - from PIL import Image, ImageDraw, ImageFont - from io import BytesIO splash = Image.new('RGB', (self.screen_w, self.screen_h), (200,200,200)) splash_draw = ImageDraw.Draw(splash) if self.splash_text is not None: font = ImageFont.truetype("Tuffy_Bold.ttf", 60) - font_len = font.getlength(self.splash_text) - splash_draw.text((self.screen_w/2 - font_len/2, self.screen_h/2 ), self.splash_text, fill=(255, 255, 255), font=font) + font_len = font.getlength(self.splash_text.split('\n')[0]) + splash_draw.multiline_text((self.screen_w/2 - font_len/2, self.screen_h/2 ), self.splash_text, fill=(255, 255, 255), font=font, align='center', spacing=20) # Use in-memory splash_bytes = BytesIO() splash.save(splash_bytes, 'png')