Added the ability to dynamically translate on the project website.

This commit is contained in:
2024-04-22 23:52:04 +05:00
parent a648ba3db9
commit 491249c8d8
55 changed files with 867 additions and 119 deletions

View File

@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="{{ $language->code }}">
<html lang="{{ $websiteTranslations->getLanguage()->attribute_lang }}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
@@ -14,7 +14,7 @@
<div class="wrapper">
<header class="header">
<div class="header_logo">
<a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $language) }}">
<a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $websiteTranslations->getLanguage()) }}">
@if($logo)
<img src="{{ $logo->url }}" alt="{{ $project->name }}">
@else
@@ -22,7 +22,7 @@
@endif
</a>
</div>
<button id="mobile-menu" type="button" aria-label="{{ __('site.Menu') }}">
<button id="mobile-menu" type="button" aria-label="{{ $websiteTranslations->translate('site.Menu') }}">
<svg class="open" width="45" height="45" data-slot="icon" fill="none" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"></path>
</svg>
@@ -30,13 +30,13 @@
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12"></path>
</svg>
</button>
<x-site.choose-language :language="$language" :languages="$project->languages" />
<x-site.choose-language :websiteTranslations="$websiteTranslations" :project="$project" />
</header>
<div class="main-container">
<nav id="menu">
<div class="menu__title">{{ __('site.Menu') }}</div>
<ul>
<li><a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $language) }}" @class(['active' => request()->route()->named(['home', 'language.home'])])>{{ __('site.About project') }}</a></li>
<li><a href="{{ \App\Enums\Site\ProjectSection::Home->url($project, $websiteTranslations->getLanguage()) }}" @class(['active' => request()->route()->named(['home', 'language.home', 'project.home', 'project.language.home'])])>{{ $websiteTranslations->translate('site.About project') }}</a></li>
</ul>
</nav>
<div class="section-container">
@@ -45,7 +45,7 @@
{{ $slot }}
</div>
<footer class="footer">
<a href="https://git.kor-elf.net/kor-elf/my-projects-website" target="_blank">{{ __('site.Powered by service') }}</a>
<a href="https://git.kor-elf.net/kor-elf/my-projects-website" target="_blank">{{ $websiteTranslations->translate('site.Powered by service') }}</a>
</footer>
</div>
</div>