feat: Add multi-language support (i18n)

Languages supported (8):
- English (en)
- 日本語 (ja)
- Deutsch (de)
- Français (fr)
- Español (es)
- 简体中文 (zh-CN)
- 繁體中文 (zh-TW)
- 한국어 (ko)

Changes:
- Add locale column to users table
- Add SetLocale middleware for automatic locale detection
- Add LocaleController for language switching
- Create language files with translations for all UI elements
- Add language selector to user profile page
- Update all Blade views to use translation strings
This commit is contained in:
2025-11-29 12:00:09 +09:00
parent ecfa21d56c
commit cdf0bf4bad
25 changed files with 1183 additions and 84 deletions

View File

@@ -13,13 +13,13 @@
<!-- Navigation Links -->
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
{{ __('Dashboard') }}
{{ __('messages.nav.dashboard') }}
</x-nav-link>
<x-nav-link href="/" :active="false">
<svg class="w-4 h-4 mr-1 inline" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25"></path>
</svg>
{{ __('Knowledge Base') }}
{{ __('messages.nav.knowledge_base') }}
</x-nav-link>
</div>
</div>
@@ -41,12 +41,12 @@
<x-slot name="content">
<x-dropdown-link :href="route('profile.edit')">
{{ __('Profile') }}
{{ __('messages.nav.profile') }}
</x-dropdown-link>
@if(Auth::user()->isAdmin())
<x-dropdown-link :href="route('admin.users.index')">
{{ __('ユーザー管理') }}
{{ __('messages.nav.user_management') }}
</x-dropdown-link>
@endif
@@ -57,7 +57,7 @@
<x-dropdown-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
{{ __('Log Out') }}
{{ __('messages.nav.logout') }}
</x-dropdown-link>
</form>
</x-slot>
@@ -80,10 +80,10 @@
<div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
<div class="pt-2 pb-3 space-y-1">
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')">
{{ __('Dashboard') }}
{{ __('messages.nav.dashboard') }}
</x-responsive-nav-link>
<x-responsive-nav-link href="/" :active="false">
{{ __('Knowledge Base') }}
{{ __('messages.nav.knowledge_base') }}
</x-responsive-nav-link>
</div>
@@ -96,12 +96,12 @@
<div class="mt-3 space-y-1">
<x-responsive-nav-link :href="route('profile.edit')">
{{ __('Profile') }}
{{ __('messages.nav.profile') }}
</x-responsive-nav-link>
@if(Auth::user()->isAdmin())
<x-responsive-nav-link :href="route('admin.users.index')">
{{ __('ユーザー管理') }}
{{ __('messages.nav.user_management') }}
</x-responsive-nav-link>
@endif
@@ -112,7 +112,7 @@
<x-responsive-nav-link :href="route('logout')"
onclick="event.preventDefault();
this.closest('form').submit();">
{{ __('Log Out') }}
{{ __('messages.nav.logout') }}
</x-responsive-nav-link>
</form>
</div>