mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-11-16 23:04:24 +08:00
fix(i18n): use English runtime text and localize system UI
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { getFormattingLocale } from '@/i18n/format';
|
||||
import { useMemo, useState } from 'react';
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
||||
import { Loader2, Trash2 } from 'lucide-react';
|
||||
@@ -652,7 +653,9 @@ export function NodeObservability({
|
||||
hint={
|
||||
topSourceCountry
|
||||
? t('obs.requestTimes', {
|
||||
count: topSourceCountry.value.toLocaleString('zh-CN'),
|
||||
count: topSourceCountry.value.toLocaleString(
|
||||
getFormattingLocale(),
|
||||
),
|
||||
})
|
||||
: t('obs.noSourceDist')
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getFormattingLocale } from '@/i18n/format';
|
||||
import type {
|
||||
ApplyResult,
|
||||
NodeItem,
|
||||
@@ -255,7 +256,7 @@ export function formatMetricCount(value?: number | null) {
|
||||
if (value === undefined || value === null || !Number.isFinite(value)) {
|
||||
return '—';
|
||||
}
|
||||
return value.toLocaleString('zh-CN');
|
||||
return value.toLocaleString(getFormattingLocale());
|
||||
}
|
||||
|
||||
export function formatBytesPerSecond(value?: number | null, windowSeconds = 1) {
|
||||
|
||||
@@ -79,6 +79,8 @@ function systemConfigMap(configs: SystemConfig[]) {
|
||||
}
|
||||
|
||||
export function RelayNodeDetail({ node }: { node: NodeItem }) {
|
||||
const rt = useTranslations('runtime');
|
||||
|
||||
const t = useTranslations('nodes');
|
||||
const tc = useTranslations('common');
|
||||
const router = useRouter();
|
||||
@@ -116,7 +118,9 @@ export function RelayNodeDetail({ node }: { node: NodeItem }) {
|
||||
'relay_frps_web_ui_port',
|
||||
{
|
||||
value: String(portNum),
|
||||
description: portCfg?.description || 'FRPS 内置 Web 管理界面端口',
|
||||
description:
|
||||
portCfg?.description ||
|
||||
rt('port_for_the_built_in_frps_web_cfab540f'),
|
||||
},
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user