feat: add support i18n (#1468)

This commit is contained in:
JellyBrick
2023-12-01 01:30:46 +09:00
committed by GitHub
parent 7f71c36dc0
commit 7401cf69ad
65 changed files with 1226 additions and 303 deletions

View File

@ -2,6 +2,7 @@ import prompt from 'custom-electron-prompt';
import promptOptions from '@/providers/prompt-options';
import { createBackend } from '@/utils';
import { t } from '@/i18n';
export default createBackend({
start({ ipc: { handle }, window }) {
@ -10,8 +11,10 @@ export default createBackend({
async (captionLabels: Record<string, string>, currentIndex: string) =>
await prompt(
{
title: 'Choose Caption',
label: `Current Caption: ${captionLabels[currentIndex] || 'None'}`,
title: t('plugins.captions-selector.prompt.selector.title'),
label: t('plugins.captions-selector.prompt.selector.label', {
language: captionLabels[currentIndex] || t('plugins.captions-selector.prompt.selector.none'),
}),
type: 'select',
value: currentIndex,
selectOptions: captionLabels,