Add Chinese translation (Thank you copilot, and I swear I reviewed the code carefully)
This commit is contained in:
1 parent
77cdf19f7d
commit
e9d8a1c842
16 files changed
+324
-68
No files matched your search
+6
-4
@@ -9,6 +9,7 @@ import Footer from '@/components/Footer'
|
||||
import { useEffect, useState } from 'react'
|
||||
import MaintenanceAlert from '@/components/MaintenanceAlert'
|
||||
import NoIncidentsAlert from '@/components/NoIncidents'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
export const runtime = 'experimental-edge'
|
||||
const inter = Inter({ subsets: ['latin'] })
|
||||
@@ -53,6 +54,7 @@ function getPrevNextMonth(monthStr: string) {
|
||||
}
|
||||
|
||||
export default function IncidentsPage() {
|
||||
const { t } = useTranslation('common')
|
||||
const [selectedMonitor, setSelectedMonitor] = useState<string | null>('')
|
||||
const [selectedMonth, setSelectedMonth] = useState(getSelectedMonth())
|
||||
|
||||
@@ -70,7 +72,7 @@ export default function IncidentsPage() {
|
||||
const { prev, next } = getPrevNextMonth(selectedMonth)
|
||||
|
||||
const monitorOptions = [
|
||||
{ value: '', label: 'All' },
|
||||
{ value: '', label: t('All') },
|
||||
...workerConfig.monitors.map((monitor) => ({
|
||||
value: monitor.id,
|
||||
label: monitor.name,
|
||||
@@ -94,7 +96,7 @@ export default function IncidentsPage() {
|
||||
<Container size="md" style={{ width: '100%' }}>
|
||||
<Group justify="end" mb="md">
|
||||
<Select
|
||||
placeholder="Select monitor"
|
||||
placeholder={t('Select monitor')}
|
||||
data={monitorOptions}
|
||||
value={selectedMonitor}
|
||||
onChange={setSelectedMonitor}
|
||||
@@ -113,13 +115,13 @@ export default function IncidentsPage() {
|
||||
</Box>
|
||||
<Group justify="space-between" mt="md">
|
||||
<Button variant="default" onClick={() => (window.location.hash = prev)}>
|
||||
← Backwards
|
||||
{t('Backwards')}
|
||||
</Button>
|
||||
<Box style={{ alignSelf: 'center', fontWeight: 500, fontSize: 18 }}>
|
||||
{selectedMonth}
|
||||
</Box>
|
||||
<Button variant="default" onClick={() => (window.location.hash = next)}>
|
||||
Forward →
|
||||
{t('Forward')}
|
||||
</Button>
|
||||
</Group>
|
||||
</Container>
|
||||
|
||||
Reference in new issue
Block a user