INNER CODE UNIT · Python

get_time_format

GHJJ123/brainrotguard · i18n/__init__.py:56

def get_time_format(config) -> str:
    """Extract normalized time format from config."""
    app = getattr(config, "app", None)
    return normalize_time_format(getattr(app, "time_format", DEFAULT_TIME_FORMAT))


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")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…