-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprize_calculator.py
7214 lines (6237 loc) · 351 KB
/
prize_calculator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import tkinter as tk
from tkinter import ttk, messagebox, filedialog
from dataclasses import dataclass, asdict
from typing import List, Dict, Optional, Tuple, Any
import json
import os
from datetime import datetime, date, timedelta
from calendar import monthrange
import webbrowser
import logging
from logging.handlers import RotatingFileHandler
import traceback
@dataclass
class DateRange:
start_year: int
start_month: int
start_day: Optional[int] = None
end_year: Optional[int] = None
end_month: Optional[int] = None
end_day: Optional[int] = None
def __str__(self) -> str:
"""Format date range for display"""
start = f"{self.start_year}-{self.start_month:02d}"
if self.start_day:
start += f"-{self.start_day:02d}"
if not any([self.end_year, self.end_month, self.end_day]):
return start
end = f"{self.end_year}-{self.end_month:02d}" if self.end_month else ""
if self.end_day:
end += f"-{self.end_day:02d}"
return f"{start} - {end}" if end else start
def is_valid(self) -> bool:
"""Validate date range"""
if not self.end_year and not self.end_month and not self.end_day:
return True
start_date = date(self.start_year, self.start_month, self.start_day or 1)
end_date = date(self.end_year or self.start_year,
self.end_month or self.start_month,
self.end_day or monthrange(self.end_year or self.start_year,
self.end_month or self.start_month)[1])
return start_date <= end_date
def overlaps(self, other: 'DateRange') -> bool:
"""Check if this range overlaps with another"""
start_date = date(self.start_year, self.start_month, self.start_day or 1)
end_date = date(self.end_year or self.start_year,
self.end_month or self.start_month,
self.end_day or monthrange(self.end_year or self.start_year,
self.end_month or self.start_month)[1])
other_start = date(other.start_year, other.start_month, other.start_day or 1)
other_end = date(other.end_year or other.start_year,
other.end_month or other.start_month,
other.end_day or monthrange(other.end_year or other.start_year,
other.end_month or other.start_month)[1])
return not (end_date < other_start or start_date > other_end)
def to_dict(self) -> dict:
"""Convert to dictionary for serialization"""
return asdict(self)
@classmethod
def from_dict(cls, data: dict) -> 'DateRange':
"""Create from dictionary"""
return cls(**data)
@dataclass
class Prize:
id: int
name: str
quantity: float
is_special: bool = False
top_winners: int = 1
def to_dict(self) -> dict:
"""Convert to dictionary for serialization"""
return asdict(self)
@classmethod
def from_dict(cls, data: dict) -> 'Prize':
"""Create from dictionary"""
return cls(**data)
@dataclass
class Participant:
id: int
name: str
damage: float
enabled: bool = True
def to_dict(self) -> dict:
"""Convert to dictionary for serialization"""
return asdict(self)
@classmethod
def from_dict(cls, data: dict) -> 'Participant':
"""Create from dictionary"""
return cls(**data)
@dataclass
class SavedState:
date_range: DateRange
event: str
prizes: List[Prize]
participants: List[Participant]
distributions: Dict[int, List[tuple]]
total_damage: float = 0.0
saved_date: str = ''
def to_dict(self) -> dict:
"""Convert to dictionary for serialization"""
return {
"date_range": self.date_range.to_dict(),
"event": self.event,
"prizes": [p.to_dict() for p in self.prizes],
"participants": [p.to_dict() for p in self.participants],
"distributions": {str(k): v for k, v in self.distributions.items()},
"total_damage": self.total_damage,
"saved_date": self.saved_date,
}
@classmethod
def from_dict(cls, data: dict) -> 'SavedState':
"""Create from dictionary"""
try:
# Aggiungiamo controlli per assicurarci che tutti i campi necessari siano presenti
required_fields = ['date_range', 'prizes', 'participants', 'distributions']
for field in required_fields:
if field not in data:
raise KeyError(f"Campo richiesto mancante: {field}")
# Estraiamo l'evento con un valore di default vuoto se non presente
event = data.get("event", "")
return cls(
date_range=DateRange.from_dict(data["date_range"]),
event=event,
prizes=[Prize.from_dict(p) for p in data["prizes"]],
participants=[Participant.from_dict(p) for p in data["participants"]],
distributions={int(k): v for k, v in data.get("distributions", {}).items()},
total_damage=data.get("total_damage", 0.0), # 0.0 se non presente
saved_date=data.get("saved_date", "") # Stringa vuota se non presente
)
except Exception as e:
raise ValueError(f"Errore nella creazione dello stato da dizionario: {str(e)}")
class TranslationManager:
def __init__(self):
self.current_language = "it"
self.translations = {
"it": {
#UI Principale
"title": "Distribuzione Premi",
"credits": "Crediti",
"developer": "Sviluppatore",
"donations": "Donazioni",
"close": "Chiudi",
"settings": "Impostazioni",
"backup": "Backup",
"import": "Importa",
"export": "Esporta",
"theme": "Tema",
"preferences": "Preferenze",
"general": "Generale",
"display": "Visualizzazione",
#Tab e Sezioni
"prizes": "Premi",
"participants": "Partecipanti",
"distribution": "Distribuzione",
"history": "Storico",
"current_state": "Stato Corrente",
"load_template": "Carica Template",
"filters": "Filtri",
"preview": "Anteprima",
#Campi Input e Label
"prize_name": "Nome Premio",
"participant": "Partecipante",
"quantity": "Quantità",
"damage": "Danni",
"enabled": "Abilitato",
"disabled": "Disabilitato",
"percentage": "Percentuale",
"total_damage": "Danni Totali",
"special_prize": "Premio Speciale",
"normal_prize": "Premio Normale",
"winners": "Vincitori",
"top_winners": "Numero vincitori",
"id": "N°",
"select_prize": "Seleziona Premio",
"total": "Totale",
"event": "Evento",
"distributions": "Distribuzioni",
#Controlli Data
"year": "Anno",
"month": "Mese",
"start_date": "Data Inizio",
"end_date": "Data Fine",
"start_day": "Giorno Inizio",
"end_day": "Giorno Fine",
"use_date_range": "Usa Intervallo Date",
"date": "Data",
"months": "Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre",
#Azioni
"add": "Aggiungi",
"edit": "Modifica",
"delete": "Elimina",
"save": "Salva",
"cancel": "Annulla",
"clear": "Pulisci",
"load": "Carica",
"toggle": "Attiva/Disattiva",
"received": "Ricevuto",
"refresh": "Aggiorna",
"update_state": "Aggiorna Stato",
"save_state": "Salva Stato",
"update_options": "Aggiorna Opzioni",
"backup_now": "Esegui Backup",
"restore": "Ripristina",
"move_up": "Sposta Su",
"move_down": "Sposta Giù",
#Input Modalità
"single_input": "Input Singolo",
"batch_input": "Input Multiplo",
"integer_only": "Solo numeri interi",
"load_prizes": "Carica Premi",
"load_participants": "Carica Partecipanti",
"delete_with_hash": "Usa # per eliminare un elemento",
"batch_prize_format": "Formato: nome:quantità[:s:vincitori] - Aggiungi 's:N' per premi speciali",
"batch_prize_example": "Esempio: mela d'oro:3:s:2 (premio speciale per 2 vincitori)",
"batch_participant_format": "Formato: nome:danni",
"batch_participant_example": "Esempio: mario:1000",
#Backup e Importazione
"backup_settings": "Impostazioni Backup",
"backup_folder": "Cartella Backup",
"enable_auto_backup": "Abilita Backup Automatico",
"backup_interval": "Intervallo Backup",
"backup_retention": "Conservazione Backup",
"keep_backups": "Mantieni Backup",
"select_backup": "Seleziona Backup",
"import_folder": "Cartella Importazione",
"import_settings": "Impostazioni Importazione",
"import_actions": "Azioni Importazione",
"data_folder": "Cartella Dati",
"auto_save": "Salvataggio Automatico",
"default_language": "Lingua Predefinita",
"font_size": "Dimensione Carattere",
"row_height": "Altezza Righe",
"tables": "Tabelle",
#Messaggi di Errore
"error": "Errore",
"info": "Informazione",
"confirm": "Conferma",
"name_required": "Nome richiesto",
"quantity_required": "Quantità richiesta",
"damage_required": "Danni richiesti",
"event_required": "Inserire il nome dell'evento",
"start_month_required": "Mese di inizio richiesto",
"prizes_and_participants_required": "Premi e partecipanti sono richiesti",
"missing_separator": "Manca il separatore ':'",
"missing_name": "Nome mancante",
"missing_value": "Valore mancante",
"missing_winners": "Numero vincitori mancante per premio speciale",
"invalid_winners": "Numero vincitori non valido",
"invalid_special": "Formato premio speciale non valido",
"invalid_quantity": "Quantità non valida",
"invalid_damage": "Danni non validi",
"invalid_chars": "Caratteri non validi nel nome",
"invalid_value": "Valore non valido",
"name_exists": "Nome già esistente",
"name_exists_msg": "Esiste già un elemento con questo nome",
"invalid_input": "Input non valido",
"invalid_date_range": "Intervallo date non valido",
"date_collision": "Esiste già un evento in queste date",
"prize_name_too_short": "Nome premio troppo corto",
"prize_name_too_long": "Nome premio troppo lungo",
"participant_name_too_short": "Nome partecipante troppo corto",
"participant_name_too_long": "Nome partecipante troppo lungo",
"event_name_too_long": "Il nome dell'evento non può superare i 50 caratteri",
"state_not_found": "Stato non trovato",
"state_not_found_with_dates": "Nessuno stato trovato con queste date",
"no_elements_to_update": "Nessun elemento da aggiornare",
"save_error": "Errore durante il salvataggio",
"no_saved_states": "Nessuno stato salvato",
"template_load_error": "Errore durante il caricamento del template",
"export_error": "Errore durante l'esportazione",
"import_error": "Errore durante l'importazione",
"backup_error": "Errore durante il backup",
"restore_error": "Errore durante il ripristino",
"no_backup_selected": "Nessun backup selezionato",
"no_backups_available": "Nessun backup disponibile",
"quantity_must_be_positive": "La quantità deve essere positiva",
"quantity_must_be_integer": "La quantità deve essere un numero intero",
"quantity_must_be_number": "La quantità deve essere un numero",
"damage_must_be_non_negative": "Il danno deve essere non negativo",
"damage_must_be_integer": "Il danno deve essere un numero intero",
"damage_must_be_number": "Il danno deve essere un numero",
"winners_must_be_positive": "Il numero di vincitori deve essere positivo",
"winners_must_be_integer": "Il numero di vincitori deve essere intero",
"winners_exceed_participants": "Il numero di vincitori supera il numero di partecipanti",
"state_incomplete_load": "Lo stato contiene elementi non ancora caricati. Procedere con il caricamento degli elementi mancanti?",
#Conferme
"confirm_delete": "Confermare eliminazione?",
"confirm_delete_last_prize": "Eliminando l'ultimo premio verrà eliminato anche l'evento. Procedere?",
"confirm_delete_last_participant": "Eliminando l'ultimo partecipante verrà eliminato anche l'evento. Procedere?",
"confirm_delete_prize": "Sei sicuro di voler eliminare questo premio?",
"confirm_delete_participant": "Sei sicuro di voler eliminare questo partecipante?",
"confirm_clear_prizes": "Sei sicuro di voler eliminare tutti i premi?",
"confirm_clear_participants": "Sei sicuro di voler eliminare tutti i partecipanti?",
"confirm_update": "Sei sicuro di voler aggiornare questo stato?",
"confirm_update_options": "Confermi l'aggiornamento delle opzioni di immissione?",
"ignore_update_options": "Vuoi ignorare le modifiche alle opzioni di immissione? Le modifiche ai dati verranno comunque salvate",
"cancel_all_updates": "Vuoi annullare tutte le modifiche? Nessuna modifica verrà salvata",
"confirm_restore": "Sei sicuro di voler ripristinare questo backup?",
"confirm_new_state": "Ci sono modifiche non salvate. Vuoi procedere con un nuovo stato?",
"confirm_discard_changes": "Confermi di voler annullare le modifiche?",
#Messaggi di Successo
"state_saved": "Stato salvato con successo",
"state_updated": "Stato aggiornato con successo",
"backup_created": "Backup creato con successo",
"restore_completed": "Ripristino completato",
"export_completed": "Esportazione completata",
"preferences_saved": "Preferenze salvate",
"changes_saved": "Modifiche salvate",
#Log Messages
"log_app_initialized": "Applicazione inizializzata",
"log_ui_components_initialized": "Componenti UI inizializzati",
"log_styles_configured": "Stili configurati",
"log_language_selector_created": "Selettore lingua creato",
"log_top_frame_created": "Frame superiore creato",
"log_state_frame_created": "Frame stato creato",
"log_date_controls_created": "Controlli data creati",
"log_date_range_frames_setup": "Frame intervallo date configurati",
"log_month_values_updated": "Valori mesi aggiornati",
"log_buttons_state_updated": "Stato pulsanti aggiornato",
"log_prize_headers_updated": "Intestazioni premi aggiornate",
"log_participant_headers_updated": "Intestazioni partecipanti aggiornate",
"log_distribution_headers_updated": "Intestazioni distribuzione aggiornate",
"log_history_headers_updated": "Intestazioni cronologia aggiornate",
"log_tables_content_refreshed": "Contenuto tabelle aggiornato",
"log_tables_updated": "Tabelle aggiornate",
"log_ui_text_updated": "Testi UI aggiornati",
"log_month_combos_setup": "Combo mesi configurate",
"log_day_combos_setup": "Combo giorni configurate",
"log_year_frame_created": "Frame anno creato",
"log_date_range_frame_created": "Frame intervallo date creato",
"log_drag_started": "Trascinamento iniziato",
"log_drag_motion": "Movimento trascinamento",
"log_drag_completed": "Trascinamento completato",
"log_prize_mode_toggled": "Modalità premio cambiata",
"log_participant_mode_toggled": "Modalità partecipante cambiata",
"log_prize_added": "Premio aggiunto: {name}",
"log_participant_added": "Partecipante aggiunto: {name}",
"log_prize_edited": "Premio modificato: {name}",
"log_participant_edited": "Partecipante modificato: {name}",
"log_prize_deleted": "Premio eliminato: {name}",
"log_participant_deleted": "Partecipante eliminato: {name}",
"log_participant_toggled": "Stato partecipante cambiato: {name}",
"log_state_saved": "Stato salvato: {event}",
"log_state_loaded": "Stato caricato: {event}",
"log_distribution_calculated": "Distribuzione calcolata per premio: {prize_id}",
"log_language_changed": "Lingua cambiata a: {language}",
"log_state_file_saved": "File stato salvato: {filename}",
"log_states_loaded": "Stati caricati: {count}",
"log_distribution_updated": "Distribuzione aggiornata per premio: {prize_id}",
"log_prize_action_handled": "Azione premio gestita: {action}",
"log_participant_action_handled": "Azione partecipante gestita: {action}",
"log_backup_created": "Backup creato: {filename}",
"log_restore_completed": "Ripristino completato: {filename}",
"log_preferences_saved": "Preferenze salvate",
"log_theme_applied": "Tema applicato: {theme}",
"log_data_folder_created": "Cartella dati creata",
"log_general_preferences_created": "Preferenze generali create",
"log_display_preferences_created": "Preferenze visualizzazione create",
"log_backup_preferences_created": "Preferenze backup create",
"log_auto_backup_setup": "Setup backup automatico: intervallo={interval}, retention={retention}",
"log_old_backup_removed": "Vecchio backup rimosso: {file}",
"log_preference_saved": "Preferenza salvata: {key}",
"log_sorting_applied": "Ordinamento applicato: {column}",
#Log Errors
"log_error_ui_setup": "Errore durante la configurazione UI: {error}",
"log_error_styles": "Errore configurazione stili: {error}",
"log_error_top_frame": "Errore creazione frame superiore: {error}",
"log_error_state_frame": "Errore creazione frame stato: {error}",
"log_error_date_controls": "Errore creazione controlli data: {error}",
"log_error_year_frame": "Errore creazione frame anno: {error}",
"log_error_date_range_frame": "Errore creazione frame intervallo date: {error}",
"log_error_prize_headers": "Errore aggiornamento intestazioni premi: {error}",
"log_error_participant_headers": "Errore aggiornamento intestazioni partecipanti: {error}",
"log_error_distribution_headers": "Errore aggiornamento intestazioni distribuzione: {error}",
"log_error_history_headers": "Errore aggiornamento intestazioni cronologia: {error}",
"log_error_refreshing_tables": "Errore aggiornamento tabelle: {error}",
"log_error_sorting_table": "Errore ordinamento tabella: {error}",
"log_error_prize_action": "Errore gestione azione premio: {error}",
"log_error_participant_action": "Errore gestione azione partecipante: {error}",
"log_error_saving_state": "Errore salvataggio stato: {error}",
"log_error_loading_state": "Errore caricamento stato: {error}",
"log_error_distribution_calculation": "Errore calcolo distribuzione: {error}",
"log_error_changing_language": "Errore cambio lingua: {error}",
"log_error_drag_drop": "Errore durante drag and drop: {error}",
"log_error_validation": "Errore validazione: {error}",
"log_error_adding_prizes": "Errore aggiunta premi: {error}",
"log_error_adding_participants": "Errore aggiunta partecipanti: {error}",
"log_error_updating_ui": "Errore aggiornamento UI: {error}",
"log_error_updating_distribution": "Errore aggiornamento distribuzione: {error}",
"log_error_backup": "Errore backup: {error}",
"log_error_restore": "Errore ripristino: {error}",
"log_error_preferences": "Errore preferenze: {error}",
"log_error_saving_preferences": "Errore salvataggio preferenze: {error}",
"log_error_applying_theme": "Errore applicazione tema: {error}",
"log_error_creating_folder": "Errore creazione cartella: {error}",
"log_error_month_combos": "Errore configurazione combo mesi: {error}",
"log_error_day_combos": "Errore configurazione combo giorni: {error}",
"log_error_date_validation": "Errore validazione date: {error}",
"log_error_filtering_states": "Errore filtraggio stati: {error}",
"log_error_saving_file": "Errore salvataggio file: {error}",
"log_error_reading_backup": "Errore lettura backup: {error}",
"log_error_preview": "Errore generazione anteprima: {error}",
"log_error_getting_preference": "Errore lettura preferenza: {error}",
"log_error_saving_preference": "Errore salvataggio preferenza: {error}",
"log_error_centering_dialog": "Errore centraggio finestra dialogo: {error}",
"log_error_language_selector": "Errore creazione selettore lingua: {error}",
"log_error_buttons_state": "Errore aggiornamento stato pulsanti: {error}",
"log_error_quantity_validation": "Errore validazione quantità: {error}",
"log_error_integer_distribution": "Errore distribuzione numeri interi: {error}",
"log_error_prize_mode_toggle": "Errore cambio modalità premio: {error}",
"log_error_participant_mode_toggle": "Errore cambio modalità partecipante: {error}",
"log_error_parsing_prize": "Errore parsing premio: {error}",
"log_error_parsing_participant": "Errore parsing partecipante: {error}",
"log_error_updating_button_states": "Errore aggiornamento stato pulsanti: {error}",
"log_error_auto_backup": "Errore backup automatico: {error}",
"log_error_cleanup_backups": "Errore pulizia vecchi backup: {error}",
"log_error_loading_preferences": "Errore caricamento preferenze: {error}",
"log_error_applying_preferences": "Errore applicazione preferenze: {error}",
"log_error_export": "Errore esportazione: {error}",
"log_error_import": "Errore importazione: {error}",
"log_error_name_validation": "Errore validazione nome: {error}",
"log_error_validating_winners": "Errore validazione vincitori: {error}",
"log_error_toggle_winners": "Errore toggle vincitori: {error}",
"log_error_toggle_participant": "Errore toggle partecipante: {error}",
"log_error_prize_template": "Errore template premio: {error}",
"log_error_participant_template": "Errore template partecipante: {error}",
"log_error_update_state": "Errore aggiornamento stato: {error}",
"log_error_creating_shortcuts": "Errore creazione scorciatoie: {error}",
"log_error_showing_settings": "Errore visualizzazione impostazioni: {error}",
"log_error_showing_backup_settings": "Errore visualizzazione impostazioni backup: {error}",
"log_error_showing_import_settings": "Errore visualizzazione impostazioni importazione: {error}",
"log_error_creating_menus": "Errore creazione menu: {error}",
"log_error_prize_menu": "Errore menu premio: {error}",
"log_error_participant_menu": "Errore menu partecipante: {error}",
"log_error_moving_item": "Errore spostamento elemento: {error}",
"log_error_credits": "Errore visualizzazione crediti: {error}",
"log_error_restore_dialog": "Errore finestra dialogo ripristino: {error}",
"log_error_number_format": "Errore formattazione numero: {error}",
"log_error_formatting_damages": "Errore formattazione danni: {error}",
"log_error_formatting_prizes": "Errore formattazione premi: {error}",
"log_error_formatting_distributions": "Errore formattazione distribuzioni: {error}",
"log_error_dialog": "Errore finestra dialogo: {error}"
},
"en": {
#Main UI
"title": "Prize Distribution",
"credits": "Credits",
"developer": "Developer",
"donations": "Donations",
"close": "Close",
"settings": "Settings",
"backup": "Backup",
"import": "Import",
"export": "Export",
"theme": "Theme",
"preferences": "Preferences",
"general": "General",
"display": "Display",
#Tab e Sezioni
"prizes": "Prizes",
"participants": "Participants",
"distribution": "Distribution",
"history": "History",
"current_state": "Current State",
"load_template": "Load Template",
"filters": "Filters",
"preview": "Preview",
#Campi Input e Label
"prize_name": "Prize Name",
"participant": "Participant",
"quantity": "Quantity",
"damage": "Damage",
"enabled": "Enabled",
"disabled": "Disabled",
"percentage": "Percentage",
"total_damage": "Total Damage",
"special_prize": "Special Prize",
"normal_prize": "Normal Prize",
"winners": "Winners",
"top_winners": "Number of Winners",
"id": "#",
"select_prize": "Select Prize",
"total": "Total",
"event": "Event",
"distributions": "Distributions",
#Controlli Data
"year": "Year",
"month": "Month",
"start_date": "Start Date",
"end_date": "End Date",
"start_day": "Start Day",
"end_day": "End Day",
"use_date_range": "Use Date Range",
"date": "Date",
"months": "January,February,March,April,May,June,July,August,September,October,November,December",
#Azioni
"add": "Add",
"edit": "Edit",
"delete": "Delete",
"save": "Save",
"cancel": "Cancel",
"clear": "Clear",
"load": "Load",
"toggle": "Toggle",
"received": "Received",
"refresh": "Refresh",
"update_state": "Update State",
"save_state": "Save State",
"update_options": "Update Options",
"backup_now": "Backup Now",
"restore": "Restore",
"move_up": "Move Up",
"move_down": "Move Down",
#Input Modalità
"single_input": "Single Input",
"batch_input": "Batch Input",
"integer_only": "Integer Only",
"load_prizes": "Load Prizes",
"load_participants": "Load Participants",
"delete_with_hash": "Use # to delete an item",
"batch_prize_format": "Format: name:quantity[:s:winners] - Add 's:N' for special prizes",
"batch_prize_example": "Example: golden apple:3:s:2 (special prize for 2 winners)",
"batch_participant_format": "Format: name:damage",
"batch_participant_example": "Example: mario:1000",
#Backup e Importazione
"backup_settings": "Backup Settings",
"backup_folder": "Backup Folder",
"enable_auto_backup": "Enable Auto Backup",
"backup_interval": "Backup Interval",
"backup_retention": "Backup Retention",
"keep_backups": "Keep Backups",
"select_backup": "Select Backup",
"import_folder": "Import Folder",
"import_settings": "Import Settings",
"import_actions": "Import Actions",
"data_folder": "Data Folder",
"auto_save": "Auto Save",
"default_language": "Default Language",
"font_size": "Font Size",
"row_height": "Row Height",
"tables": "Tables",
#Messaggi di Errore
"error": "Error",
"info": "Information",
"confirm": "Confirm",
"name_required": "Name required",
"quantity_required": "Quantity required",
"damage_required": "Damage required",
"event_required": "Event name required",
"start_month_required": "Start month required",
"prizes_and_participants_required": "Prizes and participants are required",
"missing_separator": "Missing separator ':'",
"missing_name": "Missing name",
"missing_value": "Missing value",
"missing_winners": "Missing winners count for special prize",
"invalid_winners": "Invalid winners count",
"invalid_special": "Invalid special prize format",
"invalid_quantity": "Invalid quantity",
"invalid_damage": "Invalid damage",
"invalid_chars": "Invalid characters in name",
"invalid_value": "Invalid value",
"name_exists": "Name exists",
"name_exists_msg": "An element with this name already exists",
"invalid_input": "Invalid input",
"invalid_date_range": "Invalid date range",
"date_collision": "An event already exists on these dates",
"prize_name_too_short": "Prize name too short",
"prize_name_too_long": "Prize name too long",
"participant_name_too_short": "Participant name too short",
"participant_name_too_long": "Participant name too long",
"event_name_too_long": "Event name cannot exceed 50 characters",
"state_not_found": "State not found",
"state_not_found_with_dates": "No state found with these dates",
"no_elements_to_update": "No elements to update",
"save_error": "Error during save",
"no_saved_states": "No saved states",
"template_load_error": "Error loading template",
"export_error": "Error during export",
"import_error": "Error during import",
"backup_error": "Error during backup",
"restore_error": "Error during restore",
"no_backup_selected": "No backup selected",
"no_backups_available": "No backups available",
"quantity_must_be_positive": "Quantity must be positive",
"quantity_must_be_integer": "Quantity must be an integer",
"quantity_must_be_number": "Quantity must be a number",
"damage_must_be_non_negative": "Damage must be non-negative",
"damage_must_be_integer": "Damage must be an integer",
"damage_must_be_number": "Damage must be a number",
"winners_must_be_positive": "Winners count must be positive",
"winners_must_be_integer": "Winners count must be an integer",
"winners_exceed_participants": "Winners count exceeds number of participants",
"state_incomplete_load": "The state contains unloaded elements. Proceed with loading missing elements?",
#Conferme
"confirm_delete": "Confirm deletion?",
"confirm_delete_last_prize": "Deleting the last prize will also delete the event. Proceed?",
"confirm_delete_last_participant": "Deleting the last participant will also delete the event. Proceed?",
"confirm_delete_prize": "Are you sure you want to delete this prize?",
"confirm_delete_participant": "Are you sure you want to delete this participant?",
"confirm_clear_prizes": "Are you sure you want to delete all prizes?",
"confirm_clear_participants": "Are you sure you want to delete all participants?",
"confirm_update": "Are you sure you want to update this state?",
"confirm_update_options": "Confirm updating input options?",
"ignore_update_options": "Do you want to ignore input option changes? Data changes will still be saved",
"cancel_all_updates": "Do you want to cancel all changes? No changes will be saved",
"confirm_restore": "Are you sure you want to restore this backup?",
"confirm_new_state": "There are unsaved changes. Do you want to proceed with a new state?",
"confirm_discard_changes": "Confirm discarding changes?",
#Success Messages
"state_saved": "State saved successfully",
"state_updated": "State updated successfully",
"backup_created": "Backup created successfully",
"restore_completed": "Restore completed",
"export_completed": "Export completed",
"preferences_saved": "Preferences saved",
"changes_saved": "Changes saved",
#Log Messages
"log_app_initialized": "Application initialized",
"log_ui_components_initialized": "UI components initialized",
"log_styles_configured": "Styles configured",
"log_language_selector_created": "Language selector created",
"log_top_frame_created": "Top frame created",
"log_state_frame_created": "State frame created",
"log_date_controls_created": "Date controls created",
"log_date_range_frames_setup": "Date range frames setup",
"log_month_values_updated": "Month values updated",
"log_buttons_state_updated": "Button states updated",
"log_prize_headers_updated": "Prize headers updated",
"log_participant_headers_updated": "Participant headers updated",
"log_distribution_headers_updated": "Distribution headers updated",
"log_history_headers_updated": "History headers updated",
"log_tables_content_refreshed": "Tables content refreshed",
"log_tables_updated": "Tables updated",
"log_ui_text_updated": "UI text updated",
"log_month_combos_setup": "Month combos setup",
"log_day_combos_setup": "Day combos setup",
"log_year_frame_created": "Year frame created",
"log_date_range_frame_created": "Date range frame created",
"log_drag_started": "Drag started",
"log_drag_motion": "Drag motion",
"log_drag_completed": "Drag completed",
"log_prize_mode_toggled": "Prize mode toggled",
"log_participant_mode_toggled": "Participant mode toggled",
"log_prize_added": "Prize added: {name}",
"log_participant_added": "Participant added: {name}",
"log_prize_edited": "Prize edited: {name}",
"log_participant_edited": "Participant edited: {name}",
"log_prize_deleted": "Prize deleted: {name}",
"log_participant_deleted": "Participant deleted: {name}",
"log_participant_toggled": "Participant state toggled: {name}",
"log_state_saved": "State saved: {event}",
"log_state_loaded": "State loaded: {event}",
"log_distribution_calculated": "Distribution calculated for prize: {prize_id}",
"log_language_changed": "Language changed to: {language}",
"log_state_file_saved": "State file saved: {filename}",
"log_states_loaded": "States loaded: {count}",
"log_distribution_updated": "Distribution updated for prize: {prize_id}",
"log_prize_action_handled": "Prize action handled: {action}",
"log_participant_action_handled": "Participant action handled: {action}",
"log_backup_created": "Backup created: {filename}",
"log_restore_completed": "Restore completed: {filename}",
"log_preferences_saved": "Preferences saved",
"log_theme_applied": "Theme applied: {theme}",
"log_data_folder_created": "Data folder created",
"log_general_preferences_created": "General preferences created",
"log_display_preferences_created": "Display preferences created",
"log_backup_preferences_created": "Backup preferences created",
"log_auto_backup_setup": "Auto backup setup: interval={interval}, retention={retention}",
"log_old_backup_removed": "Old backup removed: {file}",
"log_preference_saved": "Preference saved: {key}",
"log_sorting_applied": "Sorting applied: {column}",
"log_error_ui_setup": "Error in UI setup: {error}",
"log_error_styles": "Error configuring styles: {error}",
"log_error_top_frame": "Error creating top frame: {error}",
"log_error_state_frame": "Error creating state frame: {error}",
"log_error_date_controls": "Error creating date controls: {error}",
"log_error_year_frame": "Error creating year frame: {error}",
"log_error_date_range_frame": "Error creating date range frame: {error}",
"log_error_prize_headers": "Error updating prize headers: {error}",
"log_error_participant_headers": "Error updating participant headers: {error}",
"log_error_distribution_headers": "Error updating distribution headers: {error}",
"log_error_history_headers": "Error updating history headers: {error}",
"log_error_refreshing_tables": "Error refreshing tables: {error}",
"log_error_sorting_table": "Error sorting table: {error}",
"log_error_prize_action": "Error handling prize action: {error}",
"log_error_participant_action": "Error handling participant action: {error}",
"log_error_saving_state": "Error saving state: {error}",
"log_error_loading_state": "Error loading state: {error}",
"log_error_distribution_calculation": "Error calculating distribution: {error}",
"log_error_changing_language": "Error changing language: {error}",
"log_error_drag_drop": "Error during drag and drop: {error}",
"log_error_validation": "Error in validation: {error}",
"log_error_adding_prizes": "Error adding prizes: {error}",
"log_error_adding_participants": "Error adding participants: {error}",
"log_error_updating_ui": "Error updating UI: {error}",
"log_error_updating_distribution": "Error updating distribution: {error}",
"log_error_backup": "Error during backup: {error}",
"log_error_restore": "Error during restore: {error}",
"log_error_preferences": "Error in preferences: {error}",
"log_error_saving_preferences": "Error saving preferences: {error}",
"log_error_applying_theme": "Error applying theme: {error}",
"log_error_creating_folder": "Error creating folder: {error}",
"log_error_month_combos": "Error setting up month combos: {error}",
"log_error_day_combos": "Error setting up day combos: {error}",
"log_error_date_validation": "Error validating dates: {error}",
"log_error_filtering_states": "Error filtering states: {error}",
"log_error_saving_file": "Error saving file: {error}",
"log_error_reading_backup": "Error reading backup: {error}",
"log_error_preview": "Error generating preview: {error}",
"log_error_getting_preference": "Error getting preference: {error}",
"log_error_saving_preference": "Error saving preference: {error}",
"log_error_centering_dialog": "Error centering dialog: {error}",
"log_error_language_selector": "Error creating language selector: {error}",
"log_error_buttons_state": "Error updating buttons state: {error}",
"log_error_quantity_validation": "Error validating quantity: {error}",
"log_error_integer_distribution": "Error in integer distribution: {error}",
"log_error_prize_mode_toggle": "Error toggling prize mode: {error}",
"log_error_participant_mode_toggle": "Error toggling participant mode: {error}",
"log_error_parsing_prize": "Error parsing prize: {error}",
"log_error_parsing_participant": "Error parsing participant: {error}",
"log_error_updating_button_states": "Error updating button states: {error}",
"log_error_auto_backup": "Error in auto backup: {error}",
"log_error_cleanup_backups": "Error cleaning up old backups: {error}",
"log_error_loading_preferences": "Error loading preferences: {error}",
"log_error_applying_preferences": "Error applying preferences: {error}",
"log_error_export": "Error during export: {error}",
"log_error_import": "Error during import: {error}",
"log_error_name_validation": "Error validating name: {error}",
"log_error_validating_winners": "Error validating winners: {error}",
"log_error_toggle_winners": "Error toggling winners: {error}",
"log_error_toggle_participant": "Error toggling participant: {error}",
"log_error_prize_template": "Error in prize template: {error}",
"log_error_participant_template": "Error in participant template: {error}",
"log_error_update_state": "Error updating state: {error}",
"log_error_creating_shortcuts": "Error creating shortcuts: {error}",
"log_error_showing_settings": "Error showing settings: {error}",
"log_error_showing_backup_settings": "Error showing backup settings: {error}",
"log_error_showing_import_settings": "Error showing import settings: {error}",
"log_error_creating_menus": "Error creating menus: {error}",
"log_error_prize_menu": "Error in prize menu: {error}",
"log_error_participant_menu": "Error in participant menu: {error}",
"log_error_moving_item": "Error moving item: {error}",
"log_error_credits": "Error showing credits: {error}",
"log_error_restore_dialog": "Error in restore dialog: {error}",
"log_error_number_format": "Error formatting number: {error}",
"log_error_formatting_damages": "Error formatting damages: {error}",
"log_error_formatting_prizes": "Error formatting prizes: {error}",
"log_error_formatting_distributions": "Error formatting distributions: {error}",
"log_error_dialog": "Error in dialog: {error}"
},
"fr": {
#Interface Principale
"title": "Distribution des Prix",
"credits": "Crédits",
"developer": "Développeur",
"donations": "Dons",
"close": "Fermer",
"settings": "Paramètres",
"backup": "Sauvegarde",
"import": "Importer",
"export": "Exporter",
"theme": "Thème",
"preferences": "Préférences",
"general": "Général",
"display": "Affichage",
#Onglets et Sections
"prizes": "Prix",
"participants": "Participants",
"distribution": "Distribution",
"history": "Historique",
"current_state": "État Actuel",
"load_template": "Charger Modèle",
"filters": "Filtres",
"preview": "Aperçu",
#Champs et Étiquettes
"prize_name": "Nom du Prix",
"participant": "Participant",
"quantity": "Quantité",
"damage": "Dégâts",
"enabled": "Activé",
"disabled": "Désactivé",
"percentage": "Pourcentage",
"total_damage": "Dégâts Totaux",
"special_prize": "Prix Spécial",
"normal_prize": "Prix Normal",
"winners": "Gagnants",
"top_winners": "Nombre de Gagnants",
"id": "N°",
"select_prize": "Sélectionner Prix",
"total": "Total",
"event": "Événement",
"distributions": "Distributions",
#Contrôles de Date
"year": "Année",
"month": "Mois",
"start_date": "Date de Début",
"end_date": "Date de Fin",
"start_day": "Jour de Début",
"end_day": "Jour de Fin",
"use_date_range": "Utiliser Plage de Dates",
"date": "Date",
"months": "Janvier,Février,Mars,Avril,Mai,Juin,Juillet,Août,Septembre,Octobre,Novembre,Décembre",
#Actions
"add": "Ajouter",
"edit": "Modifier",
"delete": "Supprimer",
"save": "Enregistrer",
"cancel": "Annuler",
"clear": "Effacer",
"load": "Charger",
"toggle": "Basculer",
"received": "Reçu",
"refresh": "Actualiser",
"update_state": "Mettre à Jour l'État",
"save_state": "Enregistrer l'État",
"update_options": "Mettre à Jour les Options",
"backup_now": "Sauvegarder Maintenant",
"restore": "Restaurer",
"move_up": "Monter",
"move_down": "Descendre",
#Modes de Saisie
"single_input": "Saisie Unique",
"batch_input": "Saisie Multiple",
"integer_only": "Nombres Entiers Uniquement",
"load_prizes": "Charger Prix",
"load_participants": "Charger Participants",
"delete_with_hash": "Utilisez # pour supprimer un élément",
"batch_prize_format": "Format: nom:quantité[:s:gagnants] - Ajoutez 's:N' pour les prix spéciaux",
"batch_prize_example": "Exemple: pomme d'or:3:s:2 (prix spécial pour 2 gagnants)",
"batch_participant_format": "Format: nom:dégâts",
"batch_participant_example": "Exemple: mario:1000",
#Sauvegarde et Importation
"backup_settings": "Paramètres de Sauvegarde",
"backup_folder": "Dossier de Sauvegarde",
"enable_auto_backup": "Activer Sauvegarde Auto",
"backup_interval": "Intervalle de Sauvegarde",
"backup_retention": "Rétention des Sauvegardes",
"keep_backups": "Conserver Sauvegardes",
"select_backup": "Sélectionner Sauvegarde",
"import_folder": "Dossier d'Importation",
"import_settings": "Paramètres d'Importation",
"import_actions": "Actions d'Importation",
"data_folder": "Dossier de Données",
"auto_save": "Sauvegarde Automatique",
"default_language": "Langue par Défaut",
"font_size": "Taille de Police",
"row_height": "Hauteur des Lignes",
"tables": "Tableaux",
#Messages d'Erreur
"error": "Erreur",
"info": "Information",
"confirm": "Confirmer",
"name_required": "Nom requis",
"quantity_required": "Quantité requise",
"damage_required": "Dégâts requis",
"event_required": "Nom de l'événement requis",
"start_month_required": "Mois de début requis",
"prizes_and_participants_required": "Prix et participants requis",
"missing_separator": "Séparateur ':' manquant",
"missing_name": "Nom manquant",
"missing_value": "Valeur manquante",
"missing_winners": "Nombre de gagnants manquant pour le prix spécial",
"invalid_winners": "Nombre de gagnants invalide",
"invalid_special": "Format de prix spécial invalide",
"invalid_quantity": "Quantité invalide",
"invalid_damage": "Dégâts invalides",
"invalid_chars": "Caractères invalides dans le nom",
"invalid_value": "Valeur invalide",
"name_exists": "Nom déjà existant",
"name_exists_msg": "Un élément avec ce nom existe déjà",
"invalid_input": "Saisie invalide",
"invalid_date_range": "Plage de dates invalide",
"date_collision": "Un événement existe déjà à ces dates",
"prize_name_too_short": "Nom du prix trop court",
"prize_name_too_long": "Nom du prix trop long",
"participant_name_too_short": "Nom du participant trop court",
"participant_name_too_long": "Nom du participant trop long",
"event_name_too_long": "Le nom de l'événement ne peut pas dépasser 50 caractères",
"state_not_found": "État non trouvé",
"state_not_found_with_dates": "Aucun état trouvé avec ces dates",
"no_elements_to_update": "Aucun élément à mettre à jour",
"save_error": "Erreur lors de l'enregistrement",
"no_saved_states": "Aucun état sauvegardé",
"template_load_error": "Erreur lors du chargement du modèle",
"export_error": "Erreur lors de l'exportation",
"import_error": "Erreur lors de l'importation",
"backup_error": "Erreur lors de la sauvegarde",
"restore_error": "Erreur lors de la restauration",
"no_backup_selected": "Aucune sauvegarde sélectionnée",
"no_backups_available": "Aucune sauvegarde disponible",
"quantity_must_be_positive": "La quantité doit être positive",
"quantity_must_be_integer": "La quantité doit être un nombre entier",
"quantity_must_be_number": "La quantité doit être un nombre",
"damage_must_be_non_negative": "Les dégâts doivent être non négatifs",
"damage_must_be_integer": "Les dégâts doivent être un nombre entier",
"damage_must_be_number": "Les dégâts doivent être un nombre",
"winners_must_be_positive": "Le nombre de gagnants doit être positif",
"winners_must_be_integer": "Le nombre de gagnants doit être un nombre entier",
"winners_exceed_participants": "Le nombre de gagnants dépasse le nombre de participants",
"state_incomplete_load": "L'état contient des éléments non chargés. Procéder au chargement des éléments manquants ?",
#Confirmations
"confirm_delete": "Confirmer la suppression ?",
"confirm_delete_last_prize": "La suppression du dernier prix supprimera également l'événement. Continuer ?",
"confirm_delete_last_participant": "La suppression du dernier participant supprimera également l'événement. Continuer ?",
"confirm_delete_prize": "Êtes-vous sûr de vouloir supprimer ce prix ?",
"confirm_delete_participant": "Êtes-vous sûr de vouloir supprimer ce participant ?",
"confirm_clear_prizes": "Êtes-vous sûr de vouloir supprimer tous les prix ?",
"confirm_clear_participants": "Êtes-vous sûr de vouloir supprimer tous les participants ?",
"confirm_update": "Êtes-vous sûr de vouloir mettre à jour cet état ?",
"confirm_update_options": "Confirmer la mise à jour des options ?",
"ignore_update_options": "Voulez-vous ignorer les modifications des options ? Les modifications de données seront conservées",
"cancel_all_updates": "Voulez-vous annuler toutes les modifications ? Aucune modification ne sera enregistrée",
"confirm_restore": "Êtes-vous sûr de vouloir restaurer cette sauvegarde ?",
"confirm_new_state": "Il y a des modifications non sauvegardées. Voulez-vous continuer avec un nouvel état ?",
"confirm_discard_changes": "Confirmer l'annulation des modifications ?",
#Messages de Succès
"state_saved": "État enregistré avec succès",
"state_updated": "État mis à jour avec succès",
"backup_created": "Sauvegarde créée avec succès",
"restore_completed": "Restauration terminée",
"export_completed": "Exportation terminée",
"preferences_saved": "Préférences enregistrées",
"changes_saved": "Modifications enregistrées",
#Messages de Journal
"log_app_initialized": "Application initialisée",
"log_ui_components_initialized": "Composants UI initialisés",
"log_styles_configured": "Styles configurés",
"log_language_selector_created": "Sélecteur de langue créé",
"log_top_frame_created": "Cadre supérieur créé",
"log_state_frame_created": "Cadre d'état créé",
"log_date_controls_created": "Contrôles de date créés",
"log_date_range_frames_setup": "Cadres de plage de dates configurés",
"log_month_values_updated": "Valeurs des mois mises à jour",
"log_buttons_state_updated": "État des boutons mis à jour",
"log_prize_headers_updated": "En-têtes des prix mis à jour",
"log_participant_headers_updated": "En-têtes des participants mis à jour",
"log_distribution_headers_updated": "En-têtes de distribution mis à jour",
"log_history_headers_updated": "En-têtes d'historique mis à jour",
"log_tables_content_refreshed": "Contenu des tableaux actualisé",
"log_tables_updated": "Tableaux mis à jour",
"log_ui_text_updated": "Texte UI mis à jour",
"log_month_combos_setup": "Combos des mois configurés",
"log_day_combos_setup": "Combos des jours configurés",
"log_year_frame_created": "Cadre année créé",
"log_date_range_frame_created": "Cadre plage de dates créé",