fix(i18n): add Norwegian translation support and improve error logging

- Add 'nb' (Norwegian Bokmål) to translation extraction script
  This ensures Norwegian translations are properly included when
  extracting and updating translation catalogs.

- Improve translation compilation error logging
  Add exc_info=True to log full exception tracebacks when translation
  compilation fails, making it easier to diagnose issues with missing
  or corrupted .mo files.

Fixes issue where Norwegian (norsk) translations were not working
due to missing compiled .mo files. The app will now properly compile
Norwegian translations on startup, and any compilation errors will
be logged with full stack traces for debugging.
This commit is contained in:
Dries Peeters
2025-11-18 06:22:59 +01:00
parent d44e13847b
commit bcb6b6ee86
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ def main():
run(['pybabel', 'extract', '-F', 'babel.cfg', '-o', 'messages.pot', '.'])
# Initialize languages if not already
languages = ['en', 'nl', 'de', 'fr', 'it', 'fi', 'es', 'ar', 'he']
languages = ['en', 'nl', 'de', 'fr', 'it', 'fi', 'es', 'ar', 'he', 'nb']
for lang in languages:
po_dir = os.path.join('translations', lang, 'LC_MESSAGES')
po_path = os.path.join(po_dir, 'messages.po')