#3055·CTFd

[i18n] Fix babel.cfg extraction bug + full admin panel translation coverage

Author: defojecoCreated May 30, 2026Updated May 30, 2026

Problem

The CTFd admin panel has zero i18n coverage. Root cause: babel.cfg pointed at a non-existent theme (core-beta), so no admin strings were ever extracted into .pot. This has silently blocked admin panel translations since i18n was introduced in 3.6.

As a result:

  • .pot contained only 190 msgids (user-facing theme strings)
  • All 68 admin templates were completely untranslated
  • All admin Python form labels/choices were unwrapped

What this PR fixes

  • babel.cfg — fixed jinja glob to point at admin/ + core/ templates (.pot grew from 190 → 678 msgids)
  • 68 admin templates — wrapped with {% trans %}/_()
  • Python forms — wrapped labels, choices, descriptions in users.py, teams.py, challenges.py, config.py, awards.py, notifications.py, pages.py, submissions.py, email.py, self.py
  • Challenge type display — {{ _(type) }} + extraction anchors for standard/dynamic
  • RTL support — dir attribute + rtl.css for Arabic/Hebrew
  • 9 languages fully filled: ru, de, es, fr, pl, ja, ar, zh_Hans, zh_Hant — 0 empty, 0 fuzzy
  • All 31 catalogs recompiled cleanly (0 errors, 0 warnings)
  • Existing Crowdin translations preserved (pybabel update, never init)

Known limitations (out of scope)

  • Add comment/Comment button — lives in CommentBox.vue, requires Vue i18n + Vite rebuild
  • lines:/words: — CodeMirror third-party library
  • Compiled Vite admin bundles — no JS i18n infrastructure in CTFd

Testing

Tested locally with Russian locale — admin panel renders translated strings throughout. English fallback intact.

Crowdin will pick up the 488 new .pot strings for the remaining ~22 languages automatically.