优化结果
This commit is contained in:
137
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/background.css
Normal file
137
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/background.css
Normal file
@@ -0,0 +1,137 @@
|
||||
/* 背景样式文件 */
|
||||
|
||||
/* 页面主背景 */
|
||||
body {
|
||||
background: linear-gradient(135deg, #e8f5e8 0%, #f0fdf4 25%, #dcfce7 50%, #f0fdf4 75%, #e8f5e8 100%);
|
||||
background-size: 400% 400%;
|
||||
animation: gradientShift 15s ease infinite;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
/* 背景动画 */
|
||||
@keyframes gradientShift {
|
||||
0% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
50% {
|
||||
background-position: 100% 50%;
|
||||
}
|
||||
100% {
|
||||
background-position: 0% 50%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 容器背景 */
|
||||
.container {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(10px);
|
||||
border-radius: 20px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
/* 翻译框背景 */
|
||||
.translate-box {
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
backdrop-filter: blur(20px);
|
||||
border: 1px solid rgba(116, 198, 157, 0.3);
|
||||
}
|
||||
|
||||
/* 输入框背景 */
|
||||
#input-text {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
|
||||
#input-text:focus {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
/* 输出框背景 */
|
||||
.output-text {
|
||||
background: #f8fffe;
|
||||
}
|
||||
|
||||
/* 按钮背景 */
|
||||
.translate-btn {
|
||||
background: linear-gradient(135deg, #74c69d, #52b788);
|
||||
}
|
||||
|
||||
.translate-btn:hover {
|
||||
background: linear-gradient(135deg, #52b788, #40916c);
|
||||
}
|
||||
|
||||
.translate-btn:disabled {
|
||||
background: #b7e4c7;
|
||||
}
|
||||
|
||||
.swap-btn {
|
||||
background: #74c69d;
|
||||
}
|
||||
|
||||
.swap-btn:hover {
|
||||
background: #52b788;
|
||||
}
|
||||
|
||||
/* 语言选择器背景 */
|
||||
.lang-select {
|
||||
background: white;
|
||||
}
|
||||
|
||||
.lang-select:focus {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
/* 发音信息背景 */
|
||||
.pronounce-item {
|
||||
background: rgba(116, 198, 157, 0.1);
|
||||
}
|
||||
|
||||
/* 清除和复制按钮背景 */
|
||||
.clear-btn:hover,
|
||||
.copy-btn:hover {
|
||||
background: rgba(116, 198, 157, 0.1);
|
||||
}
|
||||
|
||||
/* 提示消息背景 */
|
||||
.toast {
|
||||
background: #52b788;
|
||||
}
|
||||
|
||||
.toast.error {
|
||||
background: #e74c3c;
|
||||
}
|
||||
|
||||
/* 响应式背景调整 */
|
||||
@media (max-width: 767px) {
|
||||
body {
|
||||
background-size: 200% 200%;
|
||||
animation-duration: 10s;
|
||||
}
|
||||
|
||||
.container {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
backdrop-filter: blur(5px);
|
||||
}
|
||||
|
||||
.translate-box {
|
||||
background: rgba(255, 255, 255, 0.98);
|
||||
backdrop-filter: blur(15px);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
body {
|
||||
background-size: 150% 150%;
|
||||
animation-duration: 8s;
|
||||
}
|
||||
|
||||
.container {
|
||||
background: transparent;
|
||||
backdrop-filter: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.translate-box {
|
||||
background: rgba(255, 255, 255, 0.99);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
}
|
||||
99
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/index.html
Normal file
99
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/index.html
Normal file
@@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>在线翻译 - 支持109种语言</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<link rel="stylesheet" href="background.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header class="header">
|
||||
<h1>在线机器翻译</h1>
|
||||
<p class="subtitle">支持109种语言互译</p>
|
||||
</header>
|
||||
|
||||
<main class="main-content">
|
||||
<div class="translate-box">
|
||||
<div class="language-selector">
|
||||
<div class="lang-group">
|
||||
<label for="from-lang">源语言</label>
|
||||
<select id="from-lang" class="lang-select">
|
||||
<option value="auto">自动检测</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button class="swap-btn" id="swap-btn" title="交换语言">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<path d="M7 16l4-4-4-4"></path>
|
||||
<path d="M17 8l-4 4 4 4"></path>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="lang-group">
|
||||
<label for="to-lang">目标语言</label>
|
||||
<select id="to-lang" class="lang-select">
|
||||
<option value="auto">自动选择</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-areas">
|
||||
<div class="input-section">
|
||||
<div class="textarea-header">
|
||||
<span class="detected-lang" id="detected-lang"></span>
|
||||
<button class="clear-btn" id="clear-btn" title="清空">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<line x1="18" y1="6" x2="6" y2="18"></line>
|
||||
<line x1="6" y1="6" x2="18" y2="18"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<textarea
|
||||
id="input-text"
|
||||
placeholder="请输入要翻译的文本..."
|
||||
maxlength="5000"
|
||||
></textarea>
|
||||
<div class="char-count">
|
||||
<span id="char-count">0</span>/5000
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="output-section">
|
||||
<div class="textarea-header">
|
||||
<span class="target-lang" id="target-lang"></span>
|
||||
<button class="copy-btn" id="copy-btn" title="复制">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
||||
<rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
|
||||
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div id="output-text" class="output-text">翻译结果将显示在这里...</div>
|
||||
<div class="pronounce-section" id="pronounce-section">
|
||||
<div class="pronounce-item" id="source-pronounce"></div>
|
||||
<div class="pronounce-item" id="target-pronounce"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="action-buttons">
|
||||
<button class="translate-btn" id="translate-btn">
|
||||
<span class="btn-text">翻译</span>
|
||||
<div class="loading-spinner" id="loading-spinner"></div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<footer class="footer">
|
||||
<p>数据来源于有道翻译,与其网页端同步</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<div class="toast" id="toast"></div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
452
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/script.js
Normal file
452
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/script.js
Normal file
@@ -0,0 +1,452 @@
|
||||
// 全局变量
|
||||
let supportedLanguages = {};
|
||||
let isTranslating = false;
|
||||
|
||||
// DOM元素
|
||||
const elements = {
|
||||
fromLang: null,
|
||||
toLang: null,
|
||||
inputText: null,
|
||||
outputText: null,
|
||||
translateBtn: null,
|
||||
swapBtn: null,
|
||||
clearBtn: null,
|
||||
copyBtn: null,
|
||||
charCount: null,
|
||||
detectedLang: null,
|
||||
targetLang: null,
|
||||
pronounceSection: null
|
||||
};
|
||||
|
||||
// 初始化
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
initializeElements();
|
||||
loadSupportedLanguages();
|
||||
bindEvents();
|
||||
updateCharCount();
|
||||
});
|
||||
|
||||
// 初始化DOM元素
|
||||
function initializeElements() {
|
||||
elements.fromLang = document.getElementById('from-lang');
|
||||
elements.toLang = document.getElementById('to-lang');
|
||||
elements.inputText = document.getElementById('input-text');
|
||||
elements.outputText = document.getElementById('output-text');
|
||||
elements.translateBtn = document.getElementById('translate-btn');
|
||||
elements.swapBtn = document.getElementById('swap-btn');
|
||||
elements.clearBtn = document.getElementById('clear-btn');
|
||||
elements.copyBtn = document.getElementById('copy-btn');
|
||||
elements.charCount = document.getElementById('char-count');
|
||||
elements.detectedLang = document.getElementById('detected-lang');
|
||||
elements.targetLang = document.getElementById('target-lang');
|
||||
elements.pronounceSection = document.getElementById('pronounce-section');
|
||||
}
|
||||
|
||||
// 加载支持的语言列表
|
||||
async function loadSupportedLanguages() {
|
||||
try {
|
||||
const response = await fetch('https://60s.viki.moe/v2/fanyi/langs');
|
||||
const data = await response.json();
|
||||
|
||||
if (data.code === 200 && data.data && Array.isArray(data.data)) {
|
||||
// 转换数组格式为对象格式
|
||||
supportedLanguages = {};
|
||||
supportedLanguages['auto'] = '自动检测';
|
||||
data.data.forEach(lang => {
|
||||
supportedLanguages[lang.code] = lang.label;
|
||||
});
|
||||
populateLanguageSelectors();
|
||||
} else {
|
||||
throw new Error('获取语言列表失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载语言列表失败:', error);
|
||||
showToast('加载语言列表失败,请刷新页面重试', 'error');
|
||||
// 使用默认语言列表
|
||||
useDefaultLanguages();
|
||||
}
|
||||
}
|
||||
|
||||
// 使用默认语言列表(备用方案)
|
||||
function useDefaultLanguages() {
|
||||
supportedLanguages = {
|
||||
'auto': '自动检测',
|
||||
'zh-CHS': '中文',
|
||||
'en': '英语',
|
||||
'ja': '日语',
|
||||
'ko': '韩语',
|
||||
'fr': '法语',
|
||||
'de': '德语',
|
||||
'es': '西班牙语',
|
||||
'ru': '俄语',
|
||||
'th': '泰语',
|
||||
'ar': '阿拉伯语',
|
||||
'pt': '葡萄牙语',
|
||||
'it': '意大利语'
|
||||
};
|
||||
populateLanguageSelectors();
|
||||
}
|
||||
|
||||
// 填充语言选择器
|
||||
function populateLanguageSelectors() {
|
||||
const fromSelect = elements.fromLang;
|
||||
const toSelect = elements.toLang;
|
||||
|
||||
// 清空现有选项
|
||||
fromSelect.innerHTML = '';
|
||||
toSelect.innerHTML = '';
|
||||
|
||||
// 添加语言选项
|
||||
Object.entries(supportedLanguages).forEach(([code, name]) => {
|
||||
const fromOption = new Option(name, code);
|
||||
const toOption = new Option(name, code);
|
||||
|
||||
fromSelect.appendChild(fromOption);
|
||||
toSelect.appendChild(toOption);
|
||||
});
|
||||
|
||||
// 设置默认值
|
||||
fromSelect.value = 'auto';
|
||||
toSelect.value = 'en';
|
||||
|
||||
// 如果没有auto选项,则设置为中文
|
||||
if (!supportedLanguages['auto']) {
|
||||
fromSelect.value = 'zh-CHS';
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定事件
|
||||
function bindEvents() {
|
||||
// 输入框事件
|
||||
elements.inputText.addEventListener('input', function() {
|
||||
updateCharCount();
|
||||
clearOutput();
|
||||
});
|
||||
|
||||
elements.inputText.addEventListener('keydown', function(e) {
|
||||
if (e.ctrlKey && e.key === 'Enter') {
|
||||
translateText();
|
||||
}
|
||||
});
|
||||
|
||||
// 按钮事件
|
||||
elements.translateBtn.addEventListener('click', translateText);
|
||||
elements.swapBtn.addEventListener('click', swapLanguages);
|
||||
elements.clearBtn.addEventListener('click', clearInput);
|
||||
elements.copyBtn.addEventListener('click', copyOutput);
|
||||
|
||||
// 语言选择器事件
|
||||
elements.fromLang.addEventListener('change', function() {
|
||||
clearOutput();
|
||||
updateLanguageLabels();
|
||||
});
|
||||
|
||||
elements.toLang.addEventListener('change', function() {
|
||||
clearOutput();
|
||||
updateLanguageLabels();
|
||||
});
|
||||
}
|
||||
|
||||
// 更新字符计数
|
||||
function updateCharCount() {
|
||||
const text = elements.inputText.value;
|
||||
const count = text.length;
|
||||
elements.charCount.textContent = `${count}/5000`;
|
||||
|
||||
if (count > 5000) {
|
||||
elements.charCount.style.color = '#e74c3c';
|
||||
} else {
|
||||
elements.charCount.style.color = '#74c69d';
|
||||
}
|
||||
}
|
||||
|
||||
// 更新语言标签
|
||||
function updateLanguageLabels() {
|
||||
const fromLang = elements.fromLang.value;
|
||||
const toLang = elements.toLang.value;
|
||||
|
||||
elements.detectedLang.textContent = supportedLanguages[fromLang] || '未知语言';
|
||||
elements.targetLang.textContent = supportedLanguages[toLang] || '未知语言';
|
||||
}
|
||||
|
||||
// 翻译文本
|
||||
async function translateText() {
|
||||
const text = elements.inputText.value.trim();
|
||||
|
||||
if (!text) {
|
||||
showToast('请输入要翻译的文本', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (text.length > 5000) {
|
||||
showToast('文本长度不能超过5000字符', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
if (isTranslating) {
|
||||
return;
|
||||
}
|
||||
|
||||
setTranslating(true);
|
||||
|
||||
try {
|
||||
const fromLang = elements.fromLang.value;
|
||||
const toLang = elements.toLang.value;
|
||||
|
||||
// 构建请求URL
|
||||
const params = new URLSearchParams({
|
||||
text: text,
|
||||
from: fromLang,
|
||||
to: toLang
|
||||
});
|
||||
|
||||
const response = await fetch(`https://60s.viki.moe/v2/fanyi?${params}`);
|
||||
const data = await response.json();
|
||||
|
||||
if (data.code === 200 && data.data) {
|
||||
displayTranslationResult(data.data);
|
||||
} else {
|
||||
throw new Error(data.msg || '翻译失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('翻译失败:', error);
|
||||
showToast('翻译失败: ' + error.message, 'error');
|
||||
elements.outputText.textContent = '翻译失败,请重试';
|
||||
} finally {
|
||||
setTranslating(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 显示翻译结果
|
||||
function displayTranslationResult(data) {
|
||||
// 显示翻译结果
|
||||
const translation = data.target ? data.target.text : '';
|
||||
elements.outputText.textContent = translation;
|
||||
|
||||
// 更新检测到的语言
|
||||
if (data.source && data.source.type_desc) {
|
||||
elements.detectedLang.textContent = `检测: ${data.source.type_desc}`;
|
||||
}
|
||||
|
||||
// 显示发音信息
|
||||
displayPronunciation(data);
|
||||
|
||||
// 如果翻译结果为空
|
||||
if (!translation) {
|
||||
elements.outputText.textContent = '未获取到翻译结果';
|
||||
}
|
||||
}
|
||||
|
||||
// 显示发音信息
|
||||
function displayPronunciation(data) {
|
||||
const pronounceSection = elements.pronounceSection;
|
||||
if (!pronounceSection) {
|
||||
return;
|
||||
}
|
||||
pronounceSection.innerHTML = '';
|
||||
|
||||
// 原文发音
|
||||
if (data.source && data.source.pronounce) {
|
||||
const sourcePhoneticDiv = document.createElement('div');
|
||||
sourcePhoneticDiv.className = 'pronounce-item show';
|
||||
sourcePhoneticDiv.textContent = `原文发音: [${data.source.pronounce}]`;
|
||||
pronounceSection.appendChild(sourcePhoneticDiv);
|
||||
}
|
||||
|
||||
// 译文发音
|
||||
if (data.target && data.target.pronounce) {
|
||||
const targetPhoneticDiv = document.createElement('div');
|
||||
targetPhoneticDiv.className = 'pronounce-item show';
|
||||
targetPhoneticDiv.textContent = `译文发音: [${data.target.pronounce}]`;
|
||||
pronounceSection.appendChild(targetPhoneticDiv);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置翻译状态
|
||||
function setTranslating(translating) {
|
||||
isTranslating = translating;
|
||||
elements.translateBtn.disabled = translating;
|
||||
|
||||
if (translating) {
|
||||
elements.translateBtn.classList.add('loading');
|
||||
} else {
|
||||
elements.translateBtn.classList.remove('loading');
|
||||
}
|
||||
}
|
||||
|
||||
// 交换语言
|
||||
function swapLanguages() {
|
||||
const fromValue = elements.fromLang.value;
|
||||
const toValue = elements.toLang.value;
|
||||
|
||||
// 不能交换自动检测
|
||||
if (fromValue === 'auto') {
|
||||
showToast('自动检测语言无法交换', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
elements.fromLang.value = toValue;
|
||||
elements.toLang.value = fromValue;
|
||||
|
||||
// 交换文本内容
|
||||
const inputText = elements.inputText.value;
|
||||
const outputText = elements.outputText.textContent;
|
||||
|
||||
if (outputText && outputText !== '翻译结果将在这里显示...' && outputText !== '翻译失败,请重试' && outputText !== '未获取到翻译结果') {
|
||||
elements.inputText.value = outputText;
|
||||
elements.outputText.textContent = inputText;
|
||||
}
|
||||
|
||||
updateCharCount();
|
||||
updateLanguageLabels();
|
||||
clearPronunciation();
|
||||
}
|
||||
|
||||
// 清空输入
|
||||
function clearInput() {
|
||||
elements.inputText.value = '';
|
||||
updateCharCount();
|
||||
clearOutput();
|
||||
}
|
||||
|
||||
// 清空输出
|
||||
function clearOutput() {
|
||||
elements.outputText.textContent = '翻译结果将在这里显示...';
|
||||
clearPronunciation();
|
||||
}
|
||||
|
||||
// 清空发音信息
|
||||
function clearPronunciation() {
|
||||
if (elements.pronounceSection) {
|
||||
elements.pronounceSection.innerHTML = '';
|
||||
}
|
||||
}
|
||||
|
||||
// 复制输出
|
||||
function copyOutput() {
|
||||
const text = elements.outputText.textContent;
|
||||
|
||||
if (!text || text === '翻译结果将在这里显示...' || text === '翻译失败,请重试' || text === '未获取到翻译结果') {
|
||||
showToast('没有可复制的内容', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
// 使用现代API复制
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
showToast('已复制到剪贴板');
|
||||
}).catch(() => {
|
||||
fallbackCopy(text);
|
||||
});
|
||||
} else {
|
||||
fallbackCopy(text);
|
||||
}
|
||||
}
|
||||
|
||||
// 备用复制方法
|
||||
function fallbackCopy(text) {
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = text;
|
||||
textArea.style.position = 'fixed';
|
||||
textArea.style.opacity = '0';
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
showToast('已复制到剪贴板');
|
||||
} catch (err) {
|
||||
showToast('复制失败,请手动复制', 'error');
|
||||
}
|
||||
|
||||
document.body.removeChild(textArea);
|
||||
}
|
||||
|
||||
// 显示提示消息
|
||||
function showToast(message, type = 'success') {
|
||||
// 移除现有的toast
|
||||
const existingToast = document.querySelector('.toast');
|
||||
if (existingToast) {
|
||||
existingToast.remove();
|
||||
}
|
||||
|
||||
const toast = document.createElement('div');
|
||||
toast.className = `toast ${type}`;
|
||||
toast.textContent = message;
|
||||
|
||||
document.body.appendChild(toast);
|
||||
|
||||
// 显示toast
|
||||
setTimeout(() => {
|
||||
toast.classList.add('show');
|
||||
}, 100);
|
||||
|
||||
// 自动隐藏
|
||||
setTimeout(() => {
|
||||
toast.classList.remove('show');
|
||||
setTimeout(() => {
|
||||
if (toast.parentNode) {
|
||||
toast.parentNode.removeChild(toast);
|
||||
}
|
||||
}, 300);
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
// 工具函数:防抖
|
||||
function debounce(func, wait) {
|
||||
let timeout;
|
||||
return function executedFunction(...args) {
|
||||
const later = () => {
|
||||
clearTimeout(timeout);
|
||||
func(...args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
};
|
||||
}
|
||||
|
||||
// 添加键盘快捷键支持
|
||||
document.addEventListener('keydown', function(e) {
|
||||
// Ctrl+Enter 翻译
|
||||
if (e.ctrlKey && e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
translateText();
|
||||
}
|
||||
|
||||
// Ctrl+Shift+C 复制结果
|
||||
if (e.ctrlKey && e.shiftKey && e.key === 'C') {
|
||||
e.preventDefault();
|
||||
copyOutput();
|
||||
}
|
||||
|
||||
// Ctrl+Shift+X 清空输入
|
||||
if (e.ctrlKey && e.shiftKey && e.key === 'X') {
|
||||
e.preventDefault();
|
||||
clearInput();
|
||||
}
|
||||
|
||||
// Ctrl+Shift+S 交换语言
|
||||
if (e.ctrlKey && e.shiftKey && e.key === 'S') {
|
||||
e.preventDefault();
|
||||
swapLanguages();
|
||||
}
|
||||
});
|
||||
|
||||
// 页面可见性变化时的处理
|
||||
document.addEventListener('visibilitychange', function() {
|
||||
if (document.hidden) {
|
||||
// 页面隐藏时暂停翻译请求
|
||||
if (isTranslating) {
|
||||
setTranslating(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 错误处理
|
||||
window.addEventListener('error', function(e) {
|
||||
console.error('页面错误:', e.error);
|
||||
});
|
||||
|
||||
window.addEventListener('unhandledrejection', function(e) {
|
||||
console.error('未处理的Promise拒绝:', e.reason);
|
||||
});
|
||||
441
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/styles.css
Normal file
441
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/styles.css
Normal file
@@ -0,0 +1,441 @@
|
||||
/* 基础样式重置 */
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
||||
line-height: 1.6;
|
||||
color: #2d5a3d;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 头部样式 */
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 2.5rem;
|
||||
color: #1a4d2e;
|
||||
margin-bottom: 10px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 1.1rem;
|
||||
color: #4a7c59;
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
/* 主要内容区域 */
|
||||
.main-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.translate-box {
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
border-radius: 20px;
|
||||
padding: 30px;
|
||||
box-shadow: 0 10px 30px rgba(26, 77, 46, 0.1);
|
||||
}
|
||||
|
||||
/* 语言选择器 */
|
||||
.language-selector {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20px;
|
||||
margin-bottom: 25px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.lang-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.lang-group label {
|
||||
font-size: 0.9rem;
|
||||
color: #2d5a3d;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.lang-select {
|
||||
padding: 12px 16px;
|
||||
border: 2px solid #74c69d;
|
||||
border-radius: 12px;
|
||||
color: #2d5a3d;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.lang-select:focus {
|
||||
outline: none;
|
||||
border-color: #52b788;
|
||||
box-shadow: 0 0 0 3px rgba(116, 198, 157, 0.2);
|
||||
}
|
||||
|
||||
.lang-select:hover {
|
||||
border-color: #52b788;
|
||||
}
|
||||
|
||||
.swap-btn {
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
width: 45px;
|
||||
height: 45px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
color: white;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
.swap-btn:hover {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* 文本区域 */
|
||||
.text-areas {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 20px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.input-section,
|
||||
.output-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.textarea-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.detected-lang,
|
||||
.target-lang {
|
||||
font-size: 0.9rem;
|
||||
color: #4a7c59;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.clear-btn,
|
||||
.copy-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #74c69d;
|
||||
cursor: pointer;
|
||||
padding: 5px;
|
||||
border-radius: 6px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.clear-btn:hover,
|
||||
.copy-btn:hover {
|
||||
color: #52b788;
|
||||
}
|
||||
|
||||
#input-text {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
padding: 16px;
|
||||
border: 2px solid #74c69d;
|
||||
border-radius: 12px;
|
||||
font-size: 1rem;
|
||||
color: #2d5a3d;
|
||||
resize: vertical;
|
||||
transition: all 0.3s ease;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
#input-text:focus {
|
||||
outline: none;
|
||||
border-color: #52b788;
|
||||
box-shadow: 0 0 0 3px rgba(116, 198, 157, 0.2);
|
||||
}
|
||||
|
||||
#input-text::placeholder {
|
||||
color: #74c69d;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.output-text {
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
padding: 16px;
|
||||
border: 2px solid #b7e4c7;
|
||||
border-radius: 12px;
|
||||
font-size: 1rem;
|
||||
color: #2d5a3d;
|
||||
overflow-y: auto;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.char-count {
|
||||
text-align: right;
|
||||
font-size: 0.8rem;
|
||||
color: #74c69d;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.pronounce-section {
|
||||
margin-top: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.pronounce-item {
|
||||
font-size: 0.9rem;
|
||||
color: #4a7c59;
|
||||
font-style: italic;
|
||||
padding: 5px 10px;
|
||||
border-radius: 8px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pronounce-item.show {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 操作按钮 */
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.translate-btn {
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 15px 40px;
|
||||
border-radius: 25px;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
min-width: 120px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.translate-btn:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(116, 198, 157, 0.3);
|
||||
}
|
||||
|
||||
.translate-btn:active {
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.translate-btn:disabled {
|
||||
cursor: not-allowed;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border: 2px solid rgba(255, 255, 255, 0.3);
|
||||
border-top: 2px solid white;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.translate-btn.loading .btn-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.translate-btn.loading .loading-spinner {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* 页脚 */
|
||||
.footer {
|
||||
text-align: center;
|
||||
margin-top: 30px;
|
||||
padding: 20px;
|
||||
color: #4a7c59;
|
||||
font-size: 0.9rem;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* 提示消息 */
|
||||
.toast {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
color: white;
|
||||
padding: 12px 20px;
|
||||
border-radius: 8px;
|
||||
font-size: 0.9rem;
|
||||
transform: translateX(100%);
|
||||
transition: transform 0.3s ease;
|
||||
z-index: 1000;
|
||||
box-shadow: 0 4px 12px rgba(82, 183, 136, 0.3);
|
||||
}
|
||||
|
||||
.toast.show {
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
.toast.error {
|
||||
box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
|
||||
}
|
||||
|
||||
/* 平板适配 (768px - 1024px) */
|
||||
@media (max-width: 1024px) and (min-width: 768px) {
|
||||
.container {
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 2.2rem;
|
||||
}
|
||||
|
||||
.translate-box {
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
.language-selector {
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.text-areas {
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
#input-text,
|
||||
.output-text {
|
||||
height: 180px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 手机端适配 (最大768px) */
|
||||
@media (max-width: 767px) {
|
||||
.container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
font-size: 1.8rem;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.translate-box {
|
||||
padding: 20px 15px;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.language-selector {
|
||||
flex-direction: column;
|
||||
gap: 15px;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.lang-group {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.swap-btn {
|
||||
align-self: center;
|
||||
margin-top: 0;
|
||||
order: 2;
|
||||
}
|
||||
|
||||
.text-areas {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
#input-text,
|
||||
.output-text {
|
||||
height: 150px;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.translate-btn {
|
||||
padding: 12px 30px;
|
||||
font-size: 1rem;
|
||||
width: 100%;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.toast {
|
||||
right: 10px;
|
||||
left: 10px;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
.toast.show {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 超小屏幕适配 (最大480px) */
|
||||
@media (max-width: 480px) {
|
||||
.header h1 {
|
||||
font-size: 1.6rem;
|
||||
}
|
||||
|
||||
.translate-box {
|
||||
padding: 15px 10px;
|
||||
}
|
||||
|
||||
.lang-select {
|
||||
padding: 10px 12px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
#input-text,
|
||||
.output-text {
|
||||
height: 120px;
|
||||
padding: 12px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.translate-btn {
|
||||
padding: 10px 25px;
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
}
|
||||
551
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/在线翻译支持语言列表接口.json
Normal file
551
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/在线翻译支持语言列表接口.json
Normal file
@@ -0,0 +1,551 @@
|
||||
{
|
||||
"code": 200,
|
||||
"message": "获取成功。数据来自官方/权威源头,以确保稳定与实时。开源地址 https://github.com/vikiboss/60s,反馈群 595941841",
|
||||
"data": [
|
||||
{
|
||||
"code": "sq",
|
||||
"label": "阿尔巴尼亚语",
|
||||
"alphabet": "A"
|
||||
},
|
||||
{
|
||||
"code": "ga",
|
||||
"label": "爱尔兰语",
|
||||
"alphabet": "A"
|
||||
},
|
||||
{
|
||||
"code": "et",
|
||||
"label": "爱沙尼亚语",
|
||||
"alphabet": "A"
|
||||
},
|
||||
{
|
||||
"code": "ar",
|
||||
"label": "阿拉伯语",
|
||||
"alphabet": "A"
|
||||
},
|
||||
{
|
||||
"code": "am",
|
||||
"label": "阿姆哈拉语",
|
||||
"alphabet": "A"
|
||||
},
|
||||
{
|
||||
"code": "az",
|
||||
"label": "阿塞拜疆语",
|
||||
"alphabet": "A"
|
||||
},
|
||||
{
|
||||
"code": "be",
|
||||
"label": "白俄罗斯语",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "bg",
|
||||
"label": "保加利亚语",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "eu",
|
||||
"label": "巴斯克语",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "is",
|
||||
"label": "冰岛语",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "pl",
|
||||
"label": "波兰语",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "bs-Latn",
|
||||
"label": "波斯尼亚语(拉丁语)",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "fa",
|
||||
"label": "波斯语",
|
||||
"alphabet": "B"
|
||||
},
|
||||
{
|
||||
"code": "da",
|
||||
"label": "丹麦语",
|
||||
"alphabet": "D"
|
||||
},
|
||||
{
|
||||
"code": "de",
|
||||
"label": "德语",
|
||||
"alphabet": "D"
|
||||
},
|
||||
{
|
||||
"code": "ru",
|
||||
"label": "俄语",
|
||||
"alphabet": "E"
|
||||
},
|
||||
{
|
||||
"code": "fr",
|
||||
"label": "法语",
|
||||
"alphabet": "F"
|
||||
},
|
||||
{
|
||||
"code": "tl",
|
||||
"label": "菲律宾语",
|
||||
"alphabet": "F"
|
||||
},
|
||||
{
|
||||
"code": "fi",
|
||||
"label": "芬兰语",
|
||||
"alphabet": "F"
|
||||
},
|
||||
{
|
||||
"code": "fy",
|
||||
"label": "弗里斯兰语",
|
||||
"alphabet": "F"
|
||||
},
|
||||
{
|
||||
"code": "km",
|
||||
"label": "高棉语",
|
||||
"alphabet": "G"
|
||||
},
|
||||
{
|
||||
"code": "ka",
|
||||
"label": "格鲁吉亚语",
|
||||
"alphabet": "G"
|
||||
},
|
||||
{
|
||||
"code": "gu",
|
||||
"label": "古吉拉特语",
|
||||
"alphabet": "G"
|
||||
},
|
||||
{
|
||||
"code": "ko",
|
||||
"label": "韩语",
|
||||
"alphabet": "H"
|
||||
},
|
||||
{
|
||||
"code": "ht",
|
||||
"label": "海地语",
|
||||
"alphabet": "H"
|
||||
},
|
||||
{
|
||||
"code": "ha",
|
||||
"label": "豪萨语",
|
||||
"alphabet": "H"
|
||||
},
|
||||
{
|
||||
"code": "kk",
|
||||
"label": "哈萨克语",
|
||||
"alphabet": "H"
|
||||
},
|
||||
{
|
||||
"code": "nl",
|
||||
"label": "荷兰语",
|
||||
"alphabet": "H"
|
||||
},
|
||||
{
|
||||
"code": "gl",
|
||||
"label": "加利西亚语",
|
||||
"alphabet": "J"
|
||||
},
|
||||
{
|
||||
"code": "ca",
|
||||
"label": "加泰罗尼亚语",
|
||||
"alphabet": "J"
|
||||
},
|
||||
{
|
||||
"code": "cs",
|
||||
"label": "捷克语",
|
||||
"alphabet": "J"
|
||||
},
|
||||
{
|
||||
"code": "ky",
|
||||
"label": "吉尔吉斯斯坦语",
|
||||
"alphabet": "J"
|
||||
},
|
||||
{
|
||||
"code": "kn",
|
||||
"label": "卡纳达语",
|
||||
"alphabet": "K"
|
||||
},
|
||||
{
|
||||
"code": "tlh",
|
||||
"label": "克林贡语",
|
||||
"alphabet": "K"
|
||||
},
|
||||
{
|
||||
"code": "hr",
|
||||
"label": "克罗地亚语",
|
||||
"alphabet": "K"
|
||||
},
|
||||
{
|
||||
"code": "otq",
|
||||
"label": "克洛塔罗乙巳语",
|
||||
"alphabet": "K"
|
||||
},
|
||||
{
|
||||
"code": "co",
|
||||
"label": "科西嘉语",
|
||||
"alphabet": "K"
|
||||
},
|
||||
{
|
||||
"code": "ku",
|
||||
"label": "库尔德语",
|
||||
"alphabet": "K"
|
||||
},
|
||||
{
|
||||
"code": "la",
|
||||
"label": "拉丁语",
|
||||
"alphabet": "L"
|
||||
},
|
||||
{
|
||||
"code": "lo",
|
||||
"label": "老挝语",
|
||||
"alphabet": "L"
|
||||
},
|
||||
{
|
||||
"code": "lv",
|
||||
"label": "拉脱维亚语",
|
||||
"alphabet": "L"
|
||||
},
|
||||
{
|
||||
"code": "lt",
|
||||
"label": "立陶宛语",
|
||||
"alphabet": "L"
|
||||
},
|
||||
{
|
||||
"code": "ro",
|
||||
"label": "罗马尼亚语",
|
||||
"alphabet": "L"
|
||||
},
|
||||
{
|
||||
"code": "lb",
|
||||
"label": "卢森堡语",
|
||||
"alphabet": "L"
|
||||
},
|
||||
{
|
||||
"code": "mg",
|
||||
"label": "马尔加什语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "mt",
|
||||
"label": "马耳他语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "mr",
|
||||
"label": "马拉地语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "ms",
|
||||
"label": "马来语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "ml",
|
||||
"label": "马拉雅拉姆语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "mi",
|
||||
"label": "毛利语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "mk",
|
||||
"label": "马其顿语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "mn",
|
||||
"label": "蒙古语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "bn",
|
||||
"label": "孟加拉语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "my",
|
||||
"label": "缅甸语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "mww",
|
||||
"label": "苗族昂山土语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "hmn",
|
||||
"label": "苗族语",
|
||||
"alphabet": "M"
|
||||
},
|
||||
{
|
||||
"code": "xh",
|
||||
"label": "南非科萨语",
|
||||
"alphabet": "N"
|
||||
},
|
||||
{
|
||||
"code": "zu",
|
||||
"label": "南非祖鲁语",
|
||||
"alphabet": "N"
|
||||
},
|
||||
{
|
||||
"code": "ne",
|
||||
"label": "尼泊尔语",
|
||||
"alphabet": "N"
|
||||
},
|
||||
{
|
||||
"code": "no",
|
||||
"label": "挪威语",
|
||||
"alphabet": "N"
|
||||
},
|
||||
{
|
||||
"code": "pa",
|
||||
"label": "旁遮普语",
|
||||
"alphabet": "P"
|
||||
},
|
||||
{
|
||||
"code": "ps",
|
||||
"label": "普什图语",
|
||||
"alphabet": "P"
|
||||
},
|
||||
{
|
||||
"code": "pt",
|
||||
"label": "葡萄牙语",
|
||||
"alphabet": "P"
|
||||
},
|
||||
{
|
||||
"code": "ny",
|
||||
"label": "齐切瓦语",
|
||||
"alphabet": "Q"
|
||||
},
|
||||
{
|
||||
"code": "ja",
|
||||
"label": "日语",
|
||||
"alphabet": "R"
|
||||
},
|
||||
{
|
||||
"code": "sv",
|
||||
"label": "瑞典语",
|
||||
"alphabet": "R"
|
||||
},
|
||||
{
|
||||
"code": "sr-Latn",
|
||||
"label": "塞尔维亚语(拉丁语)",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "sr-Cyrl",
|
||||
"label": "塞尔维亚语(西里尔)",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "st",
|
||||
"label": "塞索托语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "sm",
|
||||
"label": "萨摩亚语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "si",
|
||||
"label": "僧伽罗语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "eo",
|
||||
"label": "世界语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "sk",
|
||||
"label": "斯洛伐克语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "sl",
|
||||
"label": "斯洛语尼亚语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "sw",
|
||||
"label": "斯瓦希里语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "gd",
|
||||
"label": "苏格兰盖尔语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "so",
|
||||
"label": "索马里语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "ceb",
|
||||
"label": "宿务语",
|
||||
"alphabet": "S"
|
||||
},
|
||||
{
|
||||
"code": "te",
|
||||
"label": "泰卢固语",
|
||||
"alphabet": "T"
|
||||
},
|
||||
{
|
||||
"code": "ta",
|
||||
"label": "泰米尔语",
|
||||
"alphabet": "T"
|
||||
},
|
||||
{
|
||||
"code": "th",
|
||||
"label": "泰语",
|
||||
"alphabet": "T"
|
||||
},
|
||||
{
|
||||
"code": "tg",
|
||||
"label": "塔吉克语",
|
||||
"alphabet": "T"
|
||||
},
|
||||
{
|
||||
"code": "tr",
|
||||
"label": "土耳其语",
|
||||
"alphabet": "T"
|
||||
},
|
||||
{
|
||||
"code": "cy",
|
||||
"label": "威尔士语",
|
||||
"alphabet": "W"
|
||||
},
|
||||
{
|
||||
"code": "zh-lzh",
|
||||
"label": "文言文",
|
||||
"alphabet": "W"
|
||||
},
|
||||
{
|
||||
"code": "ur",
|
||||
"label": "乌尔都语",
|
||||
"alphabet": "W"
|
||||
},
|
||||
{
|
||||
"code": "uk",
|
||||
"label": "乌克兰语",
|
||||
"alphabet": "W"
|
||||
},
|
||||
{
|
||||
"code": "uz",
|
||||
"label": "乌兹别克语",
|
||||
"alphabet": "W"
|
||||
},
|
||||
{
|
||||
"code": "haw",
|
||||
"label": "夏威夷语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "es",
|
||||
"label": "西班牙语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "he",
|
||||
"label": "希伯来语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "el",
|
||||
"label": "希腊语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "sd",
|
||||
"label": "信德语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "hu",
|
||||
"label": "匈牙利语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "sn",
|
||||
"label": "修纳语",
|
||||
"alphabet": "X"
|
||||
},
|
||||
{
|
||||
"code": "en",
|
||||
"label": "英语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "hy",
|
||||
"label": "亚美尼亚语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "ig",
|
||||
"label": "伊博语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "it",
|
||||
"label": "意大利语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "yi",
|
||||
"label": "意第绪语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "hi",
|
||||
"label": "印地语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "id",
|
||||
"label": "印度尼西亚语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "su",
|
||||
"label": "印尼巽他语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "jw",
|
||||
"label": "印尼爪哇语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "yua",
|
||||
"label": "尤卡坦玛雅语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "yo",
|
||||
"label": "约鲁巴语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "vi",
|
||||
"label": "越南语",
|
||||
"alphabet": "Y"
|
||||
},
|
||||
{
|
||||
"code": "zh-CHS",
|
||||
"label": "中文",
|
||||
"alphabet": "Z"
|
||||
},
|
||||
{
|
||||
"code": "zh-CHT",
|
||||
"label": "中文(繁体)",
|
||||
"alphabet": "Z"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/返回接口.json
Normal file
1
InfoGenie-frontend/public/60sapi/实用功能/在线翻译/返回接口.json
Normal file
@@ -0,0 +1 @@
|
||||
{"code":200,"message":"所有数据均来自官方,确保稳定与实时,用户群: 595941841,开源地址: https://github.com/vikiboss/60s","data":{"source":{"text":"こんにちは","type":"ja","type_desc":"日语","pronounce":"Konnitiha"},"target":{"text":"你好","type":"zh-CHS","type_desc":"中文","pronounce":"nĭhăo"}}}
|
||||
Reference in New Issue
Block a user