File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ import DeviceActionButton from '../widgets/DeviceActionButton/DeviceActionButton
88import ErrorMessage from '../widgets/ErrorMessage.tsx' ;
99import { useVariantName } from '../hooks/useVariant.ts' ;
1010import type { PortierDevice } from "../portier-types" ;
11+ import { useLocale } from "../hooks/useLocale.ts" ;
1112
1213const Devices = ( {
1314 deviceGroup,
1415 deviceActionMapper,
1516 } : { deviceGroup : string , deviceActionMapper : ( d : PortierDevice ) => string [ ] } ) => {
1617 const { t} = useTranslation ( ) ;
18+ const [ locale ] = useLocale ( ) ;
1719
1820 const {
1921 data : devices ,
@@ -43,7 +45,7 @@ const Devices = ({
4345 < Card border = "secondary" >
4446 < Card . Header
4547 className = { 'text-start' + ( variantName === "initlab" ? ' bg-primary text-light' : '' ) } >
46- { device . name }
48+ { locale ? ( device . localized_names [ locale ] ?? device . name ) : device . name }
4749 </ Card . Header >
4850 < Card . Body
4951 className = "d-flex flex-column flex-lg-row justify-content-center align-items-center gap-4" >
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export type PortierDevice = {
66 number : number ,
77 public : boolean ,
88 supported_actions : string [ ] ,
9+ localized_names : { [ lang : string ] : string } ,
910 statuses : { [ status : string ] : string | boolean } ,
1011} ;
1112
You can’t perform that action at this time.
0 commit comments