Add FA/EN locale, home activity charts, and theme-aware polish.

Ship shared LocaleProvider, business/customer i18n, branding defaultLocale, curated home tiles with dual 30-day charts, and chart/page aura tokens; refresh PROJECT_CONTEXT.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-08-01 09:35:27 +03:30
co-authored by Cursor
parent f5b2193ba1
commit 66004a0fba
112 changed files with 4338 additions and 1061 deletions
@@ -0,0 +1,37 @@
export type DashboardLocale = 'en' | 'fa'
export const DASHBOARD_LOCALE_STORAGE_KEY = 'meshkee.dashboard.locale'
export function isDashboardLocale(value: unknown): value is DashboardLocale {
return value === 'en' || value === 'fa'
}
export function getLocaleDirection(locale: DashboardLocale): 'ltr' | 'rtl' {
return locale === 'fa' ? 'rtl' : 'ltr'
}
export function applyDocumentLocale(locale: DashboardLocale): void {
if (typeof document === 'undefined') return
const root = document.documentElement
root.lang = locale
root.dir = getLocaleDirection(locale)
}
export function readStoredLocale(fallback: DashboardLocale = 'fa'): DashboardLocale {
if (typeof localStorage === 'undefined') return fallback
try {
const raw = localStorage.getItem(DASHBOARD_LOCALE_STORAGE_KEY)
return isDashboardLocale(raw) ? raw : fallback
} catch {
return fallback
}
}
export function writeStoredLocale(locale: DashboardLocale): void {
if (typeof localStorage === 'undefined') return
try {
localStorage.setItem(DASHBOARD_LOCALE_STORAGE_KEY, locale)
} catch {
// ignore quota / private mode
}
}