සිංහල ⇄ Italiano — Sinhala ↔ Italian translator (PHP / MySQL PWA)
====================================================================

A mobile-first, iOS-installable translator. Google Translate runs through a
server-side proxy (no CORS issues on iOS Safari), Italian output shows a
Sinhala phonetic reading, Italian text-to-speech, and saved history in MySQL.

FILES
  index.php       Main app (UI + transliterator + PWA hooks)
  translate.php   Server-side Google Translate proxy (cURL)
  history.php     Save / list / clear saved translations (JSON)
  setup.php       One-click installer — creates the table, writes config
  config.php      Database credentials
  db.php          PDO connection + CSRF helpers
  manifest.json   PWA manifest
  sw.js           Service worker (offline app shell)
  icon-*.png      App icons

DEPLOY (your usual cloudxweb.com flow)
  1. Upload all files to a subdomain folder.
  2. Create a MySQL database (e.g. "silit").
  3. Open setup.php in a browser, enter the DB details, run setup.
  4. Delete setup.php.
  5. Open index.php. On iPhone: Share → Add to Home Screen.

REQUIREMENTS
  PHP 7.4+ with PDO + cURL enabled, MySQL/MariaDB (utf8mb4).

NOTES
  - Default direction is Sinhala → Italian; tap the swap button to reverse.
  - Microphone input uses the Web Speech API and is shown only where the
    browser supports it. iOS Safari currently has no speech recognition, so
    the mic button stays hidden there; typing and TTS work everywhere.
  - Italian voice (it-IT) is reliable on iOS. A Sinhala voice may not be
    installed on every device, so Sinhala "Listen" can be silent.
  - The phonetic line under Italian output is a rule-based approximation to
    help with pronunciation, not a strict IPA transcription.
