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 classnames from 'classnames'
|
||||||
import { BaseComponentProps } from '@models'
|
import { BaseComponentProps } from '@models'
|
||||||
|
import { useI18n } from '@stores'
|
||||||
import './style.scss'
|
import './style.scss'
|
||||||
|
|
||||||
interface DevicesProps extends BaseComponentProps {
|
interface DevicesProps extends BaseComponentProps {
|
||||||
@ -10,6 +11,9 @@ interface DevicesProps extends BaseComponentProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Devices (props: DevicesProps) {
|
export function Devices (props: DevicesProps) {
|
||||||
|
const { translation } = useI18n()
|
||||||
|
const t = useMemo(() => translation('Connections').t, [translation])
|
||||||
|
|
||||||
const { className, style } = props
|
const { className, style } = props
|
||||||
const classname = classnames('connections-devices', className)
|
const classname = classnames('connections-devices', className)
|
||||||
function handleSelected (label: string) {
|
function handleSelected (label: string) {
|
||||||
@ -18,7 +22,9 @@ export function Devices (props: DevicesProps) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classname} style={style}>
|
<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(
|
props.devices.map(
|
||||||
device => (
|
device => (
|
||||||
|
@ -60,6 +60,9 @@ const EN = {
|
|||||||
title: 'Warning',
|
title: 'Warning',
|
||||||
content: 'This would close all connections'
|
content: 'This would close all connections'
|
||||||
},
|
},
|
||||||
|
filter: {
|
||||||
|
all: 'All'
|
||||||
|
},
|
||||||
columns: {
|
columns: {
|
||||||
host: 'Host',
|
host: 'Host',
|
||||||
network: 'Network',
|
network: 'Network',
|
||||||
|
@ -60,6 +60,9 @@ const CN = {
|
|||||||
title: '警告',
|
title: '警告',
|
||||||
content: '将会关闭所有连接'
|
content: '将会关闭所有连接'
|
||||||
},
|
},
|
||||||
|
filter: {
|
||||||
|
all: '全部'
|
||||||
|
},
|
||||||
columns: {
|
columns: {
|
||||||
host: '域名',
|
host: '域名',
|
||||||
network: '网络',
|
network: '网络',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user