Add Traditional Chinese prompts converted from Simplified Chinese version

This commit is contained in:
Peter Dave Hello
2024-07-13 15:38:39 +08:00
parent 8e4d26163a
commit 238d3122c4
3 changed files with 523 additions and 7 deletions

View File

@@ -154,7 +154,7 @@ export const usePromptStore = createPersistStore(
fetch(PROMPT_URL)
.then((res) => res.json())
.then((res) => {
let fetchPrompts = [res.en, res.cn];
let fetchPrompts = [res.en, res.tw, res.cn];
if (getLang() === "cn") {
fetchPrompts = fetchPrompts.reverse();
}
@@ -175,7 +175,8 @@ export const usePromptStore = createPersistStore(
const allPromptsForSearch = builtinPrompts
.reduce((pre, cur) => pre.concat(cur), [])
.filter((v) => !!v.title && !!v.content);
SearchService.count.builtin = res.en.length + res.cn.length;
SearchService.count.builtin =
res.en.length + res.cn.length + res.tw.length;
SearchService.init(allPromptsForSearch, userPrompts);
});
},