CoolFace
Apppublic

SRNI-2005/ctf

sourceHugging Faceupdated 6mo agoView on Hugging Face
0likes
language.py20 linesDownload Raw Back to forms
1from wtforms import RadioField2 3from CTFd.constants.languages import LANGUAGE_NAMES4from CTFd.forms import BaseForm5 6 7def LanguageForm(*args, **kwargs):8    from CTFd.utils.user import get_locale9 10    class _LanguageForm(BaseForm):11        """Language form for only switching langauge without rendering all profile settings"""12 13        language = RadioField(14            "",15            choices=LANGUAGE_NAMES.items(),16            default=get_locale(),17        )18 19    return _LanguageForm(*args, **kwargs)20