feat(frontend): Use i18n, type fixes
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
<template>
|
||||
<UModal v-model:open="open" title="Mitglied einladen" description="Laden Sie ein Mitglied zu Ihrer Organisation ein">
|
||||
<UButton
|
||||
v-if="canInviteMembers"
|
||||
icon="i-lucide-mail-plus"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
@click="open = true"
|
||||
>
|
||||
<UButton v-if="canInviteMembers" icon="i-lucide-mail-plus" variant="outline" size="sm" @click="open = true">
|
||||
Mitglied einladen
|
||||
</UButton>
|
||||
|
||||
@@ -60,8 +54,10 @@ const form = ref({
|
||||
role: ROLES.EMPLOYEE as LegalRole
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const availableRoles = computed(() => {
|
||||
return Object.values(ROLES).map(role => {
|
||||
return Object.values(ROLES).map((role) => {
|
||||
const roleInfo = getRoleInfo(role)
|
||||
return {
|
||||
label: roleInfo.name,
|
||||
@@ -76,25 +72,25 @@ const availableRoles = computed(() => {
|
||||
function getRoleInfo(role: LegalRole) {
|
||||
const roleInfo = {
|
||||
[ROLES.EMPLOYER]: {
|
||||
name: 'Arbeitgeber',
|
||||
name: t('roles.employer'),
|
||||
description: 'Kann Anträge genehmigen und Vereinbarungen unterzeichnen',
|
||||
color: 'blue',
|
||||
icon: 'i-lucide-briefcase'
|
||||
},
|
||||
[ROLES.EMPLOYEE]: {
|
||||
name: 'Arbeitnehmer',
|
||||
name: t('roles.employee'),
|
||||
description: 'Kann eigene Anträge einsehen und kommentieren',
|
||||
color: 'green',
|
||||
icon: 'i-lucide-user'
|
||||
},
|
||||
[ROLES.WORKS_COUNCIL_MEMBER]: {
|
||||
name: 'Betriebsrat',
|
||||
name: t('roles.worksCouncilMember'),
|
||||
description: 'Kann Anträge prüfen und Vereinbarungen unterzeichnen',
|
||||
color: 'purple',
|
||||
icon: 'i-lucide-users'
|
||||
},
|
||||
[ROLES.ADMIN]: {
|
||||
name: 'Administrator',
|
||||
name: t('roles.admin'),
|
||||
description: 'Vollzugriff auf Organisationsverwaltung',
|
||||
color: 'red',
|
||||
icon: 'i-lucide-settings'
|
||||
|
||||
@@ -37,7 +37,7 @@ const selectedOrganization = ref<{
|
||||
metadata?: any
|
||||
logo?: string | null
|
||||
} | null>(null)
|
||||
const activeMember = ref<{role: string} | null>(null)
|
||||
const activeMember = ref<{ role: string } | null>(null)
|
||||
|
||||
export function useAuth() {
|
||||
const url = useRequestURL()
|
||||
|
||||
9
legalconsenthub/i18n/locales/de.json
Normal file
9
legalconsenthub/i18n/locales/de.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"roles": {
|
||||
"admin": "Administrator",
|
||||
"employee": "Arbeitnehmer",
|
||||
"employer": "Arbeitgeber",
|
||||
"worksCouncilMember": "Betriebsratsmitglied",
|
||||
"worksCouncilChair": "Betriebsratsvorsitzender"
|
||||
}
|
||||
}
|
||||
9
legalconsenthub/i18n/locales/en.json
Normal file
9
legalconsenthub/i18n/locales/en.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"roles": {
|
||||
"admin": "Administrator",
|
||||
"employee": "Employee",
|
||||
"employer": "Employer",
|
||||
"worksCouncilMember": "Works Council Member",
|
||||
"worksCouncilChair": "Works Council Chair"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,11 @@
|
||||
export default defineNuxtConfig({
|
||||
sourcemap: true,
|
||||
modules: ['@nuxt/ui-pro', '@nuxt/eslint', '@pinia/nuxt'],
|
||||
modules: [
|
||||
'@nuxt/ui-pro',
|
||||
'@nuxt/eslint',
|
||||
'@pinia/nuxt',
|
||||
'@nuxtjs/i18n'
|
||||
],
|
||||
css: ['~/assets/css/main.css'],
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
@@ -19,6 +24,13 @@ export default defineNuxtConfig({
|
||||
pathPrefix: false
|
||||
}
|
||||
],
|
||||
i18n: {
|
||||
defaultLocale: 'de',
|
||||
locales: [
|
||||
{ code: 'en', name: 'English', file: 'en.json' },
|
||||
{ code: 'de', name: 'Deutsch', file: 'de.json' }
|
||||
]
|
||||
},
|
||||
// typescript: {
|
||||
// typeCheck: true
|
||||
// },
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/ui-pro": "3.1.1",
|
||||
"@nuxtjs/i18n": "10.0.3",
|
||||
"@pinia/nuxt": "0.10.1",
|
||||
"better-auth": "1.3.4",
|
||||
"better-sqlite3": "11.8.1",
|
||||
@@ -41,5 +42,6 @@
|
||||
"volta": {
|
||||
"node": "22.16.0",
|
||||
"pnpm": "10.11.0"
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad"
|
||||
}
|
||||
|
||||
1051
legalconsenthub/pnpm-lock.yaml
generated
1051
legalconsenthub/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ import {
|
||||
export const auth = betterAuth({
|
||||
database: new Database('./sqlite.db'),
|
||||
emailAndPassword: { enabled: true, autoSignIn: false },
|
||||
trustedOrigins: ["http://localhost:3001"],
|
||||
trustedOrigins: ['http://localhost:3001'],
|
||||
plugins: [
|
||||
jwt({
|
||||
jwt: {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
const { client } = useAuth()
|
||||
import type { useAuth } from '#imports'
|
||||
|
||||
export type ActiveOrganization = typeof client.$Infer.ActiveOrganization
|
||||
type Client = ReturnType<typeof useAuth>['client']
|
||||
export type ActiveOrganization = Client['$Infer']['ActiveOrganization']
|
||||
|
||||
Reference in New Issue
Block a user