增加提示词
This commit is contained in:
@@ -536,7 +536,8 @@ export const usePromptStore = defineStore('promptStore', {
|
||||
} else {
|
||||
let changed = false;
|
||||
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 b = curTag.translation?.[l] ?? '';
|
||||
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 {
|
||||
key: string;
|
||||
|
||||
@@ -92,15 +92,5 @@ export async function loadInitialDataset(): Promise<PromptDataset> {
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user