diff --git a/src/interface/obsidian/src/main.ts b/src/interface/obsidian/src/main.ts index bb4eecbd..a75d6040 100644 --- a/src/interface/obsidian/src/main.ts +++ b/src/interface/obsidian/src/main.ts @@ -59,18 +59,18 @@ export default class Khoj extends Plugin { // Add a settings tab so the user can configure khoj this.addSettingTab(new KhojSettingTab(this.app, this)); - // Démarrer le timer de synchronisation + // Start the sync timer this.startSyncTimer(); } - // Méthode pour démarrer le timer de synchronisation + // Method to start the sync timer private startSyncTimer() { - // Nettoyer l'ancien timer s'il existe + // Clean up the old timer if it exists if (this.indexingTimer) { clearInterval(this.indexingTimer); } - // Démarrer un nouveau timer avec l'intervalle configuré + // Start a new timer with the configured interval this.indexingTimer = setInterval(async () => { if (this.settings.autoConfigure) { this.settings.lastSync = await updateContentIndex( @@ -79,10 +79,10 @@ export default class Khoj extends Plugin { this.settings.lastSync ); } - }, this.settings.syncInterval * 60 * 1000); // Convertir les minutes en millisecondes + }, this.settings.syncInterval * 60 * 1000); // Convert minutes to milliseconds } - // Méthode publique pour redémarrer le timer (appelée depuis les paramètres) + // Public method to restart the timer (called from settings) public restartSyncTimer() { this.startSyncTimer(); } diff --git a/src/interface/obsidian/src/search_modal.ts b/src/interface/obsidian/src/search_modal.ts index 0e1093ed..fdf72701 100644 --- a/src/interface/obsidian/src/search_modal.ts +++ b/src/interface/obsidian/src/search_modal.ts @@ -13,7 +13,7 @@ export class KhojSearchModal extends SuggestModal { find_similar_notes: boolean; query: string = ""; app: App; - currentController: AbortController | null = null; // Pour annuler les requêtes + currentController: AbortController | null = null; // To cancel requests isLoading: boolean = false; loadingEl: HTMLElement; @@ -37,11 +37,11 @@ export class KhojSearchModal extends SuggestModal { this.loadingEl.style.zIndex = "1000"; this.loadingEl.style.display = "none"; - // Ajouter l'élément au modal + // Add the element to the modal this.modalEl.appendChild(this.loadingEl); // Customize empty state message - // @ts-ignore - Accès à la propriété privée pour personnaliser le message + // @ts-ignore - Access to private property to customize the message this.emptyStateText = ""; // Register Modal Keybindings to Rerank Results @@ -99,7 +99,7 @@ export class KhojSearchModal extends SuggestModal { } async getSuggestions(query: string): Promise { - // Ne pas afficher le chargement si la requête est vide + // Do not show loading if the query is empty if (!query.trim()) { this.isLoading = false; this.updateLoadingState(); diff --git a/src/interface/obsidian/src/settings.ts b/src/interface/obsidian/src/settings.ts index 54dbb812..15bc5b01 100644 --- a/src/interface/obsidian/src/settings.ts +++ b/src/interface/obsidian/src/settings.ts @@ -178,7 +178,7 @@ export class KhojSettingTab extends PluginSettingTab { .onChange(async (value) => { this.plugin.settings.syncInterval = parseInt(value); await this.plugin.saveSettings(); - // Redémarrer le timer avec le nouvel intervalle + // Restart the timer with the new interval this.plugin.restartSyncTimer(); })); @@ -311,13 +311,13 @@ class FolderSuggestModal extends SuggestModal { const folders = new Set(); folders.add(''); // Root folder - // Récupérer tous les fichiers et extraire les chemins des dossiers + // Get all files and extract folder paths this.app.vault.getAllLoadedFiles().forEach(file => { const folderPath = file.parent?.path; if (folderPath) { folders.add(folderPath); - // Ajouter aussi tous les dossiers parents + // Also add all parent folders let parent = folderPath; while (parent.includes('/')) { parent = parent.substring(0, parent.lastIndexOf('/')); diff --git a/src/interface/obsidian/src/utils.ts b/src/interface/obsidian/src/utils.ts index b0dbf61f..27903af4 100644 --- a/src/interface/obsidian/src/utils.ts +++ b/src/interface/obsidian/src/utils.ts @@ -74,9 +74,9 @@ export async function updateContentIndex(vault: Vault, setting: KhojSetting, las }) // Filter files based on specified folders .filter(file => { - // Si aucun dossier n'est spécifié, synchroniser tous les fichiers + // If no folders are specified, sync all files if (setting.syncFolders.length === 0) return true; - // Sinon, vérifier si le fichier est dans un des dossiers spécifiés + // Otherwise, check if the file is in one of the specified folders return setting.syncFolders.some(folder => file.path.startsWith(folder + '/') || file.path === folder ); diff --git a/src/interface/obsidian/styles.css b/src/interface/obsidian/styles.css index 728c064f..23113c90 100644 --- a/src/interface/obsidian/styles.css +++ b/src/interface/obsidian/styles.css @@ -813,7 +813,7 @@ img.copy-icon { display: block; } -/* Animation de chargement */ +/* Loading animation */ .khoj-loading { display: flex; justify-content: center;