feat: Add i18n with 7 languages (DE, EN, ES, FR, AR, RU, PL)

- Added vue-i18n with language switcher in header
- Flag icons with language codes dropdown
- RTL support for Arabic
- Translated all navigation, auth, and module labels
- Language preference saved to localStorage
This commit is contained in:
2026-03-13 04:51:12 +00:00
parent 3ca75cc4f2
commit aa0239abca
116 changed files with 69028 additions and 75 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'
import { useI18n } from 'vue-i18n'
import { useAuthStore } from '@/stores/auth'
defineProps<{
@@ -12,48 +13,49 @@ defineEmits<{
}>()
const route = useRoute()
const { t } = useI18n()
const authStore = useAuthStore()
const navigation = computed(() => {
const items = [
{ name: 'Dashboard', href: '/', icon: '📊' },
{ name: 'Aufträge', href: '/orders', icon: '📋' },
{ name: t('nav.dashboard'), href: '/', icon: '📊' },
{ name: t('nav.orders'), href: '/orders', icon: '📋' },
]
if (authStore.canManageUsers) {
items.push(
{ name: 'Mitarbeiter', href: '/users', icon: '👥' },
{ name: 'Schichtplanung', href: '/shifts', icon: '📅' }
{ name: t('nav.users'), href: '/users', icon: '👥' },
{ name: t('nav.shifts'), href: '/shifts', icon: '📅' }
)
}
items.push(
{ name: 'Verfügbarkeit', href: '/availability', icon: '🗓️' },
{ name: 'Stundenzettel', href: '/timesheets', icon: '⏱️' },
{ name: 'Qualifikationen', href: '/qualifications', icon: '🎓' },
{ name: 'Objekte', href: '/objects', icon: '🏢' },
{ name: 'Rundgänge', href: '/patrols', icon: '📍' },
{ name: 'Vorfälle', href: '/incidents', icon: '🚨' },
{ name: 'Dokumente', href: '/documents', icon: '📁' },
{ name: t('nav.availability'), href: '/availability', icon: '🗓️' },
{ name: t('nav.timesheets'), href: '/timesheets', icon: '⏱️' },
{ name: t('nav.qualifications'), href: '/qualifications', icon: '🎓' },
{ name: t('nav.objects'), href: '/objects', icon: '🏢' },
{ name: t('nav.patrols'), href: '/patrols', icon: '📍' },
{ name: t('nav.incidents'), href: '/incidents', icon: '🚨' },
{ name: t('nav.documents'), href: '/documents', icon: '📁' },
)
if (authStore.canManageUsers) {
items.push(
{ name: 'Fahrzeuge', href: '/vehicles', icon: '🚗' },
{ name: 'Kunden', href: '/customers', icon: '🤝' }
{ name: t('nav.vehicles'), href: '/vehicles', icon: '🚗' },
{ name: t('nav.customers'), href: '/customers', icon: '🤝' }
)
}
if (authStore.isChef) {
items.push(
{ name: 'Abrechnung', href: '/billing', icon: '💰' },
{ name: 'Module', href: '/modules', icon: '⚙️' }
{ name: t('nav.billing'), href: '/billing', icon: '💰' },
{ name: t('nav.modules'), href: '/modules', icon: '⚙️' }
)
}
items.push(
{ name: 'Einstellungen', href: '/settings', icon: '🔧' },
{ name: 'Hilfe', href: '/help', icon: '📚' }
{ name: t('nav.settings'), href: '/settings', icon: '🔧' },
{ name: t('nav.help'), href: '/help', icon: '📚' }
)
return items