TenantAtlas/apps/platform/tests/Feature/Localization/TranslationFallbackGuardTest.php
ahmido 7613e339c4
Some checks failed
Main Confidence / confidence (push) Failing after 56s
feat: implement platform localization v1 (#293)
## Summary
- add the localization v1 foundation with request-time locale resolution and workspace or user preference handling
- localize the first-wave platform surfaces for auth, shell, dashboards, findings, baseline compare, and review workspace chrome
- add Pest coverage for locale resolution, preference flows, fallback behavior, notifications, and governance surface localization

## Scope
- active spec: specs/252-platform-localization-v1
- target branch: dev

## Notes
- machine-readable artifacts remain invariant and are not localized in this slice
- the branch includes the related spec kit artifacts for the feature

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #293
2026-04-28 19:45:03 +00:00

24 lines
872 B
PHP

<?php
declare(strict_types=1);
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Lang;
it('falls back to English for missing German translation lines', function (): void {
Lang::addLines(['localization.fallback_probe' => 'English fallback probe'], 'en');
App::setFallbackLocale('en');
App::setLocale('de');
expect(__('localization.fallback_probe'))->toBe('English fallback probe');
});
it('does not expose raw translation keys for supported first-wave catalogs', function (): void {
App::setLocale('de');
expect(__('localization.auth.sign_in_microsoft'))->not->toBe('localization.auth.sign_in_microsoft')
->and(__('baseline-compare.button_view_findings'))->not->toBe('baseline-compare.button_view_findings')
->and(__('findings.rbac.restore_unsupported'))->not->toBe('findings.rbac.restore_unsupported');
});