# Phase 8 i18n Cleanup + UI Text Hardening

## Current Baseline

Source report: `docs/i18n_coverage_report.md`

- Missing keys in `fr`: 0
- Missing keys in `ar`: 0
- Empty/TODO values: 0
- Potential hardcoded UI strings: 2163
- Potential unused keys: 1947

## Finding Classification

### 1) Real Hardcoded UI Strings To Fix

These are visible labels, buttons, headings, print/PDF copy, page titles, ARIA labels, placeholders, and operational notices.

- `resources/views/admin/registrations/print.blade.php`: print receipt headings, table headers, labels, button text, and footer text.
- `resources/views/components/layouts/admin.blade.php`: default admin layout title.
- `resources/views/components/layouts/auth.blade.php`: default auth layout title.
- `resources/views/components/layouts/course-player.blade.php`: default course player title.
- `resources/views/components/layouts/portal.blade.php`: mobile menu ARIA labels.
- `resources/views/components/public/header.blade.php`: main navigation, language switch, and menu ARIA labels.
- `resources/views/components/portal/breadcrumbs.blade.php`: breadcrumb ARIA label.
- `resources/views/components/pii/text.blade.php`: reveal PII title.

### 2) False Positives Not To Change

These are technical or dynamic strings and should remain as code unless a concrete UI issue is found.

- PHP variable names such as `$titleField`, `$shortDescField`, `$sectionTitle`.
- Blade props such as `title`, `subtitle`, `label`, `placeholder`.
- Tailwind/CSS classes, Alpine expressions, Livewire event names, route names, and SVG paths.
- Dynamic arrays already populated from translated sources, for example `$item['label']`, `$feature['title']`, `$title`, and CMS block content.
- Brand marks intentionally visible as brand text, for example `ECOIN`.

### 3) Print/PDF Pages Needing Translation

These should use `lang/ar/print.php` and `lang/fr/print.php` or the specific domain translation file.

- Registration receipt print page.
- Corporate proposal PDF.
- Corporate agreement PDF.
- Corporate invoice PDF.
- Corporate final report PDF.
- Credit note PDF.
- Certificate and receipt templates where labels are static.

### 4) Dev/Demo Pages

`resources/views/dev/*` contains UI kit examples and demo labels. These should be ignored by the i18n checker in production reports and not treated as launch blockers.

## Phase 8 Scope Implemented First

This phase starts with the highest-confidence real hardcoded strings:

1. Registration receipt print page.
2. Shared ARIA labels.
3. Default layout titles.
4. i18n checker options and false-positive configuration.
5. Unused-key review documentation without deleting keys.

## Verification Snapshot

After the first cleanup pass and false-positive configuration:

- `php artisan i18n:check --write --fail-on-missing --fail-on-empty --ignore-false-positives`
- Missing keys in `fr`: 0
- Missing keys in `ar`: 0
- Empty/TODO values: 0
- Potential hardcoded UI strings: 678
- Potential unused keys: 1947

The remaining hardcoded list is now much smaller and mostly concentrated in export/print templates, legacy Blade comments, and UI component props that need targeted review rather than bulk replacement.

## Forward Policy

- New user-facing text must be added through translation files.
- Shared actions and ARIA labels go to `common.php`.
- Admin-only shell text goes to `admin.php`.
- Auth shell text goes to `auth.php`.
- Course player shell text goes to `player.php`.
- Print/PDF labels go to `print.php` unless a domain-specific file is more appropriate.
- Dynamic database content with AR/FR fields must not be replaced with static translation keys.
