<?php

use App\Modules\Settings\Localization\Services\TranslationService;

if (! function_exists('t')) {
    /**
     * DB-first translator: DB(current) → DB(default) → lang files → key.
     *
     * @param  array<string, scalar>  $replace
     */
    function t(string $key, array $replace = [], ?string $locale = null): string
    {
        return app(TranslationService::class)->translate($key, $replace, $locale);
    }
}
