feat(frontend): Use i18n, type fixes
This commit is contained in:
@@ -1,12 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<UModal v-model:open="open" title="Mitglied einladen" description="Laden Sie ein Mitglied zu Ihrer Organisation ein">
|
<UModal v-model:open="open" title="Mitglied einladen" description="Laden Sie ein Mitglied zu Ihrer Organisation ein">
|
||||||
<UButton
|
<UButton v-if="canInviteMembers" icon="i-lucide-mail-plus" variant="outline" size="sm" @click="open = true">
|
||||||
v-if="canInviteMembers"
|
|
||||||
icon="i-lucide-mail-plus"
|
|
||||||
variant="outline"
|
|
||||||
size="sm"
|
|
||||||
@click="open = true"
|
|
||||||
>
|
|
||||||
Mitglied einladen
|
Mitglied einladen
|
||||||
</UButton>
|
</UButton>
|
||||||
|
|
||||||
@@ -60,8 +54,10 @@ const form = ref({
|
|||||||
role: ROLES.EMPLOYEE as LegalRole
|
role: ROLES.EMPLOYEE as LegalRole
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
const availableRoles = computed(() => {
|
const availableRoles = computed(() => {
|
||||||
return Object.values(ROLES).map(role => {
|
return Object.values(ROLES).map((role) => {
|
||||||
const roleInfo = getRoleInfo(role)
|
const roleInfo = getRoleInfo(role)
|
||||||
return {
|
return {
|
||||||
label: roleInfo.name,
|
label: roleInfo.name,
|
||||||
@@ -76,25 +72,25 @@ const availableRoles = computed(() => {
|
|||||||
function getRoleInfo(role: LegalRole) {
|
function getRoleInfo(role: LegalRole) {
|
||||||
const roleInfo = {
|
const roleInfo = {
|
||||||
[ROLES.EMPLOYER]: {
|
[ROLES.EMPLOYER]: {
|
||||||
name: 'Arbeitgeber',
|
name: t('roles.employer'),
|
||||||
description: 'Kann Anträge genehmigen und Vereinbarungen unterzeichnen',
|
description: 'Kann Anträge genehmigen und Vereinbarungen unterzeichnen',
|
||||||
color: 'blue',
|
color: 'blue',
|
||||||
icon: 'i-lucide-briefcase'
|
icon: 'i-lucide-briefcase'
|
||||||
},
|
},
|
||||||
[ROLES.EMPLOYEE]: {
|
[ROLES.EMPLOYEE]: {
|
||||||
name: 'Arbeitnehmer',
|
name: t('roles.employee'),
|
||||||
description: 'Kann eigene Anträge einsehen und kommentieren',
|
description: 'Kann eigene Anträge einsehen und kommentieren',
|
||||||
color: 'green',
|
color: 'green',
|
||||||
icon: 'i-lucide-user'
|
icon: 'i-lucide-user'
|
||||||
},
|
},
|
||||||
[ROLES.WORKS_COUNCIL_MEMBER]: {
|
[ROLES.WORKS_COUNCIL_MEMBER]: {
|
||||||
name: 'Betriebsrat',
|
name: t('roles.worksCouncilMember'),
|
||||||
description: 'Kann Anträge prüfen und Vereinbarungen unterzeichnen',
|
description: 'Kann Anträge prüfen und Vereinbarungen unterzeichnen',
|
||||||
color: 'purple',
|
color: 'purple',
|
||||||
icon: 'i-lucide-users'
|
icon: 'i-lucide-users'
|
||||||
},
|
},
|
||||||
[ROLES.ADMIN]: {
|
[ROLES.ADMIN]: {
|
||||||
name: 'Administrator',
|
name: t('roles.admin'),
|
||||||
description: 'Vollzugriff auf Organisationsverwaltung',
|
description: 'Vollzugriff auf Organisationsverwaltung',
|
||||||
color: 'red',
|
color: 'red',
|
||||||
icon: 'i-lucide-settings'
|
icon: 'i-lucide-settings'
|
||||||
|
|||||||
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({
|
export default defineNuxtConfig({
|
||||||
sourcemap: true,
|
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'],
|
css: ['~/assets/css/main.css'],
|
||||||
runtimeConfig: {
|
runtimeConfig: {
|
||||||
public: {
|
public: {
|
||||||
@@ -19,6 +24,13 @@ export default defineNuxtConfig({
|
|||||||
pathPrefix: false
|
pathPrefix: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
i18n: {
|
||||||
|
defaultLocale: 'de',
|
||||||
|
locales: [
|
||||||
|
{ code: 'en', name: 'English', file: 'en.json' },
|
||||||
|
{ code: 'de', name: 'Deutsch', file: 'de.json' }
|
||||||
|
]
|
||||||
|
},
|
||||||
// typescript: {
|
// typescript: {
|
||||||
// typeCheck: true
|
// typeCheck: true
|
||||||
// },
|
// },
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/ui-pro": "3.1.1",
|
"@nuxt/ui-pro": "3.1.1",
|
||||||
|
"@nuxtjs/i18n": "10.0.3",
|
||||||
"@pinia/nuxt": "0.10.1",
|
"@pinia/nuxt": "0.10.1",
|
||||||
"better-auth": "1.3.4",
|
"better-auth": "1.3.4",
|
||||||
"better-sqlite3": "11.8.1",
|
"better-sqlite3": "11.8.1",
|
||||||
@@ -41,5 +42,6 @@
|
|||||||
"volta": {
|
"volta": {
|
||||||
"node": "22.16.0",
|
"node": "22.16.0",
|
||||||
"pnpm": "10.11.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({
|
export const auth = betterAuth({
|
||||||
database: new Database('./sqlite.db'),
|
database: new Database('./sqlite.db'),
|
||||||
emailAndPassword: { enabled: true, autoSignIn: false },
|
emailAndPassword: { enabled: true, autoSignIn: false },
|
||||||
trustedOrigins: ["http://localhost:3001"],
|
trustedOrigins: ['http://localhost:3001'],
|
||||||
plugins: [
|
plugins: [
|
||||||
jwt({
|
jwt({
|
||||||
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