mirror of
https://github.com/johndoe6345789/workforce-pay-bill-p.git
synced 2026-04-24 13:24:57 +00:00
Generated by Spark: Add translations to entity selector dropdown (Main Agency, North Division, South Division)
This commit is contained in:
@@ -32,6 +32,19 @@ export function Sidebar({ currentView, setCurrentView, currentEntity, setCurrent
|
||||
const [expandedGroups, setExpandedGroups] = useState<Set<string>>(new Set(['core']))
|
||||
const { user, logout } = useAuth()
|
||||
|
||||
const getEntityTranslation = (entity: string) => {
|
||||
switch (entity) {
|
||||
case 'Main Agency':
|
||||
return t('entities.mainAgency')
|
||||
case 'North Division':
|
||||
return t('entities.northDivision')
|
||||
case 'South Division':
|
||||
return t('entities.southDivision')
|
||||
default:
|
||||
return entity
|
||||
}
|
||||
}
|
||||
|
||||
const toggleGroup = (groupId: string) => {
|
||||
setExpandedGroups(prev => {
|
||||
const next = new Set(prev)
|
||||
@@ -66,13 +79,13 @@ export function Sidebar({ currentView, setCurrentView, currentEntity, setCurrent
|
||||
<SelectTrigger className="w-full" aria-label={t('sidebar.selectEntity')}>
|
||||
<div className="flex items-center gap-2">
|
||||
<Buildings size={16} weight="fill" className="text-primary" aria-hidden="true" />
|
||||
<SelectValue />
|
||||
<span>{getEntityTranslation(currentEntity)}</span>
|
||||
</div>
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="Main Agency">Main Agency</SelectItem>
|
||||
<SelectItem value="North Division">North Division</SelectItem>
|
||||
<SelectItem value="South Division">South Division</SelectItem>
|
||||
<SelectItem value="Main Agency">{t('entities.mainAgency')}</SelectItem>
|
||||
<SelectItem value="North Division">{t('entities.northDivision')}</SelectItem>
|
||||
<SelectItem value="South Division">{t('entities.southDivision')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
"parallelApprovals": "Parallel Approvals",
|
||||
"translations": "Translations"
|
||||
},
|
||||
"sidebar": {
|
||||
"backOfficePlatform": "Back Office Platform",
|
||||
"selectEntity": "Select entity",
|
||||
"componentLibrary": "Component Library",
|
||||
"businessLogicHooks": "Business Logic Hooks",
|
||||
"logOut": "Log Out"
|
||||
},
|
||||
"entities": {
|
||||
"mainAgency": "Main Agency",
|
||||
"northDivision": "North Division",
|
||||
"southDivision": "South Division"
|
||||
},
|
||||
"common": {
|
||||
"search": "Search",
|
||||
"filter": "Filter",
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
"parallelApprovals": "Aprobaciones Paralelas",
|
||||
"translations": "Traducciones"
|
||||
},
|
||||
"sidebar": {
|
||||
"backOfficePlatform": "Plataforma de Back Office",
|
||||
"selectEntity": "Seleccionar entidad",
|
||||
"componentLibrary": "Biblioteca de Componentes",
|
||||
"businessLogicHooks": "Hooks de Lógica de Negocio",
|
||||
"logOut": "Cerrar Sesión"
|
||||
},
|
||||
"entities": {
|
||||
"mainAgency": "Agencia Principal",
|
||||
"northDivision": "División Norte",
|
||||
"southDivision": "División Sur"
|
||||
},
|
||||
"common": {
|
||||
"search": "Buscar",
|
||||
"filter": "Filtrar",
|
||||
|
||||
@@ -42,6 +42,18 @@
|
||||
"parallelApprovals": "Approbations Parallèles",
|
||||
"translations": "Traductions"
|
||||
},
|
||||
"sidebar": {
|
||||
"backOfficePlatform": "Plateforme de Back Office",
|
||||
"selectEntity": "Sélectionner l'entité",
|
||||
"componentLibrary": "Bibliothèque de Composants",
|
||||
"businessLogicHooks": "Hooks de Logique Métier",
|
||||
"logOut": "Se Déconnecter"
|
||||
},
|
||||
"entities": {
|
||||
"mainAgency": "Agence Principale",
|
||||
"northDivision": "Division Nord",
|
||||
"southDivision": "Division Sud"
|
||||
},
|
||||
"common": {
|
||||
"search": "Rechercher",
|
||||
"filter": "Filtrer",
|
||||
|
||||
Reference in New Issue
Block a user