mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
插件分身多语言支持
This commit is contained in:
@@ -257,8 +257,8 @@ function configDone() {
|
|||||||
function showPluginClone() {
|
function showPluginClone() {
|
||||||
cloneForm.value = {
|
cloneForm.value = {
|
||||||
suffix: '',
|
suffix: '',
|
||||||
name: `${props.plugin?.plugin_name} 分身`,
|
name: t('plugin.cloneDefaultName', { name: props.plugin?.plugin_name }),
|
||||||
description: `${props.plugin?.plugin_desc} (分身版本)`,
|
description: t('plugin.cloneDefaultDescription', { description: props.plugin?.plugin_desc }),
|
||||||
version: props.plugin?.plugin_version || '1.0',
|
version: props.plugin?.plugin_version || '1.0',
|
||||||
icon: props.plugin?.plugin_icon || ''
|
icon: props.plugin?.plugin_icon || ''
|
||||||
}
|
}
|
||||||
@@ -268,13 +268,13 @@ function showPluginClone() {
|
|||||||
// 执行插件分身
|
// 执行插件分身
|
||||||
async function executePluginClone() {
|
async function executePluginClone() {
|
||||||
if (!cloneForm.value.suffix.trim()) {
|
if (!cloneForm.value.suffix.trim()) {
|
||||||
$toast.error('请输入分身后缀')
|
$toast.error(t('plugin.suffixRequired'))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
progressDialog.value = true
|
progressDialog.value = true
|
||||||
progressText.value = `正在创建 ${props.plugin?.plugin_name} 的分身...`
|
progressText.value = t('plugin.cloning', { name: props.plugin?.plugin_name })
|
||||||
|
|
||||||
const result: { [key: string]: any } = await api.post(`plugin/clone/${props.plugin?.id}`, {
|
const result: { [key: string]: any } = await api.post(`plugin/clone/${props.plugin?.id}`, {
|
||||||
suffix: cloneForm.value.suffix.trim(),
|
suffix: cloneForm.value.suffix.trim(),
|
||||||
@@ -287,16 +287,16 @@ async function executePluginClone() {
|
|||||||
progressDialog.value = false
|
progressDialog.value = false
|
||||||
|
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
$toast.success(`插件分身 ${cloneForm.value.name} 创建成功!`)
|
$toast.success(t('plugin.cloneSuccess', { name: cloneForm.value.name }))
|
||||||
pluginCloneDialog.value = false
|
pluginCloneDialog.value = false
|
||||||
// 通知父组件刷新
|
// 通知父组件刷新
|
||||||
emit('remove')
|
emit('remove')
|
||||||
} else {
|
} else {
|
||||||
$toast.error(`插件分身创建失败:${result.message}`)
|
$toast.error(t('plugin.cloneFailed', { message: result.message }))
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
progressDialog.value = false
|
progressDialog.value = false
|
||||||
$toast.error('插件分身创建失败')
|
$toast.error(t('plugin.cloneFailedGeneral'))
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,7 +322,7 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '插件分身',
|
title: t('plugin.clone'),
|
||||||
value: 8,
|
value: 8,
|
||||||
show: true,
|
show: true,
|
||||||
props: {
|
props: {
|
||||||
@@ -547,8 +547,8 @@ watch(
|
|||||||
<VCardTitle class="d-flex align-center pa-4">
|
<VCardTitle class="d-flex align-center pa-4">
|
||||||
<VIcon icon="mdi-content-copy" class="me-3" color="primary" />
|
<VIcon icon="mdi-content-copy" class="me-3" color="primary" />
|
||||||
<div>
|
<div>
|
||||||
<div class="text-h6">🎭 创建插件分身</div>
|
<div class="text-h6">🎭 {{ t('plugin.cloneTitle') }}</div>
|
||||||
<div class="text-caption text-medium-emphasis">为 {{ props.plugin?.plugin_name }} 创建独立的分身实例</div>
|
<div class="text-caption text-medium-emphasis">{{ t('plugin.cloneSubtitle', { name: props.plugin?.plugin_name }) }}</div>
|
||||||
</div>
|
</div>
|
||||||
</VCardTitle>
|
</VCardTitle>
|
||||||
<VDialogCloseBtn @click="pluginCloneDialog = false" />
|
<VDialogCloseBtn @click="pluginCloneDialog = false" />
|
||||||
@@ -564,7 +564,7 @@ watch(
|
|||||||
icon="mdi-information-outline"
|
icon="mdi-information-outline"
|
||||||
>
|
>
|
||||||
<div class="text-body-2">
|
<div class="text-body-2">
|
||||||
<strong>插件分身功能</strong>:创建插件的独立副本,拥有独立的配置和数据,适用于多账号、测试环境等场景
|
<strong>{{ t('plugin.cloneFeature') }}</strong>:{{ t('plugin.cloneDescription') }}
|
||||||
</div>
|
</div>
|
||||||
</VAlert>
|
</VAlert>
|
||||||
|
|
||||||
@@ -573,14 +573,14 @@ watch(
|
|||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="cloneForm.suffix"
|
v-model="cloneForm.suffix"
|
||||||
label="分身后缀 *"
|
:label="t('plugin.suffix') + ' *'"
|
||||||
placeholder="例如:Test、Backup、Site1"
|
:placeholder="t('plugin.suffixPlaceholder')"
|
||||||
hint="用于区分分身的唯一标识,只能包含英文字母和数字"
|
:hint="t('plugin.suffixHint')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
:rules="[
|
:rules="[
|
||||||
v => !!v || '分身后缀不能为空',
|
v => !!v || t('plugin.suffixRequired'),
|
||||||
v => /^[a-zA-Z0-9]+$/.test(v) || '只能包含英文字母和数字',
|
v => /^[a-zA-Z0-9]+$/.test(v) || t('plugin.suffixFormatError'),
|
||||||
v => v.length <= 20 || '长度不能超过20个字符'
|
v => v.length <= 20 || t('plugin.suffixLengthError')
|
||||||
]"
|
]"
|
||||||
required
|
required
|
||||||
prepend-inner-icon="mdi-tag"
|
prepend-inner-icon="mdi-tag"
|
||||||
@@ -590,9 +590,9 @@ watch(
|
|||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="cloneForm.name"
|
v-model="cloneForm.name"
|
||||||
label="分身名称"
|
:label="t('plugin.cloneName')"
|
||||||
placeholder="例如:自动备份 测试版"
|
:placeholder="t('plugin.cloneNamePlaceholder')"
|
||||||
hint="分身插件的显示名称(可选)"
|
:hint="t('plugin.cloneNameHint')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
prepend-inner-icon="mdi-rename-box"
|
prepend-inner-icon="mdi-rename-box"
|
||||||
/>
|
/>
|
||||||
@@ -601,9 +601,9 @@ watch(
|
|||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
<VTextarea
|
<VTextarea
|
||||||
v-model="cloneForm.description"
|
v-model="cloneForm.description"
|
||||||
label="分身描述"
|
:label="t('plugin.cloneDescriptionLabel')"
|
||||||
placeholder="描述这个分身的用途和特点..."
|
:placeholder="t('plugin.cloneDescriptionPlaceholder')"
|
||||||
hint="详细描述分身插件的用途(可选)"
|
:hint="t('plugin.cloneDescriptionHint')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
rows="2"
|
rows="2"
|
||||||
prepend-inner-icon="mdi-text"
|
prepend-inner-icon="mdi-text"
|
||||||
@@ -613,9 +613,9 @@ watch(
|
|||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="cloneForm.version"
|
v-model="cloneForm.version"
|
||||||
label="版本号"
|
:label="t('plugin.cloneVersion')"
|
||||||
placeholder="例如:1.0、2.1.0"
|
:placeholder="t('plugin.cloneVersionPlaceholder')"
|
||||||
hint="自定义分身插件的版本号(可选)"
|
:hint="t('plugin.cloneVersionHint')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
prepend-inner-icon="mdi-numeric"
|
prepend-inner-icon="mdi-numeric"
|
||||||
/>
|
/>
|
||||||
@@ -624,9 +624,9 @@ watch(
|
|||||||
<VCol cols="12" md="6">
|
<VCol cols="12" md="6">
|
||||||
<VTextField
|
<VTextField
|
||||||
v-model="cloneForm.icon"
|
v-model="cloneForm.icon"
|
||||||
label="图标URL"
|
:label="t('plugin.cloneIcon')"
|
||||||
placeholder="https://example.com/icon.png"
|
:placeholder="t('plugin.cloneIconPlaceholder')"
|
||||||
hint="自定义分身插件的图标(可选)"
|
:hint="t('plugin.cloneIconHint')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
prepend-inner-icon="mdi-image"
|
prepend-inner-icon="mdi-image"
|
||||||
/>
|
/>
|
||||||
@@ -642,7 +642,7 @@ watch(
|
|||||||
icon="mdi-alert-circle-outline"
|
icon="mdi-alert-circle-outline"
|
||||||
>
|
>
|
||||||
<div class="text-body-2">
|
<div class="text-body-2">
|
||||||
<strong>注意</strong>:分身插件创建后默认为禁用状态,需要手动配置启用。分身后缀一旦确定无法修改。
|
<strong>{{ t('common.notice') }}</strong>:{{ t('plugin.cloneNotice') }}
|
||||||
</div>
|
</div>
|
||||||
</VAlert>
|
</VAlert>
|
||||||
</VCol>
|
</VCol>
|
||||||
@@ -657,7 +657,7 @@ watch(
|
|||||||
@click="pluginCloneDialog = false"
|
@click="pluginCloneDialog = false"
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
>
|
>
|
||||||
取消
|
{{ t('common.cancel') }}
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn
|
<VBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
@@ -665,7 +665,7 @@ watch(
|
|||||||
:disabled="!cloneForm.suffix.trim()"
|
:disabled="!cloneForm.suffix.trim()"
|
||||||
>
|
>
|
||||||
<VIcon icon="mdi-content-copy" class="me-2" />
|
<VIcon icon="mdi-content-copy" class="me-2" />
|
||||||
创建分身
|
{{ t('plugin.createClone') }}
|
||||||
</VBtn>
|
</VBtn>
|
||||||
</VCardActions>
|
</VCardActions>
|
||||||
</VCard>
|
</VCard>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export default {
|
|||||||
unsubscribe: 'Unsubscribe',
|
unsubscribe: 'Unsubscribe',
|
||||||
media: 'Media',
|
media: 'Media',
|
||||||
unknown: 'Unknown',
|
unknown: 'Unknown',
|
||||||
|
notice: 'Notice',
|
||||||
},
|
},
|
||||||
mediaType: {
|
mediaType: {
|
||||||
movie: 'Movie',
|
movie: 'Movie',
|
||||||
@@ -2013,6 +2014,37 @@ export default {
|
|||||||
folderName: 'Folder Name',
|
folderName: 'Folder Name',
|
||||||
cancel: 'Cancel',
|
cancel: 'Cancel',
|
||||||
create: 'Create',
|
create: 'Create',
|
||||||
|
clone: 'Plugin Clone',
|
||||||
|
cloneTitle: 'Create Plugin Clone',
|
||||||
|
cloneSubtitle: 'Create an independent clone instance for {name}',
|
||||||
|
cloneFeature: 'Plugin Clone Feature',
|
||||||
|
cloneDescription: 'Create an independent copy of the plugin with separate configuration and data, suitable for multi-account, testing environments, etc.',
|
||||||
|
suffix: 'Clone Suffix',
|
||||||
|
suffixPlaceholder: 'e.g.: Test, Backup, Site1',
|
||||||
|
suffixHint: 'Unique identifier to distinguish clones, only letters and numbers allowed',
|
||||||
|
suffixRequired: 'Clone suffix cannot be empty',
|
||||||
|
suffixFormatError: 'Only letters and numbers allowed',
|
||||||
|
suffixLengthError: 'Length cannot exceed 20 characters',
|
||||||
|
cloneName: 'Clone Name',
|
||||||
|
cloneNamePlaceholder: 'e.g.: Auto Backup Test Version',
|
||||||
|
cloneNameHint: 'Display name for the clone plugin (optional)',
|
||||||
|
cloneDefaultName: '{name} Clone',
|
||||||
|
cloneDescriptionLabel: 'Clone Description',
|
||||||
|
cloneDescriptionPlaceholder: 'Describe the purpose and features of this clone...',
|
||||||
|
cloneDescriptionHint: 'Detailed description of the clone plugin purpose (optional)',
|
||||||
|
cloneDefaultDescription: '{description} (Clone Version)',
|
||||||
|
cloneVersion: 'Version',
|
||||||
|
cloneVersionPlaceholder: 'e.g.: 1.0, 2.1.0',
|
||||||
|
cloneVersionHint: 'Custom version number for the clone plugin (optional)',
|
||||||
|
cloneIcon: 'Icon URL',
|
||||||
|
cloneIconPlaceholder: 'https://example.com/icon.png',
|
||||||
|
cloneIconHint: 'Custom icon for the clone plugin (optional)',
|
||||||
|
cloneNotice: 'Clone plugins are disabled by default after creation and need to be manually configured and enabled. The clone suffix cannot be modified once set.',
|
||||||
|
createClone: 'Create Clone',
|
||||||
|
cloning: 'Creating clone for {name}...',
|
||||||
|
cloneSuccess: 'Plugin clone {name} created successfully!',
|
||||||
|
cloneFailed: 'Plugin clone creation failed: {message}',
|
||||||
|
cloneFailedGeneral: 'Plugin clone creation failed',
|
||||||
},
|
},
|
||||||
profile: {
|
profile: {
|
||||||
personalInfo: 'Personal Information',
|
personalInfo: 'Personal Information',
|
||||||
|
|||||||
+30
-6
@@ -39,6 +39,7 @@ export default {
|
|||||||
unsubscribe: '取消订阅',
|
unsubscribe: '取消订阅',
|
||||||
media: '媒体',
|
media: '媒体',
|
||||||
unknown: '未知',
|
unknown: '未知',
|
||||||
|
notice: '注意',
|
||||||
},
|
},
|
||||||
mediaType: {
|
mediaType: {
|
||||||
movie: '电影',
|
movie: '电影',
|
||||||
@@ -1989,14 +1990,37 @@ export default {
|
|||||||
folderName: '文件夹名称',
|
folderName: '文件夹名称',
|
||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
create: '创建',
|
create: '创建',
|
||||||
clonePluginTitle: '创建插件分身 - {name}',
|
clone: '插件分身',
|
||||||
|
cloneTitle: '创建插件分身',
|
||||||
|
cloneSubtitle: '为 {name} 创建独立的分身实例',
|
||||||
|
cloneFeature: '插件分身功能',
|
||||||
|
cloneDescription: '创建插件的独立副本,拥有独立的配置和数据,适用于多账号、测试环境等场景',
|
||||||
suffix: '分身后缀',
|
suffix: '分身后缀',
|
||||||
description: '描述',
|
suffixPlaceholder: '例如:Test、Backup、Site1',
|
||||||
clone: '创建分身',
|
suffixHint: '用于区分分身的唯一标识,只能包含英文字母和数字',
|
||||||
suffixPlaceholder: '例如:Clone1, Test, Backup',
|
|
||||||
namePlaceholder: '分身插件的显示名称',
|
|
||||||
descriptionPlaceholder: '分身插件的描述信息',
|
|
||||||
suffixRequired: '分身后缀不能为空',
|
suffixRequired: '分身后缀不能为空',
|
||||||
|
suffixFormatError: '只能包含英文字母和数字',
|
||||||
|
suffixLengthError: '长度不能超过20个字符',
|
||||||
|
cloneName: '分身名称',
|
||||||
|
cloneNamePlaceholder: '例如:自动备份 测试版',
|
||||||
|
cloneNameHint: '分身插件的显示名称(可选)',
|
||||||
|
cloneDefaultName: '{name} 分身',
|
||||||
|
cloneDescriptionLabel: '分身描述',
|
||||||
|
cloneDescriptionPlaceholder: '描述这个分身的用途和特点...',
|
||||||
|
cloneDescriptionHint: '详细描述分身插件的用途(可选)',
|
||||||
|
cloneDefaultDescription: '{description} (分身版本)',
|
||||||
|
cloneVersion: '版本号',
|
||||||
|
cloneVersionPlaceholder: '例如:1.0、2.1.0',
|
||||||
|
cloneVersionHint: '自定义分身插件的版本号(可选)',
|
||||||
|
cloneIcon: '图标URL',
|
||||||
|
cloneIconPlaceholder: 'https://example.com/icon.png',
|
||||||
|
cloneIconHint: '自定义分身插件的图标(可选)',
|
||||||
|
cloneNotice: '分身插件创建后默认为禁用状态,需要手动配置启用。分身后缀一旦确定无法修改。',
|
||||||
|
createClone: '创建分身',
|
||||||
|
cloning: '正在创建 {name} 的分身...',
|
||||||
|
cloneSuccess: '插件分身 {name} 创建成功!',
|
||||||
|
cloneFailed: '插件分身创建失败:{message}',
|
||||||
|
cloneFailedGeneral: '插件分身创建失败',
|
||||||
},
|
},
|
||||||
profile: {
|
profile: {
|
||||||
personalInfo: '个人信息',
|
personalInfo: '个人信息',
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export default {
|
|||||||
unsubscribe: '取消訂閱',
|
unsubscribe: '取消訂閱',
|
||||||
media: '媒體',
|
media: '媒體',
|
||||||
unknown: '未知',
|
unknown: '未知',
|
||||||
|
notice: '注意',
|
||||||
},
|
},
|
||||||
mediaType: {
|
mediaType: {
|
||||||
movie: '電影',
|
movie: '電影',
|
||||||
@@ -1990,6 +1991,37 @@ export default {
|
|||||||
folderName: '文件夾名稱',
|
folderName: '文件夾名稱',
|
||||||
cancel: '取消',
|
cancel: '取消',
|
||||||
create: '創建',
|
create: '創建',
|
||||||
|
clone: '插件分身',
|
||||||
|
cloneTitle: '創建插件分身',
|
||||||
|
cloneSubtitle: '為 {name} 創建獨立的分身實例',
|
||||||
|
cloneFeature: '插件分身功能',
|
||||||
|
cloneDescription: '創建插件的獨立副本,擁有獨立的配置和數據,適用於多賬號、測試環境等場景',
|
||||||
|
suffix: '分身後綴',
|
||||||
|
suffixPlaceholder: '例如:Test、Backup、Site1',
|
||||||
|
suffixHint: '用於區分分身的唯一標識,只能包含英文字母和數字',
|
||||||
|
suffixRequired: '分身後綴不能為空',
|
||||||
|
suffixFormatError: '只能包含英文字母和數字',
|
||||||
|
suffixLengthError: '長度不能超過20個字符',
|
||||||
|
cloneName: '分身名稱',
|
||||||
|
cloneNamePlaceholder: '例如:自動備份 測試版',
|
||||||
|
cloneNameHint: '分身插件的顯示名稱(可選)',
|
||||||
|
cloneDefaultName: '{name} 分身',
|
||||||
|
cloneDescriptionLabel: '分身描述',
|
||||||
|
cloneDescriptionPlaceholder: '描述這個分身的用途和特點...',
|
||||||
|
cloneDescriptionHint: '詳細描述分身插件的用途(可選)',
|
||||||
|
cloneDefaultDescription: '{description} (分身版本)',
|
||||||
|
cloneVersion: '版本號',
|
||||||
|
cloneVersionPlaceholder: '例如:1.0、2.1.0',
|
||||||
|
cloneVersionHint: '自定義分身插件的版本號(可選)',
|
||||||
|
cloneIcon: '圖標URL',
|
||||||
|
cloneIconPlaceholder: 'https://example.com/icon.png',
|
||||||
|
cloneIconHint: '自定義分身插件的圖標(可選)',
|
||||||
|
cloneNotice: '分身插件創建後默認為禁用狀態,需要手動配置啟用。分身後綴一旦確定無法修改。',
|
||||||
|
createClone: '創建分身',
|
||||||
|
cloning: '正在創建 {name} 的分身...',
|
||||||
|
cloneSuccess: '插件分身 {name} 創建成功!',
|
||||||
|
cloneFailed: '插件分身創建失敗:{message}',
|
||||||
|
cloneFailedGeneral: '插件分身創建失敗',
|
||||||
},
|
},
|
||||||
profile: {
|
profile: {
|
||||||
personalInfo: '個人信息',
|
personalInfo: '個人信息',
|
||||||
|
|||||||
Reference in New Issue
Block a user