287 lines
11 KiB
TypeScript
287 lines
11 KiB
TypeScript
import { createI18n } from 'vue-i18n'
|
||
|
||
const zh = {
|
||
errorOccurred: '发生了个错误',
|
||
logoutSuccess: '登出成功',
|
||
useThumbnailPreview: '使用缩略图预览',
|
||
pollingInterval: '轮询间隔',
|
||
smallerIntervalMeansMoreNetworkTraffic: '越小对网络压力越大',
|
||
gridThumbnailWidth: '网格缩略图宽度',
|
||
largeGridThumbnailWidth: '大尺寸网格缩略图宽度',
|
||
pause: '暂停',
|
||
start: '开始',
|
||
waitingUploadCount: '等待上传数量',
|
||
uploadFailureCount: '上传失败数量',
|
||
completedCount: '已完成数量',
|
||
realTimeLog: '实时日志',
|
||
tip: '提示',
|
||
clickToViewLogs:
|
||
'点击下面查看具体日志,若有日志错误内包含名字不合规,可尝试在sd-webui的设置页换一种图像文件名格式,例如[datetime<%Y-%m-%d %H-%M-%S>]',
|
||
startedAt: '开始于:',
|
||
sortByDateAscending: '修改日期升序',
|
||
sortByDateDescending: '修改日期降序',
|
||
sortByCreatedDateAscending: '创建日期升序',
|
||
sortByCreatedDateDescending: '创建日期降序',
|
||
sortByNameAscending: '名称升序',
|
||
sortByNameDescending: '名称降序',
|
||
sortBySizeAscending: '大小升序',
|
||
sortBySizeDescending: '大小降序',
|
||
inputAddressAndPressEnter: '输入地址回车',
|
||
go: '前往',
|
||
unknownError: '未知错误',
|
||
loadingNextFolder: '即将加载下一个文件夹的文件',
|
||
moveFailedCheckPath: '移动失败,检查你的路径输入',
|
||
detailList: '详情列表',
|
||
previewGrid: '预览网格',
|
||
largePreviewGrid: '大尺寸预览网格',
|
||
sortBy: '按照',
|
||
moveSelectedFilesTo: '下列文件移动至',
|
||
confirm: '确定?',
|
||
upload: '上传',
|
||
download: '下载',
|
||
local: '本地',
|
||
confirmCreateTask: '确定创建{type}任务。{more}',
|
||
sendImageFailed: '发送图像失败,请携带console的错误消息找开发者',
|
||
confirmDelete: '确认删除?',
|
||
deleteSuccess: '删除成功',
|
||
doubleClickToCopy: '双击复制',
|
||
root: '根',
|
||
drive: '盘',
|
||
refresh: '刷新',
|
||
quickMove: '快速移动',
|
||
more: '更多',
|
||
viewMode: '查看模式',
|
||
sortingMethod: '排序方法',
|
||
copyPath: '复制路径',
|
||
deleteSelected: '删除选中',
|
||
previewInNewWindow: '在新窗口预览(如果浏览器处理不了会下载,大文件的话谨慎)',
|
||
downloadDirectly: '直接下载(大文件的话谨慎)',
|
||
copySourceFilePreviewLink: '复制源文件预览链接',
|
||
viewGenerationInfo: '查看生成信息(prompt等)',
|
||
sendToTxt2img: '发送到文生图',
|
||
sendToImg2img: '发送到图生图',
|
||
sendToInpaint: '发送到局部重绘',
|
||
sendToExtraFeatures: '发送到附加功能',
|
||
loadNextPage: '加载下一页',
|
||
autoUpload: '自动上传',
|
||
localFile: '本地文件',
|
||
taskRecord: '任务记录',
|
||
globalSettings: '全局设置',
|
||
welcome: '欢迎',
|
||
openInNewWindow: '在新页面打开',
|
||
restoreLastRecord: '还原上次记录',
|
||
launch: '启动',
|
||
walkMode: '使用 Walk 模式浏览图片',
|
||
launchFromQuickMove: '从快速移动启动',
|
||
recent: '最近',
|
||
emptyStartPage: '空启动页',
|
||
deleteNotAllowedWithOnePaneLeft: '在仅剩一个pane的情况下,不允许删除!!!',
|
||
t2i: '文生图',
|
||
i2i: '图生图',
|
||
saveButtonSavesTo: '使用“保存”按钮保存图像的目录',
|
||
extra: '附加',
|
||
gridImage: '宫格图',
|
||
'i2i-grid': '图生图网格',
|
||
image: '图像',
|
||
't2i-grid': '文生图宫格',
|
||
workingFolder: '工作文件夹',
|
||
lang: '语言',
|
||
langChangeReload: '重新加载: 一些变化可能需要在重新加载后生效',
|
||
hypernetworks: '超网络模型',
|
||
openOnTheRight: '在右边打开',
|
||
openInNewTab: '在新标签打开',
|
||
openWithWalkMode: '使用 Walk 模式打开',
|
||
longPressOpenContextMenu: '支持使用长按打开右键菜单',
|
||
searchResults: '搜索结果',
|
||
imgSearch: '图像搜索',
|
||
onlyFoldersAndImages: '只显示文件夹和图像',
|
||
send2savedDir: '发送到保存的文件夹',
|
||
unknownSavedDir: '找不到保存的文件夹(配置文件中的outdir_save字段)',
|
||
Model: '模型',
|
||
Sampler: '采样器',
|
||
lora: 'LoRA',
|
||
size: '尺寸',
|
||
pos: '正面提示',
|
||
generateIndexHint: '生成索引用于搜索图像',
|
||
UpdateIndex: '更新索引',
|
||
needGenerateIdx: '你需要先点击按钮生成索引用于搜索图像\n这个过程可能需要消耗几分钟',
|
||
search: '搜索',
|
||
custom: '自定义',
|
||
add: '新增',
|
||
cancel: '取消',
|
||
submit: '提交',
|
||
embedding: 'embedding',
|
||
existInOtherType: '已存在于其他类型',
|
||
alreadyExists: '已存在',
|
||
toggleTag: '切换标签选中 (收藏)',
|
||
addComplete: '添加完成',
|
||
removeComplete: '删除完成',
|
||
addedTagToImage: '已添加标签到本图片',
|
||
removedTagFromImage: '已从本图片上移除该标签',
|
||
openContextMenu: '打开上下文菜单',
|
||
copyPrompt: '复制提示',
|
||
"refreshCompleted": "刷新完成",
|
||
"walk-mode-move-message": "在walk模式下仅允许使用“快速移动”移动位置",
|
||
"long_loading": "已经连续加载超过5秒,如果你认为不是网络问题的话,请尝试关掉VPN或者添加启动参数 --no-gradio-queue。如果还是不行,请提Issue。",
|
||
"manualExitFullScreen": "你删除了最后一张图片,也许需要你手动退出全屏预览",
|
||
"copied": "已复制!",
|
||
"index.expired": "索引过期,正在自动更新",
|
||
"auto.refreshed": "自动刷新完成!"
|
||
}
|
||
const en: Record<keyof typeof zh, string> = {
|
||
"auto.refreshed": "Auto refresh completed!",
|
||
copied: "Copied!",
|
||
"index.expired": "Index expired, updating automatically",
|
||
"manualExitFullScreen": "You have deleted the last image and may need to manually exit full-screen preview",
|
||
"long_loading": "Loading has been continuing for more than 5 seconds. If you don't think it's a network issue, please try turning off your VPN or adding the startup parameter --no-gradio-queue. If it still doesn't work, please submit an issue.",
|
||
"walk-mode-move-message": "Moving position is only allowed using 'Quick Move' in walk mode",
|
||
"refreshCompleted": "Refresh completed",
|
||
addedTagToImage: 'Tag has been added to this image',
|
||
removedTagFromImage: 'Tag has been removed from this image',
|
||
openContextMenu: 'Open context menu',
|
||
copyPrompt: 'Copy prompt',
|
||
toggleTag: 'Toggle Tag Selection (Favorite)',
|
||
addComplete: 'Add complete',
|
||
removeComplete: 'Remove Complete',
|
||
existInOtherType: 'Already exists in other type',
|
||
alreadyExists: 'Already exists',
|
||
embedding: 'embedding',
|
||
cancel: 'Cancel',
|
||
submit: 'Submit',
|
||
add: 'Add',
|
||
custom: 'Custom',
|
||
needGenerateIdx:
|
||
'You need to click the button to generate an index for searching images. \n This process may take a few minutes to complete.',
|
||
search: 'Search',
|
||
UpdateIndex: 'Update index',
|
||
generateIndexHint: 'Generate index for search image',
|
||
Model: 'Model',
|
||
Sampler: 'Sampler',
|
||
lora: 'LoRA',
|
||
size: 'Size',
|
||
pos: 'Positive Prompt',
|
||
unknownSavedDir: `Cannot find the saved folder (outdir_save field in the config)`,
|
||
errorOccurred: 'An error occurred',
|
||
logoutSuccess: 'Logged out successfully',
|
||
useThumbnailPreview: 'Use thumbnail preview',
|
||
pollingInterval: 'Polling interval',
|
||
smallerIntervalMeansMoreNetworkTraffic: 'Smaller interval means more network traffic',
|
||
gridThumbnailWidth: 'Grid thumbnail width',
|
||
largeGridThumbnailWidth: 'Large grid thumbnail width',
|
||
pause: 'Pause',
|
||
start: 'Start',
|
||
waitingUploadCount: 'Waiting upload count',
|
||
uploadFailureCount: 'Upload failure count',
|
||
completedCount: 'Completed count',
|
||
realTimeLog: 'Real-time log',
|
||
tip: 'Tip',
|
||
clickToViewLogs:
|
||
'Click below to view specific logs. If there are naming errors, try changing the image filename format on the sd-webui settings page, such as [datetime<%Y-%m-%d %H-%M-%S>]',
|
||
startedAt: 'Started at: ',
|
||
sortByDateAscending: 'Updated date ascending',
|
||
sortByDateDescending: 'UPdated date descending',
|
||
sortByCreatedDateAscending: 'Created date ascending',
|
||
sortByCreatedDateDescending: 'Created date descending',
|
||
sortByNameAscending: 'Name ascending',
|
||
sortByNameDescending: 'Name descending',
|
||
sortBySizeAscending: 'Size ascending',
|
||
sortBySizeDescending: 'Size descending',
|
||
inputAddressAndPressEnter: 'Input address and press Enter',
|
||
go: 'Go',
|
||
unknownError: 'Unknown error',
|
||
loadingNextFolder: 'Loading files from the next folder',
|
||
moveFailedCheckPath: 'Move failed. Check your path input.',
|
||
detailList: 'Detail list',
|
||
previewGrid: 'Preview grid',
|
||
largePreviewGrid: 'Large preview grid',
|
||
sortBy: 'Sort by',
|
||
moveSelectedFilesTo: 'Move selected files to',
|
||
confirm: 'Confirm?',
|
||
upload: 'Upload',
|
||
download: 'Download',
|
||
local: 'Local',
|
||
confirmCreateTask: 'Confirm to create {type} task. {more}',
|
||
sendImageFailed:
|
||
'Failed to send image. Please contact the developer with the error message from the console.',
|
||
confirmDelete: 'Are you sure you want to delete?',
|
||
deleteSuccess: 'Deleted successfully',
|
||
doubleClickToCopy: 'Double-click to copy',
|
||
root: 'Root',
|
||
drive: ' drive',
|
||
refresh: 'Refresh',
|
||
quickMove: 'Quick move',
|
||
more: 'More',
|
||
viewMode: 'View mode',
|
||
sortingMethod: 'Sorting method',
|
||
copyPath: 'Copy path',
|
||
deleteSelected: 'Delete selected',
|
||
previewInNewWindow:
|
||
'Open in new window (will download if browser cannot handle it, use with caution for large files)',
|
||
downloadDirectly: 'Download directly (use with caution for large files)',
|
||
copySourceFilePreviewLink: 'Copy source file preview link',
|
||
viewGenerationInfo: 'View generation information (prompt, etc.)',
|
||
sendToTxt2img: 'Send to txt2img',
|
||
sendToImg2img: 'Send to img2img',
|
||
sendToInpaint: 'Send to Inpaint',
|
||
sendToExtraFeatures: 'Send to Extra',
|
||
loadNextPage: 'Load next page',
|
||
autoUpload: 'Auto upload',
|
||
localFile: 'Local file',
|
||
taskRecord: 'Task record',
|
||
globalSettings: 'Global settings',
|
||
welcome: 'Welcome',
|
||
openInNewWindow: 'Open in new tab',
|
||
restoreLastRecord: 'Restore last record',
|
||
launch: 'Launch',
|
||
walkMode: 'Use Walk mode to browse images',
|
||
launchFromQuickMove: 'Launch from Quick Move',
|
||
recent: 'Recent',
|
||
emptyStartPage: 'Empty start page',
|
||
deleteNotAllowedWithOnePaneLeft: 'Deletion is not allowed with only one pane left!!!',
|
||
t2i: 'txt2img',
|
||
i2i: 'img2img',
|
||
saveButtonSavesTo: 'save',
|
||
extra: 'extras',
|
||
gridImage: 'Grid image',
|
||
'i2i-grid': 'img2img grid',
|
||
image: 'Image',
|
||
't2i-grid': 'txt2img grid',
|
||
workingFolder: 'working folder',
|
||
lang: 'Language',
|
||
langChangeReload: 'Reload: Some changes may require a reload to take effect',
|
||
hypernetworks: 'hypernetworks',
|
||
openOnTheRight: 'Open on the right',
|
||
openInNewTab: 'Open in a new tab',
|
||
openWithWalkMode: 'Open with Walk Mode',
|
||
longPressOpenContextMenu: 'Support long press to open right-click menu',
|
||
searchResults: 'Search Results',
|
||
imgSearch: 'Image Search',
|
||
onlyFoldersAndImages: 'Only show folders and images',
|
||
send2savedDir: 'Send to saved folder'
|
||
}
|
||
declare module 'vue' {
|
||
export interface ComponentCustomProperties {
|
||
$t (key: keyof typeof zh, ...args: []): string
|
||
}
|
||
}
|
||
|
||
export const getPreferredLang = () => {
|
||
const lang = navigator.language.toLowerCase()
|
||
if (lang.includes('zh') || lang.includes('cn')) {
|
||
return 'zh'
|
||
}
|
||
return 'en'
|
||
}
|
||
|
||
export const i18n = createI18n({
|
||
locale: getPreferredLang(),
|
||
fallbackLocale: 'en',
|
||
messages: {
|
||
zh,
|
||
en
|
||
},
|
||
legacy: false
|
||
})
|
||
|
||
export const { t, locale } = i18n.global
|