fix: i18n complet — mobile, backlinks, undo/redo, content-area
- 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)
This commit is contained in:
@@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user