mirror of
http://forgejo-oa09toasww4dgii9cj3gpzda.187.127.164.61.sslip.io/iamcoolvivek007/bharath.git
synced 2026-06-11 00:06:51 +00:00
- Multi-language support (English, Hindi, Tamil, Telugu) with icon-based UI - Voice input (Web Speech API) for low-literacy users - Driver tools: Ledger, Trip Planner, Return Load, Safety, Maintenance, FASTag - Marketplace: WhatsApp share, Rate Intelligence, Classifieds, Fleet - Engagement: Gamification (XP/Levels), Challenges, Leaderboard, Referrals, Feed - Business: Invoice (GST+UPI), Reports+CSV, Notifications, Documents, Bank - Games: Rate Guesser, Route Quiz - SEO: Sitemap, public load share pages with OG tags - India utilities: vehicle validation, UPI links, toll/fuel calculator - 29 routes, 54 templates, 4 languages, 3 migration files
2 KiB
2 KiB
Multi-Language Support with Icon-Based UI
Overview
Add Hindi, English, Tamil, and Telugu language support to BharathTrucks with large icon-based buttons designed for low-literacy users.
Requirements
- Support 4 languages: Hindi (default), English, Tamil, Telugu
- Language switcher in header — persisted in session
- All navigation and action buttons use large icons with minimal text labels
- Bottom nav and dashboard buttons are icon-first (large emoji/SVG + short label)
- Low-literacy friendly: icons convey meaning without reading
Technical Design
i18n Approach
- Simple JSON translation files in
src/i18n/{lang}.json - Middleware reads
req.session.lang(default:hi) and attachest()helper tores.locals - No external i18n library needed — lightweight custom implementation
Language Switcher
GET /lang/:coderoute setsreq.session.langand redirects back- Header shows 4 flag/label buttons: हिंदी | EN | தமிழ் | తెలుగు
Icon-Based UI for Low-Literacy Users
- Bottom nav: larger icons (40px), short label below
- Dashboard action buttons: icon-button class with 48px emoji + label
- All key actions identifiable by icon alone (🚛 truck, 📋 loads, 💰 money, etc.)
Files Changed
src/i18n/hi.json— Hindi translationssrc/i18n/en.json— English translationssrc/i18n/ta.json— Tamil translationssrc/i18n/te.json— Telugu translationssrc/middleware/i18n.js— language detection middlewaresrc/server.js— add i18n middleware +/lang/:coderoutesrc/views/partials/header.ejs— language switchersrc/views/partials/bottom-nav.ejs— icon-first navsrc/views/pages/driver-dashboard.ejs— icon-based action buttonssrc/public/css/govt-theme.css— icon-button styles
Testing
- Switch language via header buttons, verify all labels change
- Verify icons are large and clear on mobile
- Verify session persists language across page navigations