mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-19 02:12:10 +08:00
chore: update i18n
This commit is contained in:
@@ -54,7 +54,7 @@ export const FileInput = (props: Props) => {
|
||||
/>
|
||||
|
||||
<Typography noWrap sx={{ ml: 1 }}>
|
||||
{loading ? 'Loading...' : fileName}
|
||||
{loading ? t('shared.statuses.loading') : fileName}
|
||||
</Typography>
|
||||
</Box>
|
||||
)
|
||||
|
||||
@@ -91,9 +91,11 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
setLoading(true)
|
||||
try {
|
||||
// 基本验证
|
||||
if (!form.type) throw new Error('`Type` should not be null')
|
||||
if (!form.type) {
|
||||
throw new Error(t('profiles.modals.profileForm.errors.typeRequired'))
|
||||
}
|
||||
if (form.type === 'remote' && !form.url) {
|
||||
throw new Error('The URL should not be null')
|
||||
throw new Error(t('profiles.modals.profileForm.errors.urlRequired'))
|
||||
}
|
||||
|
||||
// 处理表单数据
|
||||
@@ -131,7 +133,11 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
if (openType === 'new') {
|
||||
await createProfile(item, fileDataRef.current)
|
||||
} else {
|
||||
if (!form.uid) throw new Error('UID not found')
|
||||
if (!form.uid) {
|
||||
throw new Error(
|
||||
t('profiles.modals.profileForm.errors.uidMissing'),
|
||||
)
|
||||
}
|
||||
await patchProfile(form.uid, item)
|
||||
}
|
||||
} else {
|
||||
@@ -141,7 +147,11 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
if (openType === 'new') {
|
||||
await createProfile(item, fileDataRef.current)
|
||||
} else {
|
||||
if (!form.uid) throw new Error('UID not found')
|
||||
if (!form.uid) {
|
||||
throw new Error(
|
||||
t('profiles.modals.profileForm.errors.uidMissing'),
|
||||
)
|
||||
}
|
||||
await patchProfile(form.uid, item)
|
||||
}
|
||||
} catch {
|
||||
@@ -164,7 +174,11 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
if (openType === 'new') {
|
||||
await createProfile(retryItem, fileDataRef.current)
|
||||
} else {
|
||||
if (!form.uid) throw new Error('UID not found')
|
||||
if (!form.uid) {
|
||||
throw new Error(
|
||||
t('profiles.modals.profileForm.errors.uidMissing'),
|
||||
)
|
||||
}
|
||||
await patchProfile(form.uid, retryItem)
|
||||
|
||||
// 编辑模式下恢复原始代理设置
|
||||
@@ -187,7 +201,7 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
onChange(isActivating)
|
||||
}, 0)
|
||||
} catch (err) {
|
||||
showNotice.error(err)
|
||||
showNotice.error('profiles.modals.profileForm.errors.saveFailed', err)
|
||||
} finally {
|
||||
setLoading(false)
|
||||
}
|
||||
@@ -246,8 +260,12 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
autoFocus
|
||||
label={t('profiles.modals.profileForm.fields.type')}
|
||||
>
|
||||
<MenuItem value="remote">Remote</MenuItem>
|
||||
<MenuItem value="local">Local</MenuItem>
|
||||
<MenuItem value="remote">
|
||||
{t('profiles.modals.profileForm.types.remote')}
|
||||
</MenuItem>
|
||||
<MenuItem value="local">
|
||||
{t('profiles.modals.profileForm.types.local')}
|
||||
</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
)}
|
||||
@@ -305,7 +323,7 @@ export function ProfileViewer({ onChange, ref }: ProfileViewerProps) {
|
||||
{...text}
|
||||
{...field}
|
||||
placeholder={`clash-verge/v${version}`}
|
||||
label="User Agent"
|
||||
label={t('profiles.modals.profileForm.fields.userAgent')}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user