A software developer has detailed the architecture behind a dedicated bilingual prayer-times web utility for Riyadh, Saudi Arabia, highlighting the technical nuances of regional astronomical calculations and localized web implementation. The project demonstrates how matching localized data standards—specifically the Saudi official Umm al-Qura standard—is critical for domain accuracy when building utility apps.
Standardizing Calculations and Architectural Caching
Prayer-time calculations vary globally because different organizations apply distinct sun horizon twilight angles. While standard methods like the Muslim World League use an 18-degree angle for Fajr and Isha, Saudi Arabia's official Umm al-Qura standard applies an 18.5-degree angle for Fajr and a fixed 90-minute interval after Maghrib for Isha, which expands to 120 minutes during Ramadan. To serve Riyadh correctly, the utility fetches data via the Aladhan API configured with Umm al-Qura parameters for Riyadh's specific coordinates (24.7136° N, 46.6753° E).
To maintain page speed and minimize external service dependencies, daily timetable data is precalculated through scheduled cron jobs, saved as structured meta, and cached via WordPress transients rather than executing API calls during page loads. An automated background verification process secondary to the primary fetch layer cross-checks calculated outputs against an independent Umm al-Qura implementation to alert maintainers if time drift occurs.
Engineering Arabic Typography and RTL Layouts
Designing a bilingual interface required specific frontend adjustments for right-to-left (RTL) reading. The layout uses CSS logical properties such as margin-inline-start and padding-inline-end instead of hardcoded physical margins, ensuring proper visual alignment and mirrored UI elements across language toggles.
dynamic Open Graph image generation initially produced disconnected Arabic glyphs because basic image rendering engines lack native complex text layout capabilities. To resolve letter shaping and right-to-left ordering issues in share cards, the image pipeline was updated to a rendering stack with contextual shaping support. The site also includes an interactive numeric toggle allowing users to switch between Eastern Arabic and Western digits.
Static Precomputing and Performance Optimization
To support low latency on mobile hardware, daily schedules are served as static cached HTML. Language variations are isolated across dedicated URL structures, using hreflang tags to guide search engine indexing. By adopting system font stacks with Arabic fallbacks and avoiding client-side rendering engines, the application maintains fast Largest Contentful Paint metrics without reliance on heavy page-builder plugins.
AI-generated editorial illustration; not a documentary photograph.
Source: How I built a bilingual prayer-times site for Riyadh (WordPress + Umm al-Qura API)

Leave a Reply