Appearance
User
User locale. Read the viewer's timezone and language — for date/number formatting and localized labels. This is locale only: no precise geolocation, no IP, no account identity. Accessed via snaptrude.core.user.
Functions
getLocale()
Get the viewer's locale: IANA timezone and BCP-47 language tag, resolved from the browser (Intl.DateTimeFormat().resolvedOptions().timeZone and navigator.language).
- Returns:
{ timezone: string; language: string }— e.g.{ timezone: "Asia/Kolkata", language: "en-US" }.
ts
const { timezone, language } = await snaptrude.core.user.getLocale();Errors
getLocale is a total read — it never rejects; it returns whatever the browser reports.