v1.2.4
Highlights
Install translations now actually flow from escalated-dev/locale (#90)
The central escalated-dev/locale package was already declared as a composer dep but wasn't actually serving any translations — its JSON uses camelCase keys (matching the Vue frontend) while every PHP-side __() call used snake_case, so the central package was effectively dead weight and translations came entirely from the package's own resources/lang/ PHP fallback.
This release wires the install command to actually pull from central:
- New JSON-to-Translator bridge in
EscalatedServiceProvider(bridgeCentralGroups()) reads each<locale>.jsonfromescalated-dev/localeand injects the nested data into Laravel's translator under theescalatednamespace viaaddLines(). After the bridge fires,__('escalated::commands.install.publishingConfig')resolves against the central JSON. The PHP fallback'scommands.phpis no longer loaded for thecommandsgroup in production — central is the single source of truth. - The bridge auto-converts central's
{placeholder}syntax (matches the Vuet()helper) to Laravel's:placeholderconvention on the way in, so call sites stay idiomatic. - All
escalated::commands.install.*keys converted from snake_case to camelCase inInstallCommand.phpand in every locale'scommands.phpfallback. The fallback now serves as a parity-with-central offline backup for the dev path. - Composer constraint bumped to
escalated-dev/locale: ^0.1.8so the new install keys (seedingPermissions,runningMigrations,runMigrationsConfirm,stepSeedfrom escalated-locale v0.1.8) are guaranteed present.
Scope (and what's still local)
Only the commands group is bridged today. Other groups — enums, notifications, emails, messages, validation — continue to load from resources/lang/ because their snake_case enum-value keys (e.g. enums.status.in_progress) don't yet have camelCase parity in central. Migrating those is a separate follow-up since enum values are persisted in user databases.
Backwards compatibility
- Composer install with v0.1.8 central: install command translations resolve via central (production path).
- Dev/offline scenarios without composer: bridge resolver returns null, install command falls back to the package's
resources/lang/PHP files (now camelCase, matching the call sites). - Host-app overrides at
lang/vendor/escalated/{locale}/commands.phpstill work via Laravel'sloadNamespaceOverridesmechanism (unchanged). - No public API changed — internal i18n plumbing only.
Test plan
- New
tests/Unit/CentralLocaleBridgeTest.php(3 tests, 23 assertions) locks in the bridge: populates$loaded['escalated']['commands'], resolved values match central JSON exactly acrossenandfr, and{placeholder}→:placeholderrewriting works. - Full suite: 609 passed.
Full Changelog: v1.2.3...v1.2.4