Skip to content

Commit

Permalink
Se termina traduccion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpabon committed Nov 12, 2023
1 parent dc5d69d commit 987be76
Show file tree
Hide file tree
Showing 18 changed files with 253 additions and 66 deletions.
4 changes: 2 additions & 2 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ ipcMain.handle("edgeApi", async (event, ssml) => {
});

ipcMain.handle("azureApi", async (event, ssml, key, region) => {
const res = azureApi(ssml, key, region)
return res;
const res = azureApi(ssml, key, region)
return res;
});

ipcMain.handle("openFolderSelector", async (event) => {
Expand Down
2 changes: 1 addition & 1 deletion electron/utils/azure-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import logger from "../utils/log";
var sdk = require("microsoft-cognitiveservices-speech-sdk");
import * as sdk from "microsoft-cognitiveservices-speech-sdk";

const azureApi = (ssml: string, key: string, region: string) => {
const speechConfig = sdk.SpeechConfig.fromSubscription(key, region);
Expand Down
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<!-- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> -->
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval';">

<title>Vite App</title>
</head>
<body>
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^2.3.3",
"electron": "^19.0.8",
"electron": "^19.1.9",
"electron-builder": "^23.1.0",
"typescript": "^4.7.4",
"vite": "^2.9.13",
Expand Down Expand Up @@ -47,4 +47,4 @@
"vue-i18n": "^9.6.5",
"ws": "^8.13.0"
}
}
}
54 changes: 47 additions & 7 deletions src/assets/i18n/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// src/i18n.js
// src/assets/i18n/i18n.ts
import { createI18n } from 'vue-i18n';

const messages = {
Expand Down Expand Up @@ -42,6 +42,17 @@ const messages = {
configFile: 'Configuration File',
openLogs: 'Open Logs',
clearLogs: 'Clear Logs',
yes: 'Yes',
no: 'No',
serviceRegionPlaceHolder: "Fill in the service region, such as: westus",
confirm: 'OK',
language: 'Language',
voice: 'Voice',
style: 'Style',
role: 'Role',
speed: 'Speed',
pitch: 'Pitch',
remove: 'Remove',
// Otras traducciones...
},
donate: {
Expand Down Expand Up @@ -318,7 +329,7 @@ const messages = {
echnologiesUsed: "Language technologies used",
InPreview: "Language in preview",
},
initialLocalStore:{
initialLocalStore: {
audition: "If you think this project is good, Star, Fork and PR are welcome. Your Star is the best encouragement to the author."
}
},
Expand Down Expand Up @@ -374,6 +385,17 @@ const messages = {
configFile: 'Archivo de Configuración',
openLogs: 'Abrir Registros',
clearLogs: 'Limpiar Registros',
yes: 'Sí',
no: 'No',
serviceRegionPlaceHolder: "Complete la región de servicio, como por ejemplo: westus",
confirm: 'OK',
language: 'Idioma',
voice: 'Voz',
style: 'Estilo',
role: 'Rol',
speed: 'Velocidad',
pitch: 'Tono',
remove: 'Eliminar',
// Otras traducciones...
},
footer: {
Expand Down Expand Up @@ -433,6 +455,7 @@ const messages = {
fileName: "Nombre de Archivo",
filePath: "Ruta de Archivo",
fileSize: "Conteo de Palabras",
fileFormatTip: "El formato de texto: *.txt",
status: "Estado",
ready: "Listo",
remove: "Eliminar",
Expand Down Expand Up @@ -633,8 +656,8 @@ const messages = {
esource: "Recurso de idioma",
echnologiesUsed: "Tecnologías lingüísticas utilizadas",
InPreview: "Idioma en vista previa",
},
initialLocalStore:{
},
initialLocalStore: {
audition: "Si piensas que este proyecto es bueno, Star, Fork y PR son bienvenidos. Tu Star es el mejor ánimo para el autor."
}
},
Expand Down Expand Up @@ -678,6 +701,17 @@ const messages = {
configFile: '配置文件',
openLogs: '打开日志',
clearLogs: '清理日志',
yes: '是',
no: '否',
serviceRegionPlaceHolder: "请填写ServiceRegion,如:westus",
confirm: '确认',
language: '语言',
voice: '语音',
style: '风格',
role: '角色',
speed: '语速',
pitch: '音调',
remove: '删除',
// Otras traducciones...
},
donate: {
Expand Down Expand Up @@ -749,6 +783,7 @@ const messages = {
fileName: "文件名",
filePath: "文件路径",
fileSize: "字数统计",
fileFormatTip: "文本格式:*.txt",
status: "状态",
ready: "就绪",
remove: "移除",
Expand Down Expand Up @@ -951,8 +986,8 @@ const messages = {
echnologiesUsed: "使用的语言技术",
InPreview: "预览中的语言",
},
initialLocalStore:{
audition: "如果你觉得这个项目还不错, 欢迎Star、Fork和PR。你的Star是对作者最好的鼓励。"
initialLocalStore: {
audition: "如果你觉得这个项目还不错, 欢迎Star、Fork和PR。你的Star是对作者最好的鼓励。"
}

},
Expand All @@ -962,8 +997,13 @@ const messages = {
const i18n = createI18n({
legacy: false, // Usa la Composition API
locale: 'es', // Idioma por defecto
fallbackLocale: 'es', // Idioma de reserva
fallbackLocale: 'en', // Idioma de reserva
messages,
});
// const i18nLegacy = createI18n({
// locale: 'es', // Idioma por defecto
// fallbackLocale: 'en', // Idioma de reserva
// messages,
// });

export default i18n;
4 changes: 2 additions & 2 deletions src/components/aside/Aside.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</el-menu-item>
<el-menu-item index="3">
<el-icon><Setting /></el-icon>
<span>{{ t('aside.setting') }}</span>
<span>{{ t('aside.settings') }}</span>
</el-menu-item>
<el-menu-item index="4">
<el-icon><Notebook /></el-icon>
Expand All @@ -30,9 +30,9 @@
import { useTtsStore } from "@/store/store";
import { storeToRefs } from "pinia";
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
import Version from "./Version.vue";
const { t } = useI18n();
const ttsStore = useTtsStore();
const { page, config } = storeToRefs(ttsStore);
Expand Down
2 changes: 1 addition & 1 deletion src/components/configpage/BiliBtn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</template>

<script setup lang="ts">
const { shell } = require("electron");
import { useI18n } from 'vue-i18n';
const { shell } = require("electron");
const { t } = useI18n();
const bilibili = () => {
shell.openExternal("https://space.bilibili.com/19149591");
Expand Down
27 changes: 17 additions & 10 deletions src/components/configpage/ConfigPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@
size="small"
class="input-path"
@change="setServiceRegion"
placeholder="请填写ServiceRegion,如:westus"
:placeholder="t('configPage.serviceRegionPlaceHolder')"
/>
</el-form-item>
<el-form-item :label="t('configPage.autoplay')">
<el-switch
v-model="config.autoplay"
active-text=""
inactive-text=""
:active-text="t('configPage.yes')"
:inactive-text="t('configPage.no')"
inline-prompt
@change="switchChange"
/>
</el-form-item>
<el-form-item :label="t('configPage.updateNotification')">
<el-switch
v-model="config.updateNotification"
active-text=""
inactive-text=""
:active-text="t('configPage.yes')"
:inactive-text="t('configPage.no')"
inline-prompt
@change="updateNotificationChange"
/>
Expand All @@ -80,7 +80,7 @@
<el-form-item :label="t('configPage.auditionText')">
<el-input v-model="config.audition" size="small" class="input-path">
<template #append>
<el-button type="primary" @click="auditionConfig">确认</el-button>
<el-button type="primary" @click="auditionConfig">{{ t('configPage.confirm') }}</el-button>
</template>
</el-input>
</el-form-item>
Expand All @@ -90,7 +90,7 @@
style="width: 100%"
height="calc(100vh - 560px)"
>
<el-table-column :prop="t('configPage.name')" label="t('configPage.name')">
<el-table-column :prop="t('configPage.name')" :label="t('configPage.name')">
<template #default="scope">
<el-popover
effect="light"
Expand All @@ -99,12 +99,19 @@
width="auto"
>
<template #default>
<div>语言: {{ scope.row.content.languageSelect }}</div>
<!-- <div>语言: {{ scope.row.content.languageSelect }}</div>
<div>语音: {{ scope.row.content.voiceSelect }}</div>
<div>风格: {{ scope.row.content.voiceStyleSelect }}</div>
<div>角色: {{ scope.row.content.role }}</div>
<div>语速: {{ scope.row.content.speed }}</div>
<div>音调: {{ scope.row.content.pitch }}</div>
<div>音调: {{ scope.row.content.pitch }}</div> -->
<div>{{ t('configPage.language') }}: {{ scope.row.content.languageSelect }}</div>
<div>{{ t('configPage.voice') }}: {{ scope.row.content.voiceSelect }}</div>
<div>{{ t('configPage.style') }}: {{ scope.row.content.voiceStyleSelect }}</div>
<div>{{ t('configPage.role') }}: {{ scope.row.content.role }}</div>
<div>{{ t('configPage.speed') }}: {{ scope.row.content.speed }}</div>
<div>{{ t('configPage.pitch') }}: {{ scope.row.content.pitch }}</div>

</template>
<template #reference>
<el-tag>{{ scope.row.tagName }}</el-tag>
Expand All @@ -118,7 +125,7 @@
size="small"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button
>{{ t('configPage.remove') }}</el-button
>
</template>
</el-table-column>
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import MainOptions from "./MainOptions.vue";
import ConfigPage from "../configpage/ConfigPage.vue";
Expand All @@ -127,7 +128,6 @@ import { useTtsStore } from "@/store/store";
import { storeToRefs } from "pinia";
const { shell } = require("electron");
var path = require("path");
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const store = useTtsStore();
const { inputs, page, tableData, currMp3Url, config, formConfig, audioPlayer } =
Expand Down
2 changes: 1 addition & 1 deletion src/components/main/MainOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ const startBtn = () => {
}
if (isLoading.value) {
ElMessage({
message: t('messages.waitMessage'),
message: "请稍候。。。",
type: "warning",
duration: 2000,
});
Expand Down
6 changes: 4 additions & 2 deletions src/components/main/emoji-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

import { useI18n } from 'vue-i18n';
const { t } = useI18n();
// import { useI18n } from 'vue-i18n';
// const { t } = useI18n();
import i18n from '@/assets/i18n/i18n';
const { t } = i18n.global;
const styleDes = [
{ keyword: "assistant", emoji: "🔊", word: t('assistant') },
{ keyword: "chat", emoji: "🔊", word: t('chat') },
Expand Down
Loading

0 comments on commit 987be76

Please sign in to comment.