-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconstants.py
More file actions
57 lines (52 loc) 路 2.13 KB
/
Copy pathconstants.py
File metadata and controls
57 lines (52 loc) 路 2.13 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
# Right-to-Left (RTL) languages that require special text direction handling
RTL_LANGUAGES = {
'ar', # Arabic
'fa', # Persian/Farsi
'he', # Hebrew (DeepL)
'iw', # Hebrew (Gemini)
'ur', # Urdu
'ku', # Kurdish
'sd', # Sindhi
'ps', # Pashto
'yi', # Yiddish
'ckb', # Kurdish (Sorani) - DeepL Beta
'prs', # Dari - DeepL Beta
'dv', # Dhivehi - Gemini
'ug' # Uyghur - Gemini
}
# DeepL Beta Languages (require enable_beta_languages=True and model_type="quality_optimized")
DEEPL_BETA_LANGUAGES = {
'ACE', 'AF', 'AN', 'AS', 'AY', 'AZ', 'BA', 'BE', 'BHO', 'BN', 'BR', 'BS',
'CA', 'CEB', 'CKB', 'CY', 'EO', 'EU', 'FA', 'GA', 'GL', 'GN',
'GOM', 'GU', 'HA', 'HI', 'HR', 'HT', 'HY', 'IG', 'IS', 'JV', 'KA', 'KK',
'KMR', 'KY', 'LA', 'LB', 'LMO', 'LN', 'MAI', 'MG', 'MI', 'MK', 'MN', 'MR',
'MS', 'MT', 'MY', 'NE', 'OC', 'PAG', 'PAM', 'PRS', 'PS', 'QU', 'SA', 'SCN',
'SQ', 'SR', 'SU', 'SW', 'TA', 'TE', 'TG', 'TK', 'TL', 'TN', 'TS', 'TT',
'UR', 'UZ', 'WO', 'XH', 'YUE'
}
# Version Management - Centralized version control
APP_VERSION = "v4.0.1"
APP_RELEASE_DATE = "4 May 2026"
APP_RELEASE_DATE_POLISH = "4 maja 2026 r."
GITHUB_API_URL = "https://api.github.com/repos/tomkam1702/OCR-Translator/releases/latest"
def parse_version(version_str):
"""Parse version string like 'v3.5.7' into comparable tuple (3, 5, 7)"""
try:
# Remove 'v' prefix if present and split by '.'
clean_version = version_str.lstrip('v')
return tuple(map(int, clean_version.split('.')))
except (ValueError, AttributeError):
# Fallback for invalid version strings
return (0, 0, 0)
def is_newer_version(current, latest):
"""Compare two version strings and return True if latest > current"""
try:
current_tuple = parse_version(current)
latest_tuple = parse_version(latest)
return latest_tuple > current_tuple
except Exception:
# If comparison fails, assume no update needed
return False
def get_current_version():
"""Get the current application version"""
return APP_VERSION