INNER CODE UNIT · Python
t
GHJJ123/brainrotguard · i18n/__init__.py:62
def t(locale: str | None, key: str, **kwargs) -> str:
"""Translate a text key with English fallback."""
normalized = normalize_locale(locale)
text = _TRANSLATIONS.get(normalized, {}).get(key, key)
if kwargs:
return text.format(**kwargs)
return text
def app_name(locale: str | None) -> str:
"""Return the localized application name."""
return t(locale, "App Name")
def category_label(category: str, locale: str | None, short: bool = False) -> str:
"""Return localized category label."""
if short:
if category == "edu":