mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
move translation strings for AI Chat Note type
This commit is contained in:
parent
c046343349
commit
29845c343c
@ -1879,6 +1879,12 @@
|
|||||||
"sources": "Sources",
|
"sources": "Sources",
|
||||||
"start_indexing": "Start Indexing",
|
"start_indexing": "Start Indexing",
|
||||||
"use_advanced_context": "Use Advanced Context",
|
"use_advanced_context": "Use Advanced Context",
|
||||||
|
"chat": {
|
||||||
|
"root_note_title": "AI Chats",
|
||||||
|
"root_note_content": "This note contains your saved AI chat conversations.",
|
||||||
|
"new_chat_title": "New Chat",
|
||||||
|
"create_new_ai_chat": "Create new AI Chat"
|
||||||
|
},
|
||||||
"processing": {
|
"processing": {
|
||||||
"common": "Processing...",
|
"common": "Processing...",
|
||||||
"thinking": "Thinking...",
|
"thinking": "Thinking...",
|
||||||
|
@ -2,6 +2,7 @@ import notes from '../notes.js';
|
|||||||
import sql from '../sql.js';
|
import sql from '../sql.js';
|
||||||
import attributes from '../attributes.js';
|
import attributes from '../attributes.js';
|
||||||
import type { Message } from './ai_interface.js';
|
import type { Message } from './ai_interface.js';
|
||||||
|
import { t } from 'i18next';
|
||||||
|
|
||||||
interface StoredChat {
|
interface StoredChat {
|
||||||
id: string;
|
id: string;
|
||||||
@ -38,9 +39,9 @@ export class ChatStorageService {
|
|||||||
// Create root note for chats
|
// Create root note for chats
|
||||||
const { note } = notes.createNewNote({
|
const { note } = notes.createNewNote({
|
||||||
parentNoteId: 'root',
|
parentNoteId: 'root',
|
||||||
title: 'AI Chats',
|
title: t('ai.chat.root_note_title'),
|
||||||
type: 'text',
|
type: 'text',
|
||||||
content: 'This note contains your saved AI chat conversations.'
|
content: t('ai.chat.root_note_content')
|
||||||
});
|
});
|
||||||
|
|
||||||
attributes.createLabel(
|
attributes.createLabel(
|
||||||
@ -61,7 +62,7 @@ export class ChatStorageService {
|
|||||||
|
|
||||||
const { note } = notes.createNewNote({
|
const { note } = notes.createNewNote({
|
||||||
parentNoteId: rootNoteId,
|
parentNoteId: rootNoteId,
|
||||||
title: title || 'New Chat ' + now.toLocaleString(),
|
title: title || t('ai.chat.new_chat_title') + ' ' + now.toLocaleString(),
|
||||||
type: ChatStorageService.CHAT_TYPE,
|
type: ChatStorageService.CHAT_TYPE,
|
||||||
mime: ChatStorageService.CHAT_MIME,
|
mime: ChatStorageService.CHAT_MIME,
|
||||||
content: JSON.stringify({
|
content: JSON.stringify({
|
||||||
@ -79,7 +80,7 @@ export class ChatStorageService {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: note.noteId,
|
id: note.noteId,
|
||||||
title: title || 'New Chat ' + now.toLocaleString(),
|
title: title || t('ai.chat.new_chat_title') + ' ' + now.toLocaleString(),
|
||||||
messages,
|
messages,
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
createdAt: now,
|
createdAt: now,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user