mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-04-01 14:39:24 +02:00
Implementa infraestrutura de i18n com suporte inicial a English e Português (Brasil). Seletor de idioma em Settings > System > Preferences. - Instala react-i18next e i18next - Cria arquivos de tradução (en, pt-BR) para common, home, settings, layout - Traduz layout (sidebar, header, footer), home e settings/system - Persiste idioma via localStorage + KVStore (ui.language) - DiskAlertBanner integrado com i18n Closes #486
58 lines
2.2 KiB
TypeScript
58 lines
2.2 KiB
TypeScript
import {
|
|
IconArrowBigUpLines,
|
|
IconChartBar,
|
|
IconDashboard,
|
|
IconFolder,
|
|
IconGavel,
|
|
IconHeart,
|
|
IconMapRoute,
|
|
IconSettings,
|
|
IconTerminal2,
|
|
IconWand,
|
|
IconZoom
|
|
} from '@tabler/icons-react'
|
|
import { usePage } from '@inertiajs/react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import StyledSidebar from '~/components/StyledSidebar'
|
|
import { getServiceLink } from '~/lib/navigation'
|
|
import useServiceInstalledStatus from '~/hooks/useServiceInstalledStatus'
|
|
import { SERVICE_NAMES } from '../../constants/service_names'
|
|
|
|
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
|
|
const { t } = useTranslation('layout')
|
|
const { aiAssistantName } = usePage<{ aiAssistantName: string }>().props
|
|
const aiAssistantInstallStatus = useServiceInstalledStatus(SERVICE_NAMES.OLLAMA)
|
|
|
|
const navigation = [
|
|
...(aiAssistantInstallStatus.isInstalled ? [{ name: aiAssistantName, href: '/settings/models', icon: IconWand, current: false }] : []),
|
|
{ name: t('sidebar.apps'), href: '/settings/apps', icon: IconTerminal2, current: false },
|
|
{ name: t('sidebar.benchmark'), href: '/settings/benchmark', icon: IconChartBar, current: false },
|
|
{ name: t('sidebar.contentExplorer'), href: '/settings/zim/remote-explorer', icon: IconZoom, current: false },
|
|
{ name: t('sidebar.contentManager'), href: '/settings/zim', icon: IconFolder, current: false },
|
|
{ name: t('sidebar.mapsManager'), href: '/settings/maps', icon: IconMapRoute, current: false },
|
|
{
|
|
name: t('sidebar.serviceLogs'),
|
|
href: getServiceLink('9999'),
|
|
icon: IconDashboard,
|
|
current: false,
|
|
target: '_blank',
|
|
},
|
|
{
|
|
name: t('sidebar.checkUpdates'),
|
|
href: '/settings/update',
|
|
icon: IconArrowBigUpLines,
|
|
current: false,
|
|
},
|
|
{ name: t('sidebar.system'), href: '/settings/system', icon: IconSettings, current: false },
|
|
{ name: t('sidebar.support'), href: '/settings/support', icon: IconHeart, current: false },
|
|
{ name: t('sidebar.legal'), href: '/settings/legal', icon: IconGavel, current: false },
|
|
]
|
|
|
|
return (
|
|
<div className="min-h-screen flex flex-row bg-surface-secondary/90">
|
|
<StyledSidebar title={t('sidebar.settings')} items={navigation} />
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|