-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtranslations.py
More file actions
225 lines (192 loc) · 8.29 KB
/
translations.py
File metadata and controls
225 lines (192 loc) · 8.29 KB
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
"""
Sistema di traduzioni per iOS-ShareEasy
"""
TRANSLATIONS = {
"it": {
# Finestra principale
"window_title": "iOS-ShareEasy Server",
"title": "iOS-ShareEasy Server",
"ip_address": "Indirizzo IP:",
"port": "Porta:",
"server_url": "URL Server:",
"copy_url": "📋 Copia URL",
"url_warning": "⚠️ Inserisci questo URL nella Shortcut iOS, nella variabile chiamata \"endpoint\"",
"minimize": "➖ Riduci ad Icona",
"open_folder": "📂 Apri Cartella File",
"info_button": "ℹ️ Info",
# Checkbox
"enable_copy": "Abilita copia testo negli appunti",
"enable_file": "Abilita ricezione file",
"enable_notifications": "Abilita notifiche",
"enable_autostart": "Avvio automatico all'accensione del PC",
"hide_tray_icon": "Nascondi icona nella barra delle applicazioni",
"detailed_notifications": "Notifiche dettagliate (mostra contenuto e statistiche)",
"start_minimized": "Avvia ridotto a icona",
# Path
"save_path_label": "Cartella di salvataggio file:",
"browse": "Sfoglia...",
# Status bar
"server_running": "Server in esecuzione",
"url_copied": "✅ URL copiato negli appunti!",
# Messaggi
"url_copied_title": "URL Copiato",
"url_copied_message": "L'URL è stato copiato negli appunti:\n\n{url}\n\nIncollalo nella tua Shortcut iOS!",
# System tray
"tray_show": "Mostra",
"tray_quit": "Esci",
"tray_tooltip": "iOS-ShareEasy Server",
"tray_message_title": "iOS-ShareEasy",
"tray_message_text": "L'applicazione continua a funzionare in background",
# Notifiche
"notification_text_copied": "Testo copiato da {device}",
"notification_text_copied_detailed": "Clipboard copiata da {device}\n\n{content}",
"notification_file_received": "File ricevuto da {device}: {filename}",
"notification_file_received_detailed": "File ricevuto da {device}\n\nFile: {filename}\nDimensione: {size}\nVelocità: {speed}",
# Folder dialog
"select_folder": "Seleziona cartella",
# GitHub
"github_info": "Progetto open source •",
# About dialog
"about_title": "Informazioni - iOS-ShareEasy",
"about_text": """<h2>iOS-ShareEasy v1.0.0</h2>
<p>Server locale per condividere file e testo da iOS a Windows</p>
<p><b>Sviluppato da:</b> spectreDeveloper</p>
<p><b>Repository GitHub:</b><br>
<a href="https://github.com/spectreDeveloper/iOS-ShareEasy">github.com/spectreDeveloper/iOS-ShareEasy</a></p>
<p><b>Licenza:</b> MIT License</p>
<p style="margin-top: 15px; color: #666;">
⭐ Se ti piace questo progetto, lascia una stella su GitHub!<br>
🐛 Hai trovato un bug? Apri una issue!<br>
💡 Hai suggerimenti? Contribuisci al progetto!
</p>""",
# First run welcome
"welcome_title": "Benvenuto in iOS-ShareEasy!",
"welcome_message": """<h2>👋 Benvenuto!</h2>
<p>Grazie per aver installato <b>iOS-ShareEasy</b>!</p>
<h3>📍 Posizione consigliata</h3>
<p>Per una migliore esperienza, ti consigliamo di spostare l'eseguibile nella cartella:</p>
<p style="background-color: #f0f0f0; padding: 10px; font-family: monospace;">
<b>C:\\Program Files\\iOS-ShareEasy\\</b>
</p>
<h3>⚙️ Perché?</h3>
<ul>
<li>✅ Organizzazione migliore dei programmi</li>
<li>✅ Percorso fisso per l'avvio automatico</li>
<li>✅ Conformità alle best practice di Windows</li>
</ul>
<h3>🚀 Prossimi passi</h3>
<ol>
<li>Crea la cartella <code>C:\\Program Files\\iOS-ShareEasy</code></li>
<li>Sposta l'eseguibile in quella cartella</li>
<li>Crea un collegamento sul Desktop (opzionale)</li>
<li>Riavvia l'applicazione dalla nuova posizione</li>
</ol>
<p style="color: #666; margin-top: 15px;">
💡 <i>Questo messaggio verrà mostrato solo una volta.</i>
</p>""",
},
"en": {
# Main window
"window_title": "iOS-ShareEasy Server",
"title": "iOS-ShareEasy Server",
"ip_address": "IP Address:",
"port": "Port:",
"server_url": "Server URL:",
"copy_url": "📋 Copy URL",
"url_warning": "⚠️ Insert this URL in the iOS Shortcut, in the variable named \"endpoint\"",
"minimize": "➖ Minimize to Tray",
"open_folder": "📂 Open Files Folder",
"info_button": "ℹ️ Info",
# Checkbox
"enable_copy": "Enable clipboard text copy",
"enable_file": "Enable file reception",
"enable_notifications": "Enable notifications",
"enable_autostart": "Start automatically on PC boot",
"hide_tray_icon": "Hide system tray icon",
"detailed_notifications": "Detailed notifications (show content and statistics)",
"start_minimized": "Start minimized to tray",
# Path
"save_path_label": "File save folder:",
"browse": "Browse...",
# Status bar
"server_running": "Server running",
"url_copied": "✅ URL copied to clipboard!",
# Messages
"url_copied_title": "URL Copied",
"url_copied_message": "The URL has been copied to clipboard:\n\n{url}\n\nPaste it into your iOS Shortcut!",
# System tray
"tray_show": "Show",
"tray_quit": "Quit",
"tray_tooltip": "iOS-ShareEasy Server",
"tray_message_title": "iOS-ShareEasy",
"tray_message_text": "The application continues running in background",
# Notifications
"notification_text_copied": "Text copied from {device}",
"notification_text_copied_detailed": "Clipboard copied from {device}\n\n{content}",
"notification_file_received": "File received from {device}: {filename}",
"notification_file_received_detailed": "File received from {device}\n\nFile: {filename}\nSize: {size}\nSpeed: {speed}",
# Folder dialog
"select_folder": "Select folder",
# GitHub
"github_info": "Open source project •",
# About dialog
"about_title": "About - iOS-ShareEasy",
"about_text": """<h2>iOS-ShareEasy v1.0.0</h2>
<p>Local server to share files and text from iOS to Windows</p>
<p><b>Developed by:</b> spectreDeveloper</p>
<p><b>GitHub Repository:</b><br>
<a href="https://github.com/spectreDeveloper/iOS-ShareEasy">github.com/spectreDeveloper/iOS-ShareEasy</a></p>
<p><b>License:</b> MIT License</p>
<p style="margin-top: 15px; color: #666;">
⭐ If you like this project, leave a star on GitHub!<br>
🐛 Found a bug? Open an issue!<br>
💡 Have suggestions? Contribute to the project!
</p>""",
# First run welcome
"welcome_title": "Welcome to iOS-ShareEasy!",
"welcome_message": """<h2>👋 Welcome!</h2>
<p>Thank you for installing <b>iOS-ShareEasy</b>!</p>
<h3>📍 Recommended Location</h3>
<p>For a better experience, we recommend moving the executable to:</p>
<p style="background-color: #f0f0f0; padding: 10px; font-family: monospace;">
<b>C:\\Program Files\\iOS-ShareEasy\\</b>
</p>
<h3>⚙️ Why?</h3>
<ul>
<li>✅ Better program organization</li>
<li>✅ Fixed path for autostart</li>
<li>✅ Follows Windows best practices</li>
</ul>
<h3>🚀 Next Steps</h3>
<ol>
<li>Create the folder <code>C:\\Program Files\\iOS-ShareEasy</code></li>
<li>Move the executable to that folder</li>
<li>Create a Desktop shortcut (optional)</li>
<li>Restart the application from the new location</li>
</ol>
<p style="color: #666; margin-top: 15px;">
💡 <i>This message will only be shown once.</i>
</p>""",
}
}
class Translator:
def __init__(self, language="it"):
self.language = language
self.set_language(language)
def set_language(self, language):
"""Imposta la lingua"""
if language in TRANSLATIONS:
self.language = language
self.strings = TRANSLATIONS[language]
else:
self.language = "en"
self.strings = TRANSLATIONS["en"]
def get(self, key, **kwargs):
"""Ottiene una stringa tradotta"""
text = self.strings.get(key, key)
if kwargs:
text = text.format(**kwargs)
return text
def __call__(self, key, **kwargs):
"""Shortcut per get()"""
return self.get(key, **kwargs)