i18n: Translate search note prefix

This commit is contained in:
Elian Doran 2024-10-25 21:04:13 +03:00
parent 2324c9a13b
commit 391f518c01
No known key found for this signature in database
6 changed files with 14 additions and 5 deletions

View File

@ -61,9 +61,9 @@ export default class SearchString extends AbstractSearchOption {
await this.setAttribute('label', 'searchString', searchString);
if (this.note.title.startsWith('Search: ')) {
if (this.note.title.startsWith(t("search_string.search_prefix"))) {
await server.put(`notes/${this.note.noteId}/title`, {
title: `Search: ${searchString.length < 30 ? searchString : `${searchString.substr(0, 30)}`}`
title: `${t("search_string.search_prefix")} ${searchString.length < 30 ? searchString : `${searchString.substr(0, 30)}`}`
});
}
}, 1000);

View File

@ -896,7 +896,8 @@
"label_rock_or_pop": "only one of the labels must be present",
"label_year_comparison": "numerical comparison (also >, >=, <).",
"label_date_created": "notes created in the last month",
"error": "Search error: {{error}}"
"error": "Search error: {{error}}",
"search_prefix": "Search:"
},
"attachment_detail": {
"open_help_page": "Open help page on attachments",

View File

@ -1094,7 +1094,8 @@
"label_year_comparison": "comparații numerice (de asemenea >, >=, <).",
"placeholder": "cuvinte cheie pentru căutarea în conținut, #etichetă = valoare...",
"search_syntax": "Sintaxa de căutare",
"title_column": "Textul de căutat:"
"title_column": "Textul de căutat:",
"search_prefix": "Căutare:"
},
"shortcuts": {
"action_name": "Denumirea acțiunii",

View File

@ -8,6 +8,7 @@ import hoistedNoteService from "./hoisted_note.js";
import searchService from "./search/services/search.js";
import SearchContext from "./search/search_context.js";
import hiddenSubtree from "./hidden_subtree.js";
import { t } from "i18next";
const { LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT } = hiddenSubtree;
function getInboxNote(date: string) {
@ -75,7 +76,7 @@ function saveSqlConsole(sqlConsoleNoteId: string) {
function createSearchNote(searchString: string, ancestorNoteId: string) {
const {note} = noteService.createNewNote({
parentNoteId: getMonthlyParentNoteId('_search', 'search'),
title: `Search: ${searchString}`,
title: `${t("special_notes.search_prefix")} ${searchString}`,
content: "",
type: 'search',
mime: 'application/json'

View File

@ -180,5 +180,8 @@
"october": "October",
"november": "November",
"december": "December"
},
"special_notes": {
"search_prefix": "Search:"
}
}

View File

@ -180,5 +180,8 @@
"october": "Octombrie",
"november": "Noiembrie",
"december": "Decembrie"
},
"special_notes": {
"search_prefix": "Căutare:"
}
}