Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@

register("en", () => import("./i18n/en"));
register("es", () => import("./i18n/es"));
register("cn", () => import("./i18n/cn"));

init({
fallbackLocale: "en",
Expand Down
11 changes: 9 additions & 2 deletions src/data/SmartQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { Song } from "src/App";
import { get } from "svelte/store";
import { db } from "./db";
import { query } from "./store";
import { LL } from "../i18n/i18n-svelte";

function allTracks(): Collection<Song, IndexableType> {
// Not including title, because title is always populated with filename,
Expand Down Expand Up @@ -66,18 +67,24 @@ export async function findQuery(queryId: string) {
found = (await db.smartQueries.get(id)) ?? null;
}
}

// If it's a built-in query, resolve the name function to get the translated text
if (found && typeof found.name === 'function') {
found = { ...found, name: found.name() };
}

console.log("found", found);
return found;
}

const BUILT_IN_QUERIES = {
favourites: {
name: "Favourites",
name: () => get(LL).smartPlaylists.builtIn.favourites(),
value: "favourites",
run: favourites,
},
recentlyAdded: {
name: "Recently Added",
name: () => get(LL).smartPlaylists.builtIn.recentlyAdded(),
value: "recentlyAdded",
run: recentlyAdded,
},
Expand Down
353 changes: 353 additions & 0 deletions src/i18n/cn/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,353 @@
import type { BaseTranslation } from "../i18n-types";

const cn = {
infoPopup: {
builtBy: "Built by",
andContributors: "and contributors",
version: "版本",
releaseNotes: "更新说明",
},
sidebar: {
search: "搜索",
library: "音乐库",
albums: "专辑",
favorites: "喜爱的歌曲",
toDelete: "To Delete",
playlists: "播放列表",
smartPlaylists: "智能列表",
artistsToolkit: "艺术家工具箱",
map: "地图",
internetArchive: "互联网档案馆",
stats: "统计",
openWikiTooltip: "打开 {artist} 的维基页面",
addMetadataHint: "添加元数据",
takeControl: "Take control of your library",
iaMode: "主播放器在互联网档案馆模式下已关闭<br /><br />停止播放以重新启用",
},
library: {
fields: {
title: "标题",
artist: "艺术家",
composer: "作曲家",
album: "专辑",
albumArtist: "专辑艺术家",
track: "音轨",
compilation: "汇编",
year: "年份",
dateAdded: "添加日期",
genre: "风格",
origin: "源",
duration: "时长",
tags: "标签",
},
resetToFileOrder: "重置文件顺序",
orderHint: "展示文件顺序",
orderHintTemp: "显示临时顺序",
orderDisabledHint: "切换到文件顺序以重新排序曲目",
queryNoResultsPlaceholder: '没有找到与 "{query}" 相关的结果',
},
bottomBar: {
queue: "队列",
lyrics: "歌词",
lossySelector: {
lossy: "lossy",
lossless: "lossless",
both: "lossy + lossless",
},
waveform: "波形图",
nextUp: "即将播放",
stats: {
songs: "歌曲",
artists: "艺术家",
albums: "专辑",
},
},
smartPlaylists: {
builtIn: {
recentlyAdded: "最近添加",
favourites: "喜爱的歌曲",
},
builder: {
close: "关闭编辑器",
save: "保存",
placeholder: "我的智能播放列表",
addNewBlock: "新增条件块",
valid: "查询有效",
invalid: "查询无效",
parts: {
byAlbumArtist: {
title: "按专辑艺人",
example: "eg. 专辑艺人 Charlie Parker",
},
byArtist: {
title: "按艺人",
example: "eg. 艺人 Charlie Parker",
},
releasedBetween: {
title: "发行时间介于...",
example: "eg. 发行时间介于 1950 和 1967",
},
releasedAfter: {
title: "发行于...之后",
example: "eg. 发行于 1950 之后",
},
releasedIn: {
title: "发行年份",
example: "eg. 发行于 1999 年",
},
titleContains: {
title: "歌曲标题包含...",
example: " eg. 标题包含 Love",
},
longerThan: {
title: "时长大于...",
example: "eg. 时长大于 04:00",
},
containsGenre: {
title: "包含流派",
example: "eg. 流派包含 Rock",
},
fromCountry: {
title: "来自国家/地区",
example: "eg. 国家/地区 Australia",
},
byComposer: {
title: "按作曲家",
example: "eg. 作曲家 Charles Mingus",
},
containsTag: {
title: "包含标签",
example: "eg. 标签包含 love",
},
},
},
editSmartPlaylist: "编辑智能列表",
newSmartPlaylist: "新建智能列表",
libraryPlaceholder: {
title: "智能播放列表结果将在这显示",
subtitle: "乐搜!",
},
},
trackInfo: {
title: "音轨信息",
subtitle: "使用 UP 或 DOWN 切换音轨",
overwriteFile: "覆写文件",
fileInfo: "文件信息",
file: "文件",
codec: "Codec",
tagType: "标签类型",
duration: "时长",
sampleRate: "采样率",
bitRate: "比特率",
enrichmentCenter: "拓展中心",
countryOfOrigin: "国家来源",
countryOfOriginTooltip:
"设置此项可在智能播放列表中使用地图视图并按国家/地区筛选。",
fetchingOriginCountry: "加载中...",
save: "保存",
fetchFromWikipedia: "从维基百科获取",
artworkReadyToSave: "准备保存",
artworkFound: "找到",
noArtwork: "没有作品",
artworkTooltip: "粘贴图片或点此选择文件",
fetchArt: "获取艺术",
metadata: "元数据",
tools: "工具",
aboutArtwork: "关于作品",
artworkTooltipTitle: "🎨 作品优先级",
artworkTooltipBody:
"<h3 style='margin:0'>🎨 封面图优先级</h3><br/>首先,Musicat 会查找文件元数据中编码的封面图,您可以通过点击此方框覆盖元数据(支持 png 和 jpg 格式)。<br/><br/>如果没有找到封面图,它会在专辑文件夹中查找名为 <i>cover.jpg, folder.jpg</i> 或 <i>artwork.jpg</i> (您可以在“设置”中更改此文件名列表)。<br/><br/>否则,它会在专辑文件夹中查找并使用该图像。",
encodedInFile: "写入元数据",
bit: "比特",
noMetadata: "歌曲没有元数据",
unsupportedFormat:
"目前尚不支持查看/编辑此文件类型的元数据。",
fix: "修复",
errors: {
nullChars:
"有些标签包含隐藏字符,导致无法正确读取。",
},
artist: "艺术家",
fixLegacyEncodings: {
title: "修复旧版编码",
body: "如果您有使用旧版编码的 ID3 标签,请将其更新为通用的 UTF-8 编码,以便正确显示。选择编码并单击“修复”。",
hint: "选择编码方式...",
},
setTitleFromFileNameHint: "点击即可从文件名设置标题",
differentTagTypes:
"选择具有不同标签类型的歌曲时,不支持修改元数据",
},
settings: {
title: "设置",
library: "音乐库",
audio: "音频",
outputDevice: "输出设备",
followSystem: "跟随系统",
interface: "界面",
miniPlayerLocation: "迷你播放器位置",
language: "语言",
theme: "主题",
features: "功能",
subtitle: "配置内容",
version: "版本",
commaSeparatedFilenames: "文件名",
llms: "gpt-3.5-turbo, gpt-4, ollama",
foldersToWatch: "关注的文件夹",
folder: "{{1 文件夹 | ?? 文件夹}}",
importing: "导入中..",
coverArtFilenames: "封面图文件名",
enableArtistsToolkit: "启用艺术家工具包",
import: "导入",
enableCoverArtCheck: "启用封面图检查",
songbookLocation: "音乐珍藏册位置",
scrapbookLocation: "音乐剪贴簿位置",
downloadLocation: "下载目录",
generatedStemsLocation: "生成的分轨位置",
playlistsLocation: "播放列表目录",
enableAIFeatures: "启用AI功能",
aiModel: "AI模型 (LLM)",
openApiKey: "OpenAI API Key",
geniusApiKey: "Genius API Key",
discogsApiKey: "Discogs API Key",
},
wiki: {
inArticle: "从您的曲库中找到相关内容:",
clickHint: "点击滚动查看详情",
albums: "专辑",
songs: "曲目",
artists: "艺术家",
},
tagCloud: {
close: "关闭标签",
},
artistsToolkit: {
header: {
songbookLocationHint:
"您的音乐珍藏册位置由 Musicat 管理,当前位置为 {path}",
songbookLocationHintEmpty:
"请设置需要让 Musicat 管理的音乐珍藏册。",
showScrapbook: "展示音乐剪贴簿",
hideScrapbook: "隐藏音乐剪贴簿",
},
scrapbook: {
title: "音乐剪贴簿",
setupHint: "请在设置内添加您的音乐剪贴簿位置",
notFoundError: "无法找到音乐剪贴簿位置",
openSettings: "打开曲目",
openInFinder: "通过 Finder 打开",
},
songDetails: {
tabs: {
lyrics: "歌词 & 和弦",
files: "文件",
other: "其他",
},
lyricsEditor: {
options: {
alignFirstChord: "对齐首个和弦",
},
},
},
},
button: {
areYouSure: "再次点击确认",
},
input: {
enterHintTooltip: "按 Enter 键自动完成",
},
albums: {
title: "专辑",
options: {
orderBy: "排序方式",
orderByFields: {
title: "曲名",
artist: "艺术家",
year: "年份",
},
showSingles: "单曲",
showInfo: "信息",
gridSize: "卡片大小",
},
scrollToNowPlaying: "定位到当前播放",
item: {
tracksLabel: "音轨",
},
},
albumMenu: {
reImportAlbum: "重新导入专辑",
enrich: "⚡️ 补全",
originCountry: "来源国家",
originCountryC: "来源国家 ✅",
originCountryHint: "通过维基百科搜索",
fetchArtwork: "通过 Wikipedia 搜刮专辑图片",
fetchArtworkHint: "通过维基百科搜索",
fetchFromWikipedia: "从维基百科获取中...",
scanExistingArtwork: "本地获取专辑图片",
scanningExistingArtwork: "正在本地搜索...",
scanExistingArtworkHint: "从本地专辑文件夹中搜索专辑图片",
searchFromBrave: "通过 Brave 搜索专辑图片",
wikiPanel: "维基页面:",
removeFromLibrary: "从音乐库移除专辑",
openInFileManager: "通过 {explorerName} 打开",
infoMetadata: "信息 & 元数据"
},
trackMenu: {
// In library
reImportTrack: "重新导入歌曲",
reImportTracks: "重新导入 {n} 个歌曲",
reImportTrackHint: "包括专辑",
separateTitle: "分轨(点击播放)",
separateStems: "音轨分离",
editTag: "编辑标签",
enrich: "⚡️ 补全",
lookingOnline: "在线查找...",
wikiPanel: "维基页面:",
removeFromLibrary: "从音乐库移除 {{ | ?? }} 首歌曲",
deleteFile: "删除 {{ | ?? }} 个文件",
deleteFileHint: "移动到系统垃圾 / 回收站",
// In queue
moreTools: "更多工具",
unselectAll: "取消选择",
removeTrackFromQueue: "从队列中移除歌曲",
removeTracksFromQueue: "从队列中移除多首歌曲",
// Both library & queue
originCountry: "来源国家",
originCountryC: "来源国家 ✅",
originCountryHint: "通过维基百科搜索",
openInFileManager: "通过 {explorerName} 打开",
infoMetadata: "信息 & 元数据"
},
toolsMenu: {
enrich: "⚡️ 补全",
lookingOnline: "在线查找...",
originCountry: "来源国家",
originCountryC: "来源国家 ✅",
originCountryHint: "通过维基百科搜索",
chords: "和弦:",
lyrics: "歌词:",
wikiPanel: "维基页面:",
},
toDelete: {
title: "已删除",
description: "从修剪模式中删除的曲目",
keepAllBtn: "保留全部",
deleteAllBtn: "全部移到垃圾桶",
notification: {
deleting: "正在删除 {{ | ?? 首}} 歌曲",
deleted: "已删除 {{ | ?? 首}} 歌曲",
},
},
lyrics: {
autoScroll: "自动滚动",
},
stemSeparation: {
loading: "分离人声和乐器……",
complete: "分离成功",
error: "错误: {{error}}",
showStems: "显示分轨",
cancel: "取消",
close: "关闭",
},
} satisfies BaseTranslation;

export default cn;
Loading