增加提示词
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
- 多语言与数据来源
|
- 多语言与数据来源
|
||||||
- 默认数据结构由 `public/sd/default.yaml` 提供
|
- 默认数据结构由 `public/sd/default.yaml` 提供
|
||||||
- 可加载 `zh_CN.yaml`、`es_ES.yaml` 翻译并自动合并到词库
|
- 可加载 `zh_CN.yaml` 翻译并自动合并到词库
|
||||||
- 未映射项高亮,右侧映射面板可直接补充翻译
|
- 未映射项高亮,右侧映射面板可直接补充翻译
|
||||||
|
|
||||||
- 持久化与兼容性
|
- 持久化与兼容性
|
||||||
|
|||||||
+2
-3
@@ -29,7 +29,6 @@
|
|||||||
<meta property="og:site_name" content="提示词编辑器" />
|
<meta property="og:site_name" content="提示词编辑器" />
|
||||||
<meta property="og:locale" content="zh_CN" />
|
<meta property="og:locale" content="zh_CN" />
|
||||||
<meta property="og:locale:alternate" content="en_US" />
|
<meta property="og:locale:alternate" content="en_US" />
|
||||||
<meta property="og:locale:alternate" content="es_ES" />
|
|
||||||
<meta property="og:image" content="https://prompt.sywb.top/preview.png" />
|
<meta property="og:image" content="https://prompt.sywb.top/preview.png" />
|
||||||
<meta property="og:image:alt" content="首页预览" />
|
<meta property="og:image:alt" content="首页预览" />
|
||||||
<meta property="og:image" content="https://sywb.top/Staticfiles/preview.png" />
|
<meta property="og:image" content="https://sywb.top/Staticfiles/preview.png" />
|
||||||
@@ -51,7 +50,7 @@
|
|||||||
"url": "https://prompt.sywb.top/",
|
"url": "https://prompt.sywb.top/",
|
||||||
"applicationCategory": "Productivity",
|
"applicationCategory": "Productivity",
|
||||||
"operatingSystem": "Web",
|
"operatingSystem": "Web",
|
||||||
"inLanguage": ["zh-CN", "en", "es-ES"],
|
"inLanguage": ["zh-CN", "en"],
|
||||||
"description": "用于编辑、管理与翻译 AI 提示词的轻量工具,支持多语言映射、预设保存与搜索、文件夹分类与拖拽排序、智能补全、导入导出与浏览器本地持久化。",
|
"description": "用于编辑、管理与翻译 AI 提示词的轻量工具,支持多语言映射、预设保存与搜索、文件夹分类与拖拽排序、智能补全、导入导出与浏览器本地持久化。",
|
||||||
"image": {
|
"image": {
|
||||||
"@type": "ImageObject",
|
"@type": "ImageObject",
|
||||||
@@ -123,7 +122,7 @@
|
|||||||
"name": "是否支持多语言与翻译映射?",
|
"name": "是否支持多语言与翻译映射?",
|
||||||
"acceptedAnswer": {
|
"acceptedAnswer": {
|
||||||
"@type": "Answer",
|
"@type": "Answer",
|
||||||
"text": "内置默认数据并可加载 zh_CN 与 es_ES 的 YAML 译文,右侧映射面板支持未映射项高亮与直接添加翻译。"
|
"text": "内置默认数据并可加载 zh_CN 的 YAML 译文,右侧映射面板支持未映射项高亮与直接添加翻译。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+11663
-188
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+9827
-266
File diff suppressed because it is too large
Load Diff
@@ -536,7 +536,8 @@ export const usePromptStore = defineStore('promptStore', {
|
|||||||
} else {
|
} else {
|
||||||
let changed = false;
|
let changed = false;
|
||||||
const change: { key: string; translation?: Partial<Record<LangCode, string>>; hidden?: boolean } = { key };
|
const change: { key: string; translation?: Partial<Record<LangCode, string>>; hidden?: boolean } = { key };
|
||||||
for (const l of ['en', 'zh_CN', 'es_ES'] as LangCode[]) {
|
const langs = Array.from(new Set([...(base.languages || []), ...(cur.languages || [])]));
|
||||||
|
for (const l of langs as LangCode[]) {
|
||||||
const a = baseTag.translation?.[l] ?? '';
|
const a = baseTag.translation?.[l] ?? '';
|
||||||
const b = curTag.translation?.[l] ?? '';
|
const b = curTag.translation?.[l] ?? '';
|
||||||
if (a !== b) {
|
if (a !== b) {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
export type LangCode = 'en' | 'zh_CN' | 'es_ES';
|
export type LangCode = 'en' | 'zh_CN';
|
||||||
|
|
||||||
export interface PromptTag {
|
export interface PromptTag {
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
@@ -92,15 +92,5 @@ export async function loadInitialDataset(): Promise<PromptDataset> {
|
|||||||
console.warn('zh_CN.yaml not found or invalid', err);
|
console.warn('zh_CN.yaml not found or invalid', err);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
const esRoot = await fetchYaml('/sd/es_ES.yaml');
|
|
||||||
const esMap = collectTranslations(esRoot);
|
|
||||||
mergeLanguage(dataset, esMap, 'es_ES');
|
|
||||||
if (!dataset.languages.includes('es_ES')) dataset.languages.push('es_ES');
|
|
||||||
} catch (err) {
|
|
||||||
// ignore if missing
|
|
||||||
console.warn('es_ES.yaml not found or invalid', err);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dataset;
|
return dataset;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user