Add Site Translation Management: Created SiteTranslation resource with pages for listing, creating, and editing translations. Implemented localization support for translation keys and values, enhancing the admin panel's usability for managing site translations. Introduced a new migration for the site_translations table and updated helper functions for translation retrieval.

This commit is contained in:
Ümit Tunç
2025-12-30 23:41:32 +03:00
parent f381caaa39
commit 064ec327ba
13 changed files with 376 additions and 252 deletions
+17
View File
@@ -2,6 +2,7 @@
use App\Models\Language;
use App\Models\Translation;
use App\Models\SiteTranslation;
use Illuminate\Support\Collection;
if (!function_exists('current_language')) {
@@ -279,3 +280,19 @@ if (!function_exists('get_translation_value')) {
}
}
if (!function_exists('t')) {
/**
* Get site translation for a given key.
*
* @param string $key
* @return string
*/
function t(string $key): string
{
if (empty($key)) {
return '';
}
return SiteTranslation::getTranslation($key);
}
}