mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Fix: connections filter i18n
This commit is contained in:
parent
a633d9e077
commit
0c487ab496
@ -1,6 +1,7 @@
|
||||
import React from 'react'
|
||||
import React, { useMemo } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import { BaseComponentProps } from '@models'
|
||||
import { useI18n } from '@stores'
|
||||
import './style.scss'
|
||||
|
||||
interface DevicesProps extends BaseComponentProps {
|
||||
@ -10,6 +11,9 @@ interface DevicesProps extends BaseComponentProps {
|
||||
}
|
||||
|
||||
export function Devices (props: DevicesProps) {
|
||||
const { translation } = useI18n()
|
||||
const t = useMemo(() => translation('Connections').t, [translation])
|
||||
|
||||
const { className, style } = props
|
||||
const classname = classnames('connections-devices', className)
|
||||
function handleSelected (label: string) {
|
||||
@ -18,7 +22,9 @@ export function Devices (props: DevicesProps) {
|
||||
|
||||
return (
|
||||
<div className={classname} style={style}>
|
||||
<div className={classnames('connections-devices-item', { selected: props.selected === '' })} onClick={() => handleSelected('')}>全部</div>
|
||||
<div className={classnames('connections-devices-item', { selected: props.selected === '' })} onClick={() => handleSelected('')}>
|
||||
{ t('filter.all') }
|
||||
</div>
|
||||
{
|
||||
props.devices.map(
|
||||
device => (
|
||||
|
@ -60,6 +60,9 @@ const EN = {
|
||||
title: 'Warning',
|
||||
content: 'This would close all connections'
|
||||
},
|
||||
filter: {
|
||||
all: 'All'
|
||||
},
|
||||
columns: {
|
||||
host: 'Host',
|
||||
network: 'Network',
|
||||
|
@ -60,6 +60,9 @@ const CN = {
|
||||
title: '警告',
|
||||
content: '将会关闭所有连接'
|
||||
},
|
||||
filter: {
|
||||
all: '全部'
|
||||
},
|
||||
columns: {
|
||||
host: '域名',
|
||||
network: '网络',
|
||||
|
Loading…
x
Reference in New Issue
Block a user