Spaces:
Building
Building
Update locale_manager.py
Browse files- locale_manager.py +3 -7
locale_manager.py
CHANGED
@@ -8,11 +8,7 @@ from pathlib import Path
|
|
8 |
from typing import Dict, List, Optional
|
9 |
from datetime import datetime
|
10 |
import sys
|
11 |
-
|
12 |
-
def log(message: str):
|
13 |
-
timestamp = datetime.now().strftime("%H:%M:%S.%f")[:-3]
|
14 |
-
print(f"[{timestamp}] {message}")
|
15 |
-
sys.stdout.flush()
|
16 |
|
17 |
class LocaleManager:
|
18 |
"""Manages locale files for TTS preprocessing and system-wide language support"""
|
@@ -101,10 +97,10 @@ class LocaleManager:
|
|
101 |
"english_name": locale_data.get("english_name", locale_code)
|
102 |
})
|
103 |
|
104 |
-
|
105 |
|
106 |
except Exception as e:
|
107 |
-
|
108 |
|
109 |
# Sort by name for consistent ordering
|
110 |
cls._available_locales.sort(key=lambda x: x['name'])
|
|
|
8 |
from typing import Dict, List, Optional
|
9 |
from datetime import datetime
|
10 |
import sys
|
11 |
+
from logger import log_info, log_error, log_debug, log_warning
|
|
|
|
|
|
|
|
|
12 |
|
13 |
class LocaleManager:
|
14 |
"""Manages locale files for TTS preprocessing and system-wide language support"""
|
|
|
97 |
"english_name": locale_data.get("english_name", locale_code)
|
98 |
})
|
99 |
|
100 |
+
log_info(f"β
Loaded locale: {locale_code} - {locale_data.get('name', 'Unknown')}")
|
101 |
|
102 |
except Exception as e:
|
103 |
+
log_error(f"β Failed to load locale {locale_file}", e)
|
104 |
|
105 |
# Sort by name for consistent ordering
|
106 |
cls._available_locales.sort(key=lambda x: x['name'])
|