chore: translate commands (#687)
* feat: translate commands descriptions * feat: allow for commands without description
This commit is contained in:
parent
7d8147c78d
commit
84e5adc199
39 changed files with 958 additions and 108 deletions
|
|
@ -49,7 +49,7 @@ class _HomePageState extends State<HomePage> {
|
||||||
|
|
||||||
void toggleLocale() {
|
void toggleLocale() {
|
||||||
final locale = Intl.getCurrentLocale();
|
final locale = Intl.getCurrentLocale();
|
||||||
if (locale == 'en_US') {
|
if (locale.startsWith('en')) {
|
||||||
// Change to the locale you want to test
|
// Change to the locale you want to test
|
||||||
AppFlowyEditorLocalizations.load(const Locale('pt', 'BR'));
|
AppFlowyEditorLocalizations.load(const Locale('pt', 'BR'));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -119,12 +119,64 @@
|
||||||
"textAlignLeft": "Align Left",
|
"textAlignLeft": "Align Left",
|
||||||
"textAlignCenter": "Align Center",
|
"textAlignCenter": "Align Center",
|
||||||
"textAlignRight": "Align Right",
|
"textAlignRight": "Align Right",
|
||||||
"cmdDontAddNewLineInTableCell": "Don't add new line in table cell",
|
"cmdConvertToLink": "Convert to link",
|
||||||
"cmdMoveToLeftCellIfItsAtStartOfCurrentCell": "Move to left cell if its at start of current cell",
|
"cmdConvertToParagraph": "convert to paragraph",
|
||||||
"cmdMoveToRightCellIfItsAtTheEndOfCurrentCell": "Move to right cell if its at the end of current cell",
|
"cmdCopySelection": "Copy selection",
|
||||||
"cmdMoveToUpCellAtSameOffset": "Move to up cell at same offset",
|
"cmdCutSelection": "Cut selection",
|
||||||
"cmdMoveToDownCellAtSameOffset": "Move to down cell at same offset",
|
"cmdDeleteLeft": "Delete character to the left",
|
||||||
"cmdNavigateAroundTheCellsAtSameOffset": "Navigate around the cells at same offset",
|
"cmdDeleteLineLeft": "Delete to beginning of line",
|
||||||
"cmdNavigateAroundTheCellsAtSameOffsetInReverse": "Navigate around the cells at same offset in reverse",
|
"cmdDeleteRight": "Delete character to the right",
|
||||||
"cmdStopAtTheBeginningOfTheCell": "Stop at the beginning of the cell"
|
"cmdDeleteWordLeft": "delete word at left",
|
||||||
|
"cmdDeleteWordRight": "delete word at right",
|
||||||
|
"cmdExitEditing": "exit editing mode",
|
||||||
|
"cmdIndent": "indent",
|
||||||
|
"cmdMoveCursorBottom": "move cursor to the bottom",
|
||||||
|
"cmdMoveCursorBottomSelect": "Select all until end of file",
|
||||||
|
"cmdMoveCursorDown": "move cursor down",
|
||||||
|
"cmdMoveCursorDownSelect": "Select downward",
|
||||||
|
"cmdMoveCursorLeft": "move cursor left",
|
||||||
|
"cmdMoveCursorLeftSelect": "Select left",
|
||||||
|
"cmdMoveCursorLineEnd": "move cursor to the end of line",
|
||||||
|
"cmdMoveCursorLineEndSelect": "Select to end of line",
|
||||||
|
"cmdMoveCursorLineStart": "move cursor to start of line",
|
||||||
|
"cmdMoveCursorLineStartSelect": "Select to start of line",
|
||||||
|
"cmdMoveCursorRight": "move cursor right",
|
||||||
|
"cmdMoveCursorRightSelect": "Select right",
|
||||||
|
"cmdMoveCursorTop": "move cursor to the top",
|
||||||
|
"cmdMoveCursorTopSelect": "Select all until start of file",
|
||||||
|
"cmdMoveCursorUp": "move cursor up",
|
||||||
|
"cmdMoveCursorUpSelect": "Select upward",
|
||||||
|
"cmdMoveCursorWordLeft": "move cursor to word on the left",
|
||||||
|
"cmdMoveCursorWordLeftSelect": "Select word to the left",
|
||||||
|
"cmdMoveCursorWordRight": "move cursor to word on the right",
|
||||||
|
"cmdMoveCursorWordRightSelect": "Select word to the right",
|
||||||
|
"cmdOpenFind": "Open Find",
|
||||||
|
"cmdOpenFindAndReplace": "Open Find and Replace",
|
||||||
|
"cmdOpenLink": "open link",
|
||||||
|
"cmdOpenLinks": "open links",
|
||||||
|
"cmdOutdent": "outdent",
|
||||||
|
"cmdPasteContent": "paste content",
|
||||||
|
"cmdPasteContentAsPlainText": "paste content as plain text",
|
||||||
|
"cmdRedo": "redo",
|
||||||
|
"cmdScrollPageDown": "scroll page down",
|
||||||
|
"cmdScrollPageUp": "scroll page up",
|
||||||
|
"cmdScrollToBottom": "scroll to bottom",
|
||||||
|
"cmdScrollToTop": "scroll to top",
|
||||||
|
"cmdSelectAll": "select all",
|
||||||
|
"cmdTableLineBreak": "Table: add line break",
|
||||||
|
"cmdTableMoveToDownCellAtSameOffset": "Move to down cell at same offset",
|
||||||
|
"cmdTableMoveToLeftCellIfItsAtStartOfCurrentCell": "Move to left cell if its at start of current cell",
|
||||||
|
"cmdTableMoveToRightCellIfItsAtTheEndOfCurrentCell": "Move to right cell if its at the end of current cell",
|
||||||
|
"cmdTableMoveToUpCellAtSameOffset": "Move to up cell at same offset",
|
||||||
|
"cmdTableNavigateCells": "Navigate around the cells at same offset",
|
||||||
|
"cmdTableNavigateCellsReverse": "Navigate around the cells at same offset in reverse",
|
||||||
|
"cmdTableStopAtTheBeginningOfTheCell": "Stop at the beginning of the cell",
|
||||||
|
"cmdToggleBold": "toggle bold",
|
||||||
|
"cmdToggleCode": "toggle code",
|
||||||
|
"cmdToggleHighlight": "toggle highlight",
|
||||||
|
"cmdToggleItalic": "toggle italic",
|
||||||
|
"cmdToggleStrikethrough": "toggle strikethrough",
|
||||||
|
"cmdToggleTodoList": "toggle the todo list",
|
||||||
|
"cmdToggleUnderline": "toggle underline",
|
||||||
|
"cmdUndo": "undo"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,14 +21,66 @@
|
||||||
"chooseImage": "Selecionar imagem",
|
"chooseImage": "Selecionar imagem",
|
||||||
"clearHighlightColor": "Limpar cor de destaque",
|
"clearHighlightColor": "Limpar cor de destaque",
|
||||||
"closeFind": "Fechar",
|
"closeFind": "Fechar",
|
||||||
"cmdDontAddNewLineInTableCell": "Não adicionar nova linha na célula",
|
"cmdConvertToLink": "Converter para link",
|
||||||
"cmdMoveToDownCellAtSameOffset": "Mover para a célula abaixo na mesma posição",
|
"cmdConvertToParagraph": "converter para parágrafo",
|
||||||
"cmdMoveToLeftCellIfItsAtStartOfCurrentCell": "Mover para a célula à esquerda se estiver no início da célula atual",
|
"cmdCopySelection": "Copiar seleção",
|
||||||
"cmdMoveToRightCellIfItsAtTheEndOfCurrentCell": "Mover para a célula à direita se estiver no final da célula atual",
|
"cmdCutSelection": "Cortar seleção",
|
||||||
"cmdMoveToUpCellAtSameOffset": "Mover para a célula acima na mesma posição",
|
"cmdDeleteLeft": "Deletar caractere à esquerda",
|
||||||
"cmdNavigateAroundTheCellsAtSameOffset": "Navegar pelas células na mesma posição",
|
"cmdDeleteLineLeft": "Deletar até o início da linha",
|
||||||
"cmdNavigateAroundTheCellsAtSameOffsetInReverse": "Navegar pelas células na mesma posição (reverso)",
|
"cmdDeleteRight": "Deletar caractere à direita",
|
||||||
"cmdStopAtTheBeginningOfTheCell": "Parar no início da célula",
|
"cmdDeleteWordLeft": "Deletar palavra à esquerda",
|
||||||
|
"cmdDeleteWordRight": "Deletar palavra à direita",
|
||||||
|
"cmdExitEditing": "sair do modo de edição",
|
||||||
|
"cmdIndent": "indentar",
|
||||||
|
"cmdMoveCursorBottom": "mover cursor para o final do arquivo",
|
||||||
|
"cmdMoveCursorBottomSelect": "Selecionar tudo até o final do arquivo",
|
||||||
|
"cmdMoveCursorDown": "mover cursor para baixo",
|
||||||
|
"cmdMoveCursorDownSelect": "Selecionar para baixo",
|
||||||
|
"cmdMoveCursorLeft": "mover cursor para a esquerda",
|
||||||
|
"cmdMoveCursorLeftSelect": "Selecionar à esquerda",
|
||||||
|
"cmdMoveCursorLineEnd": "mover cursor para o final da linha",
|
||||||
|
"cmdMoveCursorLineEndSelect": "Selecionar até o final da linha",
|
||||||
|
"cmdMoveCursorLineStart": "mover cursor para o início da linha",
|
||||||
|
"cmdMoveCursorLineStartSelect": "Selecionar até o início da linha",
|
||||||
|
"cmdMoveCursorRight": "mover cursor para a direita",
|
||||||
|
"cmdMoveCursorRightSelect": "Selecionar à direita",
|
||||||
|
"cmdMoveCursorTop": "mover cursor para o topo",
|
||||||
|
"cmdMoveCursorTopSelect": "Selecionar tudo até o início do arquivo",
|
||||||
|
"cmdMoveCursorUp": "mover cursor para cima",
|
||||||
|
"cmdMoveCursorUpSelect": "Selecionar para cima",
|
||||||
|
"cmdMoveCursorWordLeft": "mover cursor para a palavra à esquerda",
|
||||||
|
"cmdMoveCursorWordLeftSelect": "Selecionar palavra à esquerda",
|
||||||
|
"cmdMoveCursorWordRight": "mover cursor para a palavra à direita",
|
||||||
|
"cmdMoveCursorWordRightSelect": "Selecionar palavra à direita",
|
||||||
|
"cmdOpenFind": "Abrir Localizar",
|
||||||
|
"cmdOpenFindAndReplace": "Abrir Localizar e Substituir",
|
||||||
|
"cmdOpenLink": "abrir link",
|
||||||
|
"cmdOpenLinks": "abrir links",
|
||||||
|
"cmdOutdent": "desindentar",
|
||||||
|
"cmdPasteContent": "colar conteúdo",
|
||||||
|
"cmdPasteContentAsPlainText": "colar conteúdo como texto simples",
|
||||||
|
"cmdRedo": "refazer",
|
||||||
|
"cmdScrollPageDown": "rolar página para baixo",
|
||||||
|
"cmdScrollPageUp": "rolar página para cima",
|
||||||
|
"cmdScrollToBottom": "rolar para o fim",
|
||||||
|
"cmdScrollToTop": "rolar para o topo",
|
||||||
|
"cmdSelectAll": "selecionar tudo",
|
||||||
|
"cmdTableLineBreak": "Não adicionar nova linha na célula",
|
||||||
|
"cmdTableMoveToDownCellAtSameOffset": "Mover para a célula abaixo na mesma posição",
|
||||||
|
"cmdTableMoveToLeftCellIfItsAtStartOfCurrentCell": "Mover para a célula à esquerda se estiver no início da célula atual",
|
||||||
|
"cmdTableMoveToRightCellIfItsAtTheEndOfCurrentCell": "Mover para a célula à direita se estiver no final da célula atual",
|
||||||
|
"cmdTableMoveToUpCellAtSameOffset": "Mover para a célula acima na mesma posição",
|
||||||
|
"cmdTableNavigateCells": "Navegar pelas células na mesma posição",
|
||||||
|
"cmdTableNavigateCellsReverse": "Navegar pelas células na mesma posição (reverso)",
|
||||||
|
"cmdTableStopAtTheBeginningOfTheCell": "Parar no início da célula",
|
||||||
|
"cmdToggleBold": "alternar negrito",
|
||||||
|
"cmdToggleCode": "alternar código",
|
||||||
|
"cmdToggleHighlight": "alternar destaque",
|
||||||
|
"cmdToggleItalic": "alternar itálico",
|
||||||
|
"cmdToggleStrikethrough": "alternar tachado",
|
||||||
|
"cmdToggleTodoList": "alternar lista de tarefas",
|
||||||
|
"cmdToggleUnderline": "alternar sublinhado",
|
||||||
|
"cmdUndo": "desfazer",
|
||||||
"colAddAfter": "Inserir à direita",
|
"colAddAfter": "Inserir à direita",
|
||||||
"colAddBefore": "Inserir à esquerda",
|
"colAddBefore": "Inserir à esquerda",
|
||||||
"colClear": "Limpar coluna",
|
"colClear": "Limpar coluna",
|
||||||
|
|
@ -79,7 +131,6 @@
|
||||||
"linkText": "Texto",
|
"linkText": "Texto",
|
||||||
"linkTextHint": "Insira o rótulo",
|
"linkTextHint": "Insira o rótulo",
|
||||||
"listItemPlaceholder": "Item de lista",
|
"listItemPlaceholder": "Item de lista",
|
||||||
"toDoPlaceholder": "Tarefa a fazer",
|
|
||||||
"loading": "Carregando",
|
"loading": "Carregando",
|
||||||
"ltr": "Esquerda para Direita",
|
"ltr": "Esquerda para Direita",
|
||||||
"mobileHeading1": "Cabeçalho 1",
|
"mobileHeading1": "Cabeçalho 1",
|
||||||
|
|
@ -122,6 +173,7 @@
|
||||||
"tint7": "Matiz 7",
|
"tint7": "Matiz 7",
|
||||||
"tint8": "Matiz 8",
|
"tint8": "Matiz 8",
|
||||||
"tint9": "Matiz 9",
|
"tint9": "Matiz 9",
|
||||||
|
"toDoPlaceholder": "Tarefa a fazer",
|
||||||
"underline": "Sublinhar",
|
"underline": "Sublinhar",
|
||||||
"upload": "Enviar",
|
"upload": "Enviar",
|
||||||
"uploadImage": "Enviar",
|
"uploadImage": "Enviar",
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ final convertibleBlockTypes = [
|
||||||
/// convert the current block to paragraph.
|
/// convert the current block to paragraph.
|
||||||
final CommandShortcutEvent convertToParagraphCommand = CommandShortcutEvent(
|
final CommandShortcutEvent convertToParagraphCommand = CommandShortcutEvent(
|
||||||
key: 'convert to paragraph',
|
key: 'convert to paragraph',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdConvertToParagraph,
|
||||||
command: 'backspace',
|
command: 'backspace',
|
||||||
handler: _convertToParagraphCommandHandler,
|
handler: _convertToParagraphCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ final indentableBlockTypes = {
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent indentCommand = CommandShortcutEvent(
|
final CommandShortcutEvent indentCommand = CommandShortcutEvent(
|
||||||
key: 'indent',
|
key: 'indent',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdIndent,
|
||||||
command: 'tab',
|
command: 'tab',
|
||||||
handler: _indentCommandHandler,
|
handler: _indentCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent outdentCommand = CommandShortcutEvent(
|
final CommandShortcutEvent outdentCommand = CommandShortcutEvent(
|
||||||
key: 'outdent',
|
key: 'outdent',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdOutdent,
|
||||||
command: 'shift+tab',
|
command: 'shift+tab',
|
||||||
handler: _outdentCommandHandler,
|
handler: _outdentCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -15,30 +15,31 @@ final List<CommandShortcutEvent> tableCommands = [
|
||||||
|
|
||||||
final CommandShortcutEvent _enterInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _enterInTableCell = CommandShortcutEvent(
|
||||||
key: 'Don\'t add new line in table cell',
|
key: 'Don\'t add new line in table cell',
|
||||||
getDescription: () => AppFlowyEditorL10n.current.cmdDontAddNewLineInTableCell,
|
getDescription: () => AppFlowyEditorL10n.current.cmdTableLineBreak,
|
||||||
command: 'enter',
|
command: 'enter',
|
||||||
handler: _enterInTableCellHandler,
|
handler: _enterInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
||||||
final CommandShortcutEvent _leftInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _leftInTableCell = CommandShortcutEvent(
|
||||||
key: 'Move to left cell if its at start of current cell',
|
key: 'Move to left cell if its at start of current cell',
|
||||||
getDescription: () =>
|
getDescription: () => AppFlowyEditorL10n
|
||||||
AppFlowyEditorL10n.current.cmdMoveToLeftCellIfItsAtStartOfCurrentCell,
|
.current.cmdTableMoveToLeftCellIfItsAtStartOfCurrentCell,
|
||||||
command: 'arrow left',
|
command: 'arrow left',
|
||||||
handler: _leftInTableCellHandler,
|
handler: _leftInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
||||||
final CommandShortcutEvent _rightInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _rightInTableCell = CommandShortcutEvent(
|
||||||
key: 'Move to right cell if its at the end of current cell',
|
key: 'Move to right cell if its at the end of current cell',
|
||||||
getDescription: () =>
|
getDescription: () => AppFlowyEditorL10n
|
||||||
AppFlowyEditorL10n.current.cmdMoveToRightCellIfItsAtTheEndOfCurrentCell,
|
.current.cmdTableMoveToRightCellIfItsAtTheEndOfCurrentCell,
|
||||||
command: 'arrow right',
|
command: 'arrow right',
|
||||||
handler: _rightInTableCellHandler,
|
handler: _rightInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
||||||
final CommandShortcutEvent _upInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _upInTableCell = CommandShortcutEvent(
|
||||||
key: 'Move to up cell at same offset',
|
key: 'Move to up cell at same offset',
|
||||||
getDescription: () => AppFlowyEditorL10n.current.cmdMoveToUpCellAtSameOffset,
|
getDescription: () =>
|
||||||
|
AppFlowyEditorL10n.current.cmdTableMoveToUpCellAtSameOffset,
|
||||||
command: 'arrow up',
|
command: 'arrow up',
|
||||||
handler: _upInTableCellHandler,
|
handler: _upInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -46,23 +47,21 @@ final CommandShortcutEvent _upInTableCell = CommandShortcutEvent(
|
||||||
final CommandShortcutEvent _downInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _downInTableCell = CommandShortcutEvent(
|
||||||
key: 'Move to down cell at same offset',
|
key: 'Move to down cell at same offset',
|
||||||
getDescription: () =>
|
getDescription: () =>
|
||||||
AppFlowyEditorL10n.current.cmdMoveToDownCellAtSameOffset,
|
AppFlowyEditorL10n.current.cmdTableMoveToDownCellAtSameOffset,
|
||||||
command: 'arrow down',
|
command: 'arrow down',
|
||||||
handler: _downInTableCellHandler,
|
handler: _downInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
||||||
final CommandShortcutEvent _tabInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _tabInTableCell = CommandShortcutEvent(
|
||||||
key: 'Navigate around the cells at same offset',
|
key: 'Navigate around the cells at same offset',
|
||||||
getDescription: () =>
|
getDescription: () => AppFlowyEditorL10n.current.cmdTableNavigateCells,
|
||||||
AppFlowyEditorL10n.current.cmdNavigateAroundTheCellsAtSameOffset,
|
|
||||||
command: 'tab',
|
command: 'tab',
|
||||||
handler: _tabInTableCellHandler,
|
handler: _tabInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
||||||
final CommandShortcutEvent _shiftTabInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _shiftTabInTableCell = CommandShortcutEvent(
|
||||||
key: 'Navigate around the cells at same offset in reverse',
|
key: 'Navigate around the cells at same offset in reverse',
|
||||||
getDescription: () =>
|
getDescription: () => AppFlowyEditorL10n.current.cmdTableNavigateCellsReverse,
|
||||||
AppFlowyEditorL10n.current.cmdNavigateAroundTheCellsAtSameOffsetInReverse,
|
|
||||||
command: 'shift+tab',
|
command: 'shift+tab',
|
||||||
handler: _shiftTabInTableCellHandler,
|
handler: _shiftTabInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -70,7 +69,7 @@ final CommandShortcutEvent _shiftTabInTableCell = CommandShortcutEvent(
|
||||||
final CommandShortcutEvent _backSpaceInTableCell = CommandShortcutEvent(
|
final CommandShortcutEvent _backSpaceInTableCell = CommandShortcutEvent(
|
||||||
key: 'Stop at the beginning of the cell',
|
key: 'Stop at the beginning of the cell',
|
||||||
getDescription: () =>
|
getDescription: () =>
|
||||||
AppFlowyEditorL10n.current.cmdStopAtTheBeginningOfTheCell,
|
AppFlowyEditorL10n.current.cmdTableStopAtTheBeginningOfTheCell,
|
||||||
command: 'backspace',
|
command: 'backspace',
|
||||||
handler: _backspaceInTableCellHandler,
|
handler: _backspaceInTableCellHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import 'package:flutter/material.dart';
|
||||||
// toggle the todo list
|
// toggle the todo list
|
||||||
final CommandShortcutEvent toggleTodoListCommand = CommandShortcutEvent(
|
final CommandShortcutEvent toggleTodoListCommand = CommandShortcutEvent(
|
||||||
key: 'toggle the todo list',
|
key: 'toggle the todo list',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdToggleTodoList,
|
||||||
command: 'ctrl+enter',
|
command: 'ctrl+enter',
|
||||||
macOSCommand: 'cmd+enter',
|
macOSCommand: 'cmd+enter',
|
||||||
handler: _toggleTodoListCommandHandler,
|
handler: _toggleTodoListCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ final List<CommandShortcutEvent> arrowDownKeys = [
|
||||||
// move the cursor downward vertically
|
// move the cursor downward vertically
|
||||||
final CommandShortcutEvent moveCursorDownCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorDownCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor downward',
|
key: 'move the cursor downward',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorDown,
|
||||||
command: 'arrow down',
|
command: 'arrow down',
|
||||||
handler: _moveCursorDownCommandHandler,
|
handler: _moveCursorDownCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -42,6 +43,7 @@ CommandShortcutEventHandler _moveCursorDownCommandHandler = (editorState) {
|
||||||
/// move the cursor to the bottommost position of the document and select everything in between
|
/// move the cursor to the bottommost position of the document and select everything in between
|
||||||
CommandShortcutEvent moveCursorBottomSelectCommand = CommandShortcutEvent(
|
CommandShortcutEvent moveCursorBottomSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor to end of file and select all',
|
key: 'move cursor to end of file and select all',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorBottomSelect,
|
||||||
command: 'ctrl+shift+arrow down',
|
command: 'ctrl+shift+arrow down',
|
||||||
macOSCommand: 'cmd+shift+arrow down',
|
macOSCommand: 'cmd+shift+arrow down',
|
||||||
handler: _moveCursorBottomSelectCommandHandler,
|
handler: _moveCursorBottomSelectCommandHandler,
|
||||||
|
|
@ -73,6 +75,7 @@ CommandShortcutEventHandler _moveCursorBottomSelectCommandHandler =
|
||||||
/// move the cursor to the bottommost position of the document
|
/// move the cursor to the bottommost position of the document
|
||||||
CommandShortcutEvent moveCursorBottomCommand = CommandShortcutEvent(
|
CommandShortcutEvent moveCursorBottomCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor to end of file',
|
key: 'move cursor to end of file',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorBottom,
|
||||||
command: 'ctrl+arrow down',
|
command: 'ctrl+arrow down',
|
||||||
macOSCommand: 'cmd+arrow down',
|
macOSCommand: 'cmd+arrow down',
|
||||||
handler: _moveCursorBottomCommandHandler,
|
handler: _moveCursorBottomCommandHandler,
|
||||||
|
|
@ -103,6 +106,7 @@ CommandShortcutEventHandler _moveCursorBottomCommandHandler = (editorState) {
|
||||||
/// moves vertically down one line and selects everything between
|
/// moves vertically down one line and selects everything between
|
||||||
CommandShortcutEvent moveCursorDownSelectCommand = CommandShortcutEvent(
|
CommandShortcutEvent moveCursorDownSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor down and select one line',
|
key: 'move cursor down and select one line',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorDownSelect,
|
||||||
command: 'shift+arrow down',
|
command: 'shift+arrow down',
|
||||||
macOSCommand: 'shift+arrow down',
|
macOSCommand: 'shift+arrow down',
|
||||||
handler: _moveCursorDownSelectCommandHandler,
|
handler: _moveCursorDownSelectCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ final List<CommandShortcutEvent> arrowLeftKeys = [
|
||||||
// arrow left key
|
// arrow left key
|
||||||
// move the cursor forward one character
|
// move the cursor forward one character
|
||||||
final CommandShortcutEvent moveCursorLeftCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorLeftCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor forward one character',
|
key: 'move the cursor backward one character',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLeft,
|
||||||
command: 'arrow left',
|
command: 'arrow left',
|
||||||
handler: _arrowLeftCommandHandler,
|
handler: _arrowLeftCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -42,6 +43,7 @@ CommandShortcutEventHandler _arrowLeftCommandHandler = (editorState) {
|
||||||
// move the cursor to the beginning of the block
|
// move the cursor to the beginning of the block
|
||||||
final CommandShortcutEvent moveCursorToBeginCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorToBeginCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor at the start of line',
|
key: 'move the cursor at the start of line',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineStart,
|
||||||
command: 'home',
|
command: 'home',
|
||||||
macOSCommand: 'cmd+arrow left',
|
macOSCommand: 'cmd+arrow left',
|
||||||
handler: _moveCursorToBeginCommandHandler,
|
handler: _moveCursorToBeginCommandHandler,
|
||||||
|
|
@ -64,6 +66,7 @@ CommandShortcutEventHandler _moveCursorToBeginCommandHandler = (editorState) {
|
||||||
// move the cursor to the left word
|
// move the cursor to the left word
|
||||||
final CommandShortcutEvent moveCursorToLeftWordCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorToLeftWordCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor to the left word',
|
key: 'move the cursor to the left word',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordLeft,
|
||||||
command: 'ctrl+arrow left',
|
command: 'ctrl+arrow left',
|
||||||
macOSCommand: 'alt+arrow left',
|
macOSCommand: 'alt+arrow left',
|
||||||
handler: _moveCursorToLeftWordCommandHandler,
|
handler: _moveCursorToLeftWordCommandHandler,
|
||||||
|
|
@ -123,6 +126,7 @@ CommandShortcutEventHandler _moveCursorToLeftWordCommandHandler =
|
||||||
final CommandShortcutEvent moveCursorLeftWordSelectCommand =
|
final CommandShortcutEvent moveCursorLeftWordSelectCommand =
|
||||||
CommandShortcutEvent(
|
CommandShortcutEvent(
|
||||||
key: 'move the cursor to select the left word',
|
key: 'move the cursor to select the left word',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordLeftSelect,
|
||||||
command: 'ctrl+shift+arrow left',
|
command: 'ctrl+shift+arrow left',
|
||||||
macOSCommand: 'alt+shift+arrow left',
|
macOSCommand: 'alt+shift+arrow left',
|
||||||
handler: _moveCursorLeftWordSelectCommandHandler,
|
handler: _moveCursorLeftWordSelectCommandHandler,
|
||||||
|
|
@ -157,6 +161,7 @@ CommandShortcutEventHandler _moveCursorLeftWordSelectCommandHandler =
|
||||||
// selects only one character
|
// selects only one character
|
||||||
final CommandShortcutEvent moveCursorLeftSelectCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorLeftSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor left select',
|
key: 'move the cursor left select',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLeftSelect,
|
||||||
command: 'shift+arrow left',
|
command: 'shift+arrow left',
|
||||||
handler: _moveCursorLeftSelectCommandHandler,
|
handler: _moveCursorLeftSelectCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -185,6 +190,7 @@ CommandShortcutEventHandler _moveCursorLeftSelectCommandHandler =
|
||||||
//
|
//
|
||||||
final CommandShortcutEvent moveCursorBeginSelectCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorBeginSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor to select till start of line',
|
key: 'move cursor to select till start of line',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineStartSelect,
|
||||||
command: 'shift+home',
|
command: 'shift+home',
|
||||||
macOSCommand: 'cmd+shift+arrow left',
|
macOSCommand: 'cmd+shift+arrow left',
|
||||||
handler: _moveCursorBeginSelectCommandHandler,
|
handler: _moveCursorBeginSelectCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ final List<CommandShortcutEvent> arrowRightKeys = [
|
||||||
// arrow right key
|
// arrow right key
|
||||||
// move the cursor backward one character
|
// move the cursor backward one character
|
||||||
final CommandShortcutEvent moveCursorRightCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorRightCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor backward one character',
|
key: 'move the cursor forward one character',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorRight,
|
||||||
command: 'arrow right',
|
command: 'arrow right',
|
||||||
handler: _arrowRightCommandHandler,
|
handler: _arrowRightCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -42,6 +43,7 @@ CommandShortcutEventHandler _arrowRightCommandHandler = (editorState) {
|
||||||
// move the cursor to the end of the block
|
// move the cursor to the end of the block
|
||||||
final CommandShortcutEvent moveCursorToEndCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorToEndCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor to the end of line',
|
key: 'move the cursor to the end of line',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineEnd,
|
||||||
command: 'end',
|
command: 'end',
|
||||||
macOSCommand: 'cmd+arrow right',
|
macOSCommand: 'cmd+arrow right',
|
||||||
handler: _moveCursorToEndCommandHandler,
|
handler: _moveCursorToEndCommandHandler,
|
||||||
|
|
@ -64,6 +66,7 @@ CommandShortcutEventHandler _moveCursorToEndCommandHandler = (editorState) {
|
||||||
// move the cursor to the right word
|
// move the cursor to the right word
|
||||||
final CommandShortcutEvent moveCursorToRightWordCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorToRightWordCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor to the right word',
|
key: 'move the cursor to the right word',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordRight,
|
||||||
command: 'ctrl+arrow right',
|
command: 'ctrl+arrow right',
|
||||||
macOSCommand: 'alt+arrow right',
|
macOSCommand: 'alt+arrow right',
|
||||||
handler: _moveCursorToRightWordCommandHandler,
|
handler: _moveCursorToRightWordCommandHandler,
|
||||||
|
|
@ -127,6 +130,7 @@ CommandShortcutEventHandler _moveCursorToRightWordCommandHandler =
|
||||||
final CommandShortcutEvent moveCursorRightWordSelectCommand =
|
final CommandShortcutEvent moveCursorRightWordSelectCommand =
|
||||||
CommandShortcutEvent(
|
CommandShortcutEvent(
|
||||||
key: 'move the cursor to select the right word',
|
key: 'move the cursor to select the right word',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordRightSelect,
|
||||||
command: 'ctrl+shift+arrow right',
|
command: 'ctrl+shift+arrow right',
|
||||||
macOSCommand: 'alt+shift+arrow right',
|
macOSCommand: 'alt+shift+arrow right',
|
||||||
handler: _moveCursorRightWordSelectCommandHandler,
|
handler: _moveCursorRightWordSelectCommandHandler,
|
||||||
|
|
@ -161,6 +165,7 @@ CommandShortcutEventHandler _moveCursorRightWordSelectCommandHandler =
|
||||||
// selects only one character
|
// selects only one character
|
||||||
final CommandShortcutEvent moveCursorRightSelectCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorRightSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor right select',
|
key: 'move the cursor right select',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorRightSelect,
|
||||||
command: 'shift+arrow right',
|
command: 'shift+arrow right',
|
||||||
handler: _moveCursorRightSelectCommandHandler,
|
handler: _moveCursorRightSelectCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -189,6 +194,7 @@ CommandShortcutEventHandler _moveCursorRightSelectCommandHandler =
|
||||||
// arrow right key + shift + ctrl or cmd
|
// arrow right key + shift + ctrl or cmd
|
||||||
final CommandShortcutEvent moveCursorEndSelectCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorEndSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor to select till end of line',
|
key: 'move cursor to select till end of line',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineEndSelect,
|
||||||
command: 'shift+end',
|
command: 'shift+end',
|
||||||
macOSCommand: 'cmd+shift+arrow right',
|
macOSCommand: 'cmd+shift+arrow right',
|
||||||
handler: _moveCursorEndSelectCommandHandler,
|
handler: _moveCursorEndSelectCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ final List<CommandShortcutEvent> arrowUpKeys = [
|
||||||
// move the cursor upward vertically
|
// move the cursor upward vertically
|
||||||
final CommandShortcutEvent moveCursorUpCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorUpCommand = CommandShortcutEvent(
|
||||||
key: 'move the cursor upward',
|
key: 'move the cursor upward',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorUp,
|
||||||
command: 'arrow up',
|
command: 'arrow up',
|
||||||
handler: _moveCursorUpCommandHandler,
|
handler: _moveCursorUpCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
@ -42,6 +43,7 @@ CommandShortcutEventHandler _moveCursorUpCommandHandler = (editorState) {
|
||||||
/// move the cursor to the topmost position of the document and select everything in between
|
/// move the cursor to the topmost position of the document and select everything in between
|
||||||
final CommandShortcutEvent moveCursorTopSelectCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorTopSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor to start of file and select all',
|
key: 'move cursor to start of file and select all',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorTopSelect,
|
||||||
command: 'ctrl+shift+arrow up',
|
command: 'ctrl+shift+arrow up',
|
||||||
macOSCommand: 'cmd+shift+arrow up',
|
macOSCommand: 'cmd+shift+arrow up',
|
||||||
handler: _moveCursorTopSelectCommandHandler,
|
handler: _moveCursorTopSelectCommandHandler,
|
||||||
|
|
@ -70,6 +72,7 @@ CommandShortcutEventHandler _moveCursorTopSelectCommandHandler = (editorState) {
|
||||||
/// move the cursor to the topmost position of the document
|
/// move the cursor to the topmost position of the document
|
||||||
final CommandShortcutEvent moveCursorTopCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorTopCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor to start of file',
|
key: 'move cursor to start of file',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorTop,
|
||||||
command: 'ctrl+arrow up',
|
command: 'ctrl+arrow up',
|
||||||
macOSCommand: 'cmd+arrow up',
|
macOSCommand: 'cmd+arrow up',
|
||||||
handler: _moveCursorTopCommandHandler,
|
handler: _moveCursorTopCommandHandler,
|
||||||
|
|
@ -100,6 +103,7 @@ CommandShortcutEventHandler _moveCursorTopCommandHandler = (editorState) {
|
||||||
/// moves vertically down one line and selects everything between
|
/// moves vertically down one line and selects everything between
|
||||||
final CommandShortcutEvent moveCursorUpSelectCommand = CommandShortcutEvent(
|
final CommandShortcutEvent moveCursorUpSelectCommand = CommandShortcutEvent(
|
||||||
key: 'move cursor up and select one line',
|
key: 'move cursor up and select one line',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorUpSelect,
|
||||||
command: 'shift+arrow up',
|
command: 'shift+arrow up',
|
||||||
macOSCommand: 'shift+arrow up',
|
macOSCommand: 'shift+arrow up',
|
||||||
handler: _moveCursorUpSelectCommandHandler,
|
handler: _moveCursorUpSelectCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent backspaceCommand = CommandShortcutEvent(
|
final CommandShortcutEvent backspaceCommand = CommandShortcutEvent(
|
||||||
key: 'backspace',
|
key: 'backspace',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdDeleteLeft,
|
||||||
command: 'backspace, shift+backspace',
|
command: 'backspace, shift+backspace',
|
||||||
handler: _backspaceCommandHandler,
|
handler: _backspaceCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent copyCommand = CommandShortcutEvent(
|
final CommandShortcutEvent copyCommand = CommandShortcutEvent(
|
||||||
key: 'copy the selected content',
|
key: 'copy the selected content',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdCopySelection,
|
||||||
command: 'ctrl+c',
|
command: 'ctrl+c',
|
||||||
macOSCommand: 'cmd+c',
|
macOSCommand: 'cmd+c',
|
||||||
handler: _copyCommandHandler,
|
handler: _copyCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent cutCommand = CommandShortcutEvent(
|
final CommandShortcutEvent cutCommand = CommandShortcutEvent(
|
||||||
key: 'cut the selected content',
|
key: 'cut the selected content',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdCutSelection,
|
||||||
command: 'ctrl+x',
|
command: 'ctrl+x',
|
||||||
macOSCommand: 'cmd+x',
|
macOSCommand: 'cmd+x',
|
||||||
handler: _cutCommandHandler,
|
handler: _cutCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent deleteCommand = CommandShortcutEvent(
|
final CommandShortcutEvent deleteCommand = CommandShortcutEvent(
|
||||||
key: 'Delete Key',
|
key: 'Delete Key',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdDeleteRight,
|
||||||
command: 'delete',
|
command: 'delete',
|
||||||
handler: _deleteCommandHandler,
|
handler: _deleteCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent endCommand = CommandShortcutEvent(
|
final CommandShortcutEvent endCommand = CommandShortcutEvent(
|
||||||
key: 'scroll to the bottom of the document',
|
key: 'scroll to the bottom of the document',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdScrollToBottom,
|
||||||
command: 'ctrl+end',
|
command: 'ctrl+end',
|
||||||
macOSCommand: 'end',
|
macOSCommand: 'end',
|
||||||
handler: _endCommandHandler,
|
handler: _endCommandHandler,
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent exitEditingCommand = CommandShortcutEvent(
|
final CommandShortcutEvent exitEditingCommand = CommandShortcutEvent(
|
||||||
key: 'exit the editing mode',
|
key: 'exit the editing mode',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdExitEditing,
|
||||||
command: 'escape',
|
command: 'escape',
|
||||||
handler: _exitEditingCommandHandler,
|
handler: _exitEditingCommandHandler,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ CommandShortcutEvent openFindDialog({
|
||||||
}) =>
|
}) =>
|
||||||
CommandShortcutEvent(
|
CommandShortcutEvent(
|
||||||
key: 'show the find dialog',
|
key: 'show the find dialog',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdOpenFind,
|
||||||
command: 'ctrl+f',
|
command: 'ctrl+f',
|
||||||
macOSCommand: 'cmd+f',
|
macOSCommand: 'cmd+f',
|
||||||
handler: (editorState) => _showFindAndReplaceDialog(
|
handler: (editorState) => _showFindAndReplaceDialog(
|
||||||
|
|
@ -93,6 +94,7 @@ CommandShortcutEvent openReplaceDialog({
|
||||||
}) =>
|
}) =>
|
||||||
CommandShortcutEvent(
|
CommandShortcutEvent(
|
||||||
key: 'show the find and replace dialog',
|
key: 'show the find and replace dialog',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdOpenFindAndReplace,
|
||||||
command: 'ctrl+h',
|
command: 'ctrl+h',
|
||||||
macOSCommand: 'cmd+h',
|
macOSCommand: 'cmd+h',
|
||||||
handler: (editorState) => _showFindAndReplaceDialog(
|
handler: (editorState) => _showFindAndReplaceDialog(
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
|
||||||
///
|
///
|
||||||
final CommandShortcutEvent homeCommand = CommandShortcutEvent(
|
final CommandShortcutEvent homeCommand = CommandShortcutEvent(
|
||||||
key: 'scroll to the top of the document',
|
key: 'scroll to the top of the document',
|
||||||
|
getDescription: () => AppFlowyEditorL10n.current.cmdScrollToTop,
|
||||||
command: 'ctrl+home',
|
command: 'ctrl+home',
|
||||||
macOSCommand: 'home',
|
macOSCommand: 'home',
|
||||||
handler: _homeCommandHandler,
|
handler: _homeCommandHandler,
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue