# DigiDala Alpha 50.9.11 — Localized legal documents

**Status:** local release candidate; not committed, tagged or deployed.

## Scope

This follow-up release addresses a manual QA gap found in `v0.4.0-alpha.50.9.10`: the legal pages were published only in Russian even when the Mini App or bot was using English.

### Public legal documents

- Adds English source documents under `docs/legal/en/` for the four public documents.
- Generates a complete English document set under `apps/miniapp/legal/en/`.
- Keeps the existing Russian URLs stable.
- Adds a separate English index at `/apps/miniapp/legal/en/index.html`.

### Mini App

- Legal footer links now follow the active Mini App locale.
- Legal footer links stay inside the current Telegram Mini App WebView instead of opening a new browser tab.
- RU opens the existing `/legal/*.html` pages.
- EN opens the new `/legal/en/*.html` pages.
- Bumps the Mini App `app.js` cache-busting version so the new locale-aware link logic is loaded after deployment.

### Telegram bot

- Localized legal keyboard URLs now follow the user's saved RU/EN locale.
- `/terms`, `/rules`, `/privacy`, `/payments` and `/paysupport` all open the matching localized document.
- In private chats, legal buttons use Telegram `web_app` buttons so the document opens inside the Mini App WebView.
- In group chats, legal buttons use Main Mini App `startapp` deep links that route into the same localized document inside the WebView.

### Publication metadata and tests

- The publication map documents both locale sets and stable paths.
- Legal publication tests verify both RU and EN source hashes, generated pages and locale-aware links.

## Acceptance criteria

1. `npm run build:legal` generates four documents in each locale plus both indexes.
2. Every generated page contains the SHA-256 hash of its corresponding source document.
3. Mini App RU links open Russian documents and EN links open English documents after a locale switch.
4. Bot legal commands and `/paysupport` use the user's locale-specific Mini App document routes.
5. Telegram legal buttons open documents inside a Mini App/WebView in both supported chat contexts: `web_app` in private chats and Main Mini App deep links in groups.
6. Existing Mandala, payment, moderation, navigation and locale persistence mechanics remain unchanged.
7. Automated verification passes locally and on the deployed tag.
8. Manual Telegram/Mini App QA confirms RU/EN document routing and in-WebView opening from bot buttons.
