feat: add new translation files for app development, corporate, home menu, and miscellaneous site content, enhancing multilingual support and user experience
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Models\SiteTranslation;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
@@ -107,16 +106,7 @@ class AppDevelopmentPageSeeder extends Seeder
|
||||
}
|
||||
|
||||
foreach ($this->englishTranslations as $key => $english) {
|
||||
SiteTranslation::updateOrCreate(
|
||||
['hash' => md5($key)],
|
||||
[
|
||||
'key' => $key,
|
||||
'translations' => [
|
||||
'tr' => $key,
|
||||
'en' => $english,
|
||||
],
|
||||
]
|
||||
);
|
||||
// Translations are managed by SiteTranslationsSeeder (app_development_translations.php).
|
||||
}
|
||||
|
||||
Page::updateOrCreate(
|
||||
|
||||
@@ -26,6 +26,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Foundation',
|
||||
'content' => 'Trunçgil Technology was founded in Gaziantep in 2014 by Ümit Tunç.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Основание',
|
||||
'content' => 'Компания Trunçgil Technology была основана в 2014 году Умитом Тунчем в Газiantепе.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Gründung',
|
||||
'content' => 'Trunçgil Technology wurde 2014 von Ümit Tunç in Gaziantep gegründet.',
|
||||
@@ -45,6 +49,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Academic Infrastructure',
|
||||
'content' => 'Established a solution partnership with E-SER Academic Publishing to develop publishing infrastructure for indexed journals.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Academic Infrastructure',
|
||||
'content' => 'Established a solution partnership with E-SER Academic Publishing to develop publishing infrastructure for indexed journals.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Akademische Infrastruktur',
|
||||
'content' => 'In Partnerschaft mit E-SER Academic Publishing wurde die Infrastruktur für indexierte Fachzeitschriften aufgebaut.',
|
||||
@@ -64,6 +72,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'First Export',
|
||||
'content' => 'Completed its first export and began operations in e-commerce in New Jersey, United States.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'First Export',
|
||||
'content' => 'Completed its first export and began operations in e-commerce in New Jersey, United States.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Erster Export',
|
||||
'content' => 'Mit dem ersten Export wurden E-Commerce-Aktivitäten im US-Bundesstaat New Jersey aufgenommen.',
|
||||
@@ -83,6 +95,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'TRDoktor.com',
|
||||
'content' => 'Through its partnership with TRDoktor.com, contributed to a digital health platform serving more than one million monthly users across Turkey.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'TRDoktor.com',
|
||||
'content' => 'Through its partnership with TRDoktor.com, contributed to a digital health platform serving more than one million monthly users across Turkey.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'TRDoktor.com',
|
||||
'content' => 'Durch die Partnerschaft mit TRDoktor.com wurde eine digitale Gesundheitsplattform mit über einer Million monatlicher Nutzer in der Türkei unterstützt.',
|
||||
@@ -102,6 +118,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Education Technology',
|
||||
'content' => 'Developed corporate education applications for the learning infrastructure of American Culture College.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Education Technology',
|
||||
'content' => 'Developed corporate education applications for the learning infrastructure of American Culture College.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Bildungstechnologie',
|
||||
'content' => 'Für die Bildungsinfrastruktur des American Culture College wurden unternehmerische Lernanwendungen entwickelt.',
|
||||
@@ -121,6 +141,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Gaziantep Technopark',
|
||||
'content' => 'Opened a branch at Gaziantep Technopark to continue R&D and software development operations.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Gaziantep Technopark',
|
||||
'content' => 'Opened a branch at Gaziantep Technopark to continue R&D and software development operations.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Gaziantep Technopark',
|
||||
'content' => 'Eröffnung einer Niederlassung im Gaziantep Technopark zur Fortführung von F&E- und Softwareentwicklungsaktivitäten.',
|
||||
@@ -140,6 +164,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'HERE Maps Hackathon',
|
||||
'content' => 'Won first place in the nationwide hackathon organized in Turkey by Germany-based HERE Maps, affirming our expertise in location technologies.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'HERE Maps Hackathon',
|
||||
'content' => 'Won first place in the nationwide hackathon organized in Turkey by Germany-based HERE Maps, affirming our expertise in location technologies.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'HERE Maps Hackathon',
|
||||
'content' => 'Erster Platz beim landesweiten Hackathon von HERE Maps (Deutschland) in der Türkei — ein Beleg unserer Kompetenz in Geolokationstechnologien.',
|
||||
@@ -159,6 +187,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Otto Planner 2020',
|
||||
'content' => 'Developed the Otto Planner 2020 application for P-D Refractories GmbH in Bochum, Germany, and initiated the company\'s digital transformation.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Otto Planner 2020',
|
||||
'content' => 'Developed the Otto Planner 2020 application for P-D Refractories GmbH in Bochum, Germany, and initiated the company\'s digital transformation.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Otto Planner 2020',
|
||||
'content' => 'Entwicklung der Anwendung Otto Planner 2020 für P-D Refractories GmbH in Bochum und Einleitung der digitalen Transformation des Unternehmens.',
|
||||
@@ -178,6 +210,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'IoT Dashboard',
|
||||
'content' => 'In partnership with Olimpiyat Otomasyon, an IoT Dashboard application was developed for remote management and control of industrial PLCs and related devices, communicating via RS232 and WebSocket standards. This Internet of Things (IoT) solution was built on the Trunçgil Smart platform.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'IoT Dashboard',
|
||||
'content' => 'In partnership with Olimpiyat Otomasyon, an IoT Dashboard application was developed for remote management and control of industrial PLCs and related devices, communicating via RS232 and WebSocket standards. This Internet of Things (IoT) solution was built on the Trunçgil Smart platform.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'IoT Dashboard',
|
||||
'content' => 'In Partnerschaft mit Olimpiyat Otomasyon wurde eine IoT-Dashboard-Anwendung zur Fernverwaltung und -steuerung industrieller SPS und vergleichbarer Geräte entwickelt — mit Kommunikation über RS232- und WebSocket-Standards. Die IoT-Lösung basiert auf der Trunçgil Smart-Infrastruktur.',
|
||||
@@ -197,6 +233,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'PDLC Smart Glass',
|
||||
'content' => 'Built e-commerce infrastructure and digital sales channels for PDLC Smart Glass products for HaHa Group BV, based in the Netherlands.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'PDLC Smart Glass',
|
||||
'content' => 'Built e-commerce infrastructure and digital sales channels for PDLC Smart Glass products for HaHa Group BV, based in the Netherlands.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'PDLC Smart Glass',
|
||||
'content' => 'Aufbau der E-Commerce-Infrastruktur und digitaler Vertriebskanäle für PDLC Smart Glass-Produkte der HaHa Group BV (Niederlande).',
|
||||
@@ -216,6 +256,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Dijimind Academy',
|
||||
'content' => 'Together with Dijimind Academy, a system was developed to provide AI-powered exam preparation coaching for LGS and YKS students, centered on Bloom\'s taxonomy. Development continues to accelerate to this day, serving more than 100 institutions and over 30,000 students across Turkey.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Dijimind Academy',
|
||||
'content' => 'Together with Dijimind Academy, a system was developed to provide AI-powered exam preparation coaching for LGS and YKS students, centered on Bloom\'s taxonomy. Development continues to accelerate to this day, serving more than 100 institutions and over 30,000 students across Turkey.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Dijimind Akademie',
|
||||
'content' => 'Gemeinsam mit Dijimind Akademi wurde ein System entwickelt, das LGS- und YKS-Schülern eine KI-gestützte Prüfungsvorbereitung bietet — mit Blooms Taxonomie im Mittelpunkt. Die Entwicklung schreitet bis heute beschleunigt voran und bedient über 100 Institutionen und mehr als 30.000 Schüler in der gesamten Türkei.',
|
||||
@@ -235,6 +279,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Rhapsode Academic',
|
||||
'content' => 'In the third quarter of 2022, work began with UK-based academic publisher Rhapsode Academic on manuscript system infrastructure. Integrations with Scopus, Crossref, DOI, Open Access, iThenticate, and Creative Commons form the core components of this platform. Development continues to this day with ongoing updates.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Rhapsode Academic',
|
||||
'content' => 'In the third quarter of 2022, work began with UK-based academic publisher Rhapsode Academic on manuscript system infrastructure. Integrations with Scopus, Crossref, DOI, Open Access, iThenticate, and Creative Commons form the core components of this platform. Development continues to this day with ongoing updates.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Rhapsode Academic',
|
||||
'content' => 'Im dritten Quartal 2022 begannen die Arbeiten mit dem in Großbritannien ansässigen akademischen Verlag Rhapsode Academic an der Manuskript-Systeminfrastruktur. Integrationen mit Scopus, Crossref, DOI, Open Access, iThenticate und Creative Commons bilden die Kernkomponenten dieser Plattform. Die Entwicklung wird bis heute mit fortlaufenden Aktualisierungen fortgesetzt.',
|
||||
@@ -254,6 +302,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Stellar Construction',
|
||||
'content' => 'A QA, QC, and QMS (quality management system) application was developed for Stellar Construction, a Moscow-based industrial construction company and partner of Ant Yapı. The project is successfully deployed across multiple construction sites throughout Russia.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Stellar Construction',
|
||||
'content' => 'A QA, QC, and QMS (quality management system) application was developed for Stellar Construction, a Moscow-based industrial construction company and partner of Ant Yapı. The project is successfully deployed across multiple construction sites throughout Russia.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Stellar Construction',
|
||||
'content' => 'Für Stellar Construction, ein in Moskau ansässiges Industriebauunternehmen und Partner von Ant Yapı, wurde eine QA-, QC- und QMS-Anwendung (Qualitätsmanagementsystem) entwickelt. Das Projekt wird erfolgreich auf zahlreichen Baustellen in Russland eingesetzt.',
|
||||
@@ -273,6 +325,10 @@ class CompanyHistoryItemSeeder extends Seeder
|
||||
'title' => 'Trunçgil Parabol Accounting',
|
||||
'content' => 'In 2024, through a white label license agreement with Istanbul-based Uzman Şirketim, development work on the Trunçgil Parabol Accounting application and NES E-Invoice systems was completed and launched.',
|
||||
],
|
||||
'ru' => [
|
||||
'title' => 'Trunçgil Parabol Accounting',
|
||||
'content' => 'In 2024, through a white label license agreement with Istanbul-based Uzman Şirketim, development work on the Trunçgil Parabol Accounting application and NES E-Invoice systems was completed and launched.',
|
||||
],
|
||||
'de' => [
|
||||
'title' => 'Trunçgil Parabol Buchhaltung',
|
||||
'content' => 'Im Jahr 2024 wurde im Rahmen einer White-Label-Lizenzvereinbarung mit dem in Istanbul ansässigen Uzman Şirketim die Entwicklung der Trunçgil Parabol Buchhaltungsanwendung und der NES E-Rechnungssysteme abgeschlossen und veröffentlicht.',
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders\Concerns;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Models\SiteTranslation;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
trait SeedsSiteTranslations
|
||||
{
|
||||
/**
|
||||
* @param array<string, array<string, string>> $siteData
|
||||
*/
|
||||
protected function seedSiteTranslations(array $siteData): void
|
||||
{
|
||||
foreach ($siteData as $key => $translations) {
|
||||
$record = SiteTranslation::firstOrNew(['hash' => md5($key)]);
|
||||
$existing = $record->translations ?? [];
|
||||
|
||||
$merged = array_merge($existing, [
|
||||
'tr' => $translations['tr'] ?? $existing['tr'] ?? $key,
|
||||
], array_filter(
|
||||
$translations,
|
||||
fn ($value, $lang) => $value !== '' && $lang !== 'tr',
|
||||
ARRAY_FILTER_USE_BOTH
|
||||
));
|
||||
|
||||
SiteTranslation::updateOrCreate(
|
||||
['hash' => md5($key)],
|
||||
[
|
||||
'key' => $key,
|
||||
'translations' => $merged,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string|int, array<string, array<string, string>>> $pagesData
|
||||
*/
|
||||
protected function seedPageTranslations(array $pagesData): void
|
||||
{
|
||||
foreach ($pagesData as $pageKey => $fields) {
|
||||
$page = is_numeric($pageKey)
|
||||
? Page::query()->whereKey((int) $pageKey)->first()
|
||||
: Page::query()->where('slug', (string) $pageKey)->first();
|
||||
|
||||
if (! $page) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($fields as $fieldName => $translations) {
|
||||
foreach ($translations as $languageCode => $value) {
|
||||
if ($value === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$page->setTranslation($fieldName, $languageCode, $value, 'published', 1);
|
||||
}
|
||||
|
||||
if (! isset($translations['tr'])) {
|
||||
$page->setTranslation($fieldName, 'tr', $page->{$fieldName}, 'published', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function flushTranslationCache(): void
|
||||
{
|
||||
Cache::flush();
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ class DatabaseSeeder extends Seeder
|
||||
LanguageSeeder::class,
|
||||
SettingSeeder::class,
|
||||
PageSeeder::class,
|
||||
SiteTranslationsSeeder::class,
|
||||
CompanyHistoryItemSeeder::class,
|
||||
]);
|
||||
|
||||
|
||||
@@ -2,58 +2,12 @@
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Models\SiteTranslation;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class HomeMenuTranslationsSeeder extends Seeder
|
||||
{
|
||||
public function run(): void
|
||||
{
|
||||
$data = require database_path('data/home_menu_translations.php');
|
||||
|
||||
foreach ($data['site'] as $key => $translations) {
|
||||
$record = SiteTranslation::firstOrNew(['hash' => md5($key)]);
|
||||
$existing = $record->translations ?? [];
|
||||
|
||||
$merged = array_merge($existing, [
|
||||
'tr' => $key,
|
||||
], array_filter($translations));
|
||||
|
||||
SiteTranslation::updateOrCreate(
|
||||
['hash' => md5($key)],
|
||||
[
|
||||
'key' => $key,
|
||||
'translations' => $merged,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($data['pages'] as $pageId => $fields) {
|
||||
$page = Page::query()->whereKey($pageId)->first();
|
||||
|
||||
if (! $page) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($fields as $fieldName => $translations) {
|
||||
foreach ($translations as $languageCode => $value) {
|
||||
if ($value === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$page->setTranslation($fieldName, $languageCode, $value, 'published', 1);
|
||||
}
|
||||
|
||||
if (! isset($translations['tr'])) {
|
||||
$page->setTranslation($fieldName, 'tr', $page->{$fieldName}, 'published', 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Cache::flush();
|
||||
|
||||
$this->command?->info('Home page and menu translations applied successfully.');
|
||||
$this->call(SiteTranslationsSeeder::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class LanguageSeeder extends Seeder
|
||||
'native_name' => 'Deutsch',
|
||||
'flag' => '🇩🇪',
|
||||
'direction' => 'ltr',
|
||||
'is_active' => false,
|
||||
'is_active' => true,
|
||||
'is_default' => false,
|
||||
'sort_order' => 3,
|
||||
],
|
||||
@@ -55,14 +55,24 @@ class LanguageSeeder extends Seeder
|
||||
'sort_order' => 4,
|
||||
],
|
||||
[
|
||||
'code' => 'ar',
|
||||
'name' => 'Arabic',
|
||||
'native_name' => 'العربية',
|
||||
'flag' => '🇸🇦',
|
||||
'direction' => 'rtl',
|
||||
'is_active' => false,
|
||||
'code' => 'se',
|
||||
'name' => 'Swedish',
|
||||
'native_name' => 'Svenska',
|
||||
'flag' => '🇸🇪',
|
||||
'direction' => 'ltr',
|
||||
'is_active' => true,
|
||||
'is_default' => false,
|
||||
'sort_order' => 5,
|
||||
'sort_order' => 6,
|
||||
],
|
||||
[
|
||||
'code' => 'ru',
|
||||
'name' => 'Russian',
|
||||
'native_name' => 'Русский',
|
||||
'flag' => '🇷🇺',
|
||||
'direction' => 'ltr',
|
||||
'is_active' => true,
|
||||
'is_default' => false,
|
||||
'sort_order' => 7,
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Database\Seeders\Concerns\SeedsSiteTranslations;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class SiteTranslationsSeeder extends Seeder
|
||||
{
|
||||
use SeedsSiteTranslations;
|
||||
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
protected array $dataFiles = [
|
||||
'home_menu_translations.php',
|
||||
'home_menu_locale_patch.php',
|
||||
'neler_yapariz_translations.php',
|
||||
'app_development_translations.php',
|
||||
'corporate_translations.php',
|
||||
'misc_site_translations.php',
|
||||
];
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
foreach ($this->dataFiles as $file) {
|
||||
$path = database_path('data/' . $file);
|
||||
|
||||
if (! is_file($path)) {
|
||||
$this->command?->warn("Translation data file not found: {$file}");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var array{site?: array<string, array<string, string>>, pages?: array<string|int, array<string, array<string, string>>>} $data */
|
||||
$data = require $path;
|
||||
|
||||
if (! empty($data['site'])) {
|
||||
$this->seedSiteTranslations($data['site']);
|
||||
}
|
||||
|
||||
if (! empty($data['pages'])) {
|
||||
$this->seedPageTranslations($data['pages']);
|
||||
}
|
||||
|
||||
$this->command?->info("Applied translations from {$file}");
|
||||
}
|
||||
|
||||
$this->flushTranslationCache();
|
||||
|
||||
$this->command?->info('All site translations applied successfully.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user