Class: TranslationLoaderBridge
Full name: Azera\Localization\TranslationLoaderBridge
Adapts between Azera's and Clarity's translation loader contracts.
Both interfaces declare the same single method — load(string $domain, string $locale): array — so one class can satisfy them at once and bridge
in either direction:
- Clarity → Azera: wrap a
Clarity\Localization\FileTranslationLoader(orArray,Chain,RedisCaching) to use it withTranslator. - Azera → Clarity: wrap any
LoaderInterfaceso it can be handed to Clarity'sTranslationModule, which is what the framework'sLocalizationModuledoes to share one catalogue between$translator->get()and thetfilter.
Each lookup is delegated directly to the wrapped loader, preserving its behavior and state.
Public methods
__construct() ·
public function __construct(Azera\Localization\LoaderInterface|Clarity\Localization\TranslationLoaderInterface $inner): mixed
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$inner |
LoaderInterface|Clarity\Localization\TranslationLoaderInterface | - | Loader to delegate to. |
Return value
- Type:
mixed
load() ·
public function load(string $domain, string $locale): array
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$domain |
string | - | |
$locale |
string | - |
Return value
- Type:
array
inner() ·
public function inner(): Azera\Localization\LoaderInterface|Clarity\Localization\TranslationLoaderInterface
Return the wrapped loader.
Provides access to loader-specific behaviour, such as
RedisCachingLoader::invalidate(), through the bridge.
Return value
- Type: LoaderInterface|
Clarity\Localization\TranslationLoaderInterface