From ce596fa947e1a3cbd1fdd9fd5a2f7539feec91b3 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sat, 20 Jun 2026 16:25:49 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20i18n=20complet=20=E2=80=94=20mobile,=20b?= =?UTF-8?q?acklinks,=20undo/redo,=20content-area?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - mobile-action-sheet.tsx: 15 chaînes → t() - wikilinks-backlinks-panel.tsx: 3 chaînes → t() + import useLanguage - note-content-area.tsx: 'Cliquez pour éditer' → t() - undo-redo-feedback-extension.ts: strings → options configurables - i18n FR/EN: 11 nouvelles clés (mobile.*, editor.*) - SlashPreview et SlashCommand: déjà OK (i18n via localCommands) --- .../components/mobile-action-sheet.tsx | 30 +++++++++---------- .../note-editor/note-content-area.tsx | 2 +- .../components/wikilinks-backlinks-panel.tsx | 8 +++-- .../editor/undo-redo-feedback-extension.ts | 22 ++++++++++---- memento-note/locales/en.json | 10 +++++++ memento-note/locales/fr.json | 10 +++++++ 6 files changed, 57 insertions(+), 25 deletions(-) diff --git a/memento-note/components/mobile-action-sheet.tsx b/memento-note/components/mobile-action-sheet.tsx index 2b11068..63ee0df 100644 --- a/memento-note/components/mobile-action-sheet.tsx +++ b/memento-note/components/mobile-action-sheet.tsx @@ -101,84 +101,84 @@ export function MobileActionSheet({
{/* Section 1 : Actions de bloc */}
-

Actions sur le bloc

+

{t('mobile.blockActions') || 'Actions sur le bloc'}

{/* Section 2 : IA Note */}
-

IA Note

+

{t('mobile.aiNote') || 'IA Note'}

{/* Section 3 : Format de bloc */}
-

Convertir le format

+

{t('mobile.convertFormat') || 'Convertir le format'}

diff --git a/memento-note/components/note-editor/note-content-area.tsx b/memento-note/components/note-editor/note-content-area.tsx index 9b9da29..a867847 100644 --- a/memento-note/components/note-editor/note-content-area.tsx +++ b/memento-note/components/note-editor/note-content-area.tsx @@ -40,7 +40,7 @@ export function NoteContentArea() { {!readOnly && (

- Cliquez pour éditer + {t('editor.clickToEdit') || 'Cliquez pour éditer'}

)}
diff --git a/memento-note/components/wikilinks-backlinks-panel.tsx b/memento-note/components/wikilinks-backlinks-panel.tsx index 8805ecb..1a1c7df 100644 --- a/memento-note/components/wikilinks-backlinks-panel.tsx +++ b/memento-note/components/wikilinks-backlinks-panel.tsx @@ -5,6 +5,7 @@ import { Link2, ChevronRight, Loader2 } from 'lucide-react' import { cn } from '@/lib/utils' import { motion, AnimatePresence } from 'motion/react' import { useRouter } from 'next/navigation' +import { useLanguage } from '@/lib/i18n' interface BacklinkNote { id: string @@ -26,6 +27,7 @@ interface WikilinksBacklinksPanelProps { } export function WikilinksBacklinksPanel({ noteId, className }: WikilinksBacklinksPanelProps) { + const { t } = useLanguage() const [backlinks, setBacklinks] = useState([]) const [loading, setLoading] = useState(true) const [open, setOpen] = useState(true) @@ -54,7 +56,7 @@ export function WikilinksBacklinksPanel({ noteId, className }: WikilinksBacklink > - Liens entrants + {t('editor.backlinks') || 'Liens entrants'} {backlinks.length} @@ -78,7 +80,7 @@ export function WikilinksBacklinksPanel({ noteId, className }: WikilinksBacklink {loading && (
- Chargement… + {t('common.loading') || 'Chargement…'}
)} {backlinks.map(bl => ( @@ -92,7 +94,7 @@ export function WikilinksBacklinksPanel({ noteId, className }: WikilinksBacklink

- {bl.sourceNote.title || '(Sans titre)'} + {bl.sourceNote.title || (t('notes.untitled') || '(Sans titre)')}

{bl.contextSnippet && (

diff --git a/memento-note/lib/editor/undo-redo-feedback-extension.ts b/memento-note/lib/editor/undo-redo-feedback-extension.ts index 3536c4a..67114df 100644 --- a/memento-note/lib/editor/undo-redo-feedback-extension.ts +++ b/memento-note/lib/editor/undo-redo-feedback-extension.ts @@ -8,16 +8,26 @@ import { toast } from 'sonner' export const UndoRedoFeedbackExtension = Extension.create({ name: 'undoRedoFeedback', + addOptions() { + return { + undoText: 'Action annulée', + undoHint: 'Faites {key}+Maj+Z pour rétablir.', + redoText: 'Action rétablie', + redoHint: 'Faites {key}+Z pour annuler.', + } + }, + addKeyboardShortcuts() { const isMac = typeof window !== 'undefined' && /Mac|iPod|iPhone|iPad/.test(navigator.userAgent) const modKey = isMac ? '⌘' : 'Ctrl' + const o = this.options return { 'Mod-z': () => { const success = this.editor.commands.undo() if (success) { - toast.info('Action annulée', { - description: `Faites ${modKey}+Maj+Z pour rétablir.`, + toast.info(o.undoText, { + description: o.undoHint.replace('{key}', modKey), duration: 2000, }) } @@ -26,8 +36,8 @@ export const UndoRedoFeedbackExtension = Extension.create({ 'Mod-y': () => { const success = this.editor.commands.redo() if (success) { - toast.info('Action rétablie', { - description: `Faites ${modKey}+Z pour annuler.`, + toast.info(o.redoText, { + description: o.redoHint.replace('{key}', modKey), duration: 2000, }) } @@ -36,8 +46,8 @@ export const UndoRedoFeedbackExtension = Extension.create({ 'Mod-Shift-z': () => { const success = this.editor.commands.redo() if (success) { - toast.info('Action rétablie', { - description: `Faites ${modKey}+Z pour annuler.`, + toast.info(o.redoText, { + description: o.redoHint.replace('{key}', modKey), duration: 2000, }) } diff --git a/memento-note/locales/en.json b/memento-note/locales/en.json index 937ee20..2fd68c1 100644 --- a/memento-note/locales/en.json +++ b/memento-note/locales/en.json @@ -2617,6 +2617,16 @@ "slashLivingBlock": "Living Block", "slashLivingBlockDesc": "Insert from another note", "frequentCommands": "★ Frequent", + "mobileBlockActions": "Block Actions", + "mobileSelectAll": "Select All", + "mobileDuplicate": "Duplicate", + "mobileDelete": "Delete", + "mobileAiNote": "AI Note", + "mobileConvertFormat": "Convert Format", + "mobileParagraph": "Paragraph", + "mobileQuote": "Quote", + "editorBacklinks": "Incoming Links", + "editorClickToEdit": "Click to edit", "exercisesLoading": "Generating exercises...", "exercisesGenerated": "exercises created!", "aiGenerateExercises": "Generate exercises", diff --git a/memento-note/locales/fr.json b/memento-note/locales/fr.json index 52d987b..2c54cda 100644 --- a/memento-note/locales/fr.json +++ b/memento-note/locales/fr.json @@ -2621,6 +2621,16 @@ "slashLivingBlock": "Bloc vivant", "slashLivingBlockDesc": "Insérer depuis une autre note", "frequentCommands": "★ Fréquents", + "mobileBlockActions": "Actions sur le bloc", + "mobileSelectAll": "Sélectionner tout", + "mobileDuplicate": "Dupliquer", + "mobileDelete": "Supprimer", + "mobileAiNote": "IA Note", + "mobileConvertFormat": "Convertir le format", + "mobileParagraph": "Paragraphe", + "mobileQuote": "Citation", + "editorBacklinks": "Liens entrants", + "editorClickToEdit": "Cliquez pour éditer", "exercisesLoading": "Génération des exercices...", "exercisesGenerated": "exercices créés !", "aiGenerateExercises": "Générer des exercices",