Files
breadcrumb-the-shire/modules/addressbook/module.php
fs 1f0b1caf54 feat: module-owned i18n with merge-at-boot translation loading
Each module can now ship its own i18n/ directory with translation files
(default_de.json, default_en.json). At boot time, ModuleI18nLoader
preloads core translations then merges module translations on top via
Reflection into I18n::$strings — the t() helper stays unchanged.

- Add i18nPath property to ModuleManifest
- Add ModuleI18nLoader with Reflection-based preload
- Extract 59 module-exclusive keys from core i18n into module files
  (notifications: 8, bookmarks: 41, addressbook: 10)
- Expand TranslationKeysTest to scan modules/ and validate against
  merged core + module translations
- Add ModuleI18nContractTest for per-module de/en parity and completeness

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:08:34 +01:00

99 lines
2.9 KiB
PHP

<?php
/**
* Address Book module manifest.
*
* Contributes routes, sidebar slots, search entry, user-edit aside action,
* layout context data, and session lifecycle.
*/
return [
'id' => 'addressbook',
'version' => '1.0.0',
'enabled_by_default' => false,
'load_order' => 10,
'requires' => [],
'routes' => [
// Keep canonical route stable without forcing a /index target to avoid Router redirect loops.
['path' => 'address-book', 'target' => 'address-book'],
['path' => 'address-book/data', 'target' => 'address-book/data'],
// Legacy aliases for existing bookmarks/links.
['path' => 'addressbook', 'target' => 'address-book'],
['path' => 'adressbook', 'target' => 'address-book'],
],
'public_paths' => [],
'container_registrars' => [
\MintyPHP\Module\AddressBook\AddressBookContainerRegistrar::class,
],
'ui_slots' => [
'aside.tab_panel' => [
[
'key' => 'people',
'label' => 'Address book',
'icon' => 'bi-people',
'href' => 'address-book',
'permission' => 'addressbook.view',
'panel_template' => 'templates/aside-people-panel.phtml',
'details_storage' => 'aside-people-tenant',
'details_open_active' => true,
'order' => 110,
],
],
'search.resource_item' => [
[
'key' => 'address-book',
'label' => 'Address book',
'base_url' => 'address-book',
'permission' => 'addressbook.view',
'order' => 110,
],
],
'user.edit.aside_action' => [
[
'key' => 'address-book-view-user',
'type' => 'link',
'label' => 'View in address book',
'href' => 'address-book/view/{user_uuid}',
'permission' => 'addressbook.view',
'order' => 110,
],
],
],
'authorization_policies' => [
\MintyPHP\Module\AddressBook\AddressBookAuthorizationPolicy::class,
],
'search_resources' => [
\MintyPHP\Module\AddressBook\Providers\AddressBookSearchProvider::class,
],
'asset_groups' => [
'address-book' => [
'modules/addressbook/css/pages/address-book-view.css',
],
],
'scheduler_jobs' => [],
'layout_context_providers' => [
\MintyPHP\Module\AddressBook\Providers\AddressBookLayoutProvider::class,
],
'session_providers' => [
\MintyPHP\Module\AddressBook\Providers\AddressBookSessionProvider::class,
],
'permissions' => [
[
'key' => 'address_book.view',
'description' => 'Can view address book',
'active' => true,
'is_system' => true,
],
],
'migrations_path' => 'db/updates',
'i18n_path' => 'i18n',
];