RAYXPRESS MULTILINGUAL SYSTEM
============================

This build adds one shared multilingual architecture for the public website,
client accounts, shipment notifications, direct client email, email replies,
and live chat.

DATABASE
--------
Import once:
  database/migrations/20260816_multilingual_system.sql

TRANSLATION ENGINE
------------------
Master Pro -> Languages & Translations controls:
- Enabled languages
- Default website language
- Country -> language mapping
- Automatic website translation
- Automatic email translation
- Translation model
- OpenAI API key (Master Pro only)
- Fixed translation entries

The current default dynamic translation model is gpt-5.6.

API KEY
-------
The Master Pro Languages & Translations page can securely store the OpenAI
API key encrypted with the existing RayXpress mail encryption key.
Alternatively set OPENAI_API_KEY or RAYXPRESS_TRANSLATION_API_KEY in the
server environment.

LANGUAGE PRIORITY
-----------------
1. Saved client preferred language
2. Visitor language selection
3. Browser language / browser region
4. Country mapping (Cloudflare country header when available)
5. Website default language

CLIENT REGISTRATION
-------------------
Registration defaults the Preferred Language from the visitor's detected
language. The client may change it before completing registration. The saved
account preference is used for future website and communication language.

SHIPMENTS
---------
Master can select Preferred Client Language when creating a shipment, even
before the client has an account. The shipment stores that language.
Once the client registers with the same email, the account preference takes
priority for future communications.

EMAIL
-----
Automated branded emails use the client's preferred language. Master direct
emails and direct replies are translated from the Master's selected language
to the client's preferred language while preserving names, shipment numbers,
tracking codes, URLs, dates, amounts, addresses and brand names.

LIVE CHAT
---------
Live chat stores the original message and a translated copy. Master messages
are translated to the client's preferred language; client/guest messages are
translated to the assigned Master's preferred language. Automatic chat replies
also follow the client's preferred language.

WEBSITE
-------
The public website receives a professional language selector. The page
translation layer caches machine translations in translation_entries so the
same interface text is not translated repeatedly.
