chore: translate commands (#687)

* feat: translate commands descriptions

* feat: allow for commands without description
This commit is contained in:
Juliano Penna 2024-01-29 22:35:36 -03:00 • committed by GitHub
commit 84e5adc199
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 958 additions and 108 deletions

View file

@ -49,7 +49,7 @@ class _HomePageState extends State<HomePage> {
void toggleLocale() {
final locale = Intl.getCurrentLocale();
if (locale == 'en_US') {
if (locale.startsWith('en')) {
// Change to the locale you want to test
AppFlowyEditorLocalizations.load(const Locale('pt', 'BR'));
} else {

View file

@ -119,12 +119,64 @@
"textAlignLeft": "Align Left",
"textAlignCenter": "Align Center",
"textAlignRight": "Align Right",
"cmdDontAddNewLineInTableCell": "Don't add new line in table cell",
"cmdMoveToLeftCellIfItsAtStartOfCurrentCell": "Move to left cell if its at start of current cell",
"cmdMoveToRightCellIfItsAtTheEndOfCurrentCell": "Move to right cell if its at the end of current cell",
"cmdMoveToUpCellAtSameOffset": "Move to up cell at same offset",
"cmdMoveToDownCellAtSameOffset": "Move to down cell at same offset",
"cmdNavigateAroundTheCellsAtSameOffset": "Navigate around the cells at same offset",
"cmdNavigateAroundTheCellsAtSameOffsetInReverse": "Navigate around the cells at same offset in reverse",
"cmdStopAtTheBeginningOfTheCell": "Stop at the beginning of the cell"
"cmdConvertToLink": "Convert to link",
"cmdConvertToParagraph": "convert to paragraph",
"cmdCopySelection": "Copy selection",
"cmdCutSelection": "Cut selection",
"cmdDeleteLeft": "Delete character to the left",
"cmdDeleteLineLeft": "Delete to beginning of line",
"cmdDeleteRight": "Delete character to the right",
"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"
}

View file

@ -21,14 +21,66 @@
"chooseImage": "Selecionar imagem",
"clearHighlightColor": "Limpar cor de destaque",
"closeFind": "Fechar",
"cmdDontAddNewLineInTableCell": "Não adicionar nova linha na célula",
"cmdMoveToDownCellAtSameOffset": "Mover para a célula abaixo na mesma posição",
"cmdMoveToLeftCellIfItsAtStartOfCurrentCell": "Mover para a célula à esquerda se estiver no início da célula atual",
"cmdMoveToRightCellIfItsAtTheEndOfCurrentCell": "Mover para a célula à direita se estiver no final da célula atual",
"cmdMoveToUpCellAtSameOffset": "Mover para a célula acima na mesma posição",
"cmdNavigateAroundTheCellsAtSameOffset": "Navegar pelas células na mesma posição",
"cmdNavigateAroundTheCellsAtSameOffsetInReverse": "Navegar pelas células na mesma posição (reverso)",
"cmdStopAtTheBeginningOfTheCell": "Parar no início da célula",
"cmdConvertToLink": "Converter para link",
"cmdConvertToParagraph": "converter para parágrafo",
"cmdCopySelection": "Copiar seleção",
"cmdCutSelection": "Cortar seleção",
"cmdDeleteLeft": "Deletar caractere à esquerda",
"cmdDeleteLineLeft": "Deletar até o início da linha",
"cmdDeleteRight": "Deletar caractere à direita",
"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",
"colAddBefore": "Inserir à esquerda",
"colClear": "Limpar coluna",
@ -79,7 +131,6 @@
"linkText": "Texto",
"linkTextHint": "Insira o rótulo",
"listItemPlaceholder": "Item de lista",
"toDoPlaceholder": "Tarefa a fazer",
"loading": "Carregando",
"ltr": "Esquerda para Direita",
"mobileHeading1": "Cabeçalho 1",
@ -122,6 +173,7 @@
"tint7": "Matiz 7",
"tint8": "Matiz 8",
"tint9": "Matiz 9",
"toDoPlaceholder": "Tarefa a fazer",
"underline": "Sublinhar",
"upload": "Enviar",
"uploadImage": "Enviar",

View file

@ -19,6 +19,7 @@ final convertibleBlockTypes = [
/// convert the current block to paragraph.
final CommandShortcutEvent convertToParagraphCommand = CommandShortcutEvent(
key: 'convert to paragraph',
getDescription: () => AppFlowyEditorL10n.current.cmdConvertToParagraph,
command: 'backspace',
handler: _convertToParagraphCommandHandler,
);

View file

@ -16,6 +16,7 @@ final indentableBlockTypes = {
///
final CommandShortcutEvent indentCommand = CommandShortcutEvent(
key: 'indent',
getDescription: () => AppFlowyEditorL10n.current.cmdIndent,
command: 'tab',
handler: _indentCommandHandler,
);

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent outdentCommand = CommandShortcutEvent(
key: 'outdent',
getDescription: () => AppFlowyEditorL10n.current.cmdOutdent,
command: 'shift+tab',
handler: _outdentCommandHandler,
);

View file

@ -15,30 +15,31 @@ final List<CommandShortcutEvent> tableCommands = [
final CommandShortcutEvent _enterInTableCell = CommandShortcutEvent(
key: 'Don\'t add new line in table cell',
getDescription: () => AppFlowyEditorL10n.current.cmdDontAddNewLineInTableCell,
getDescription: () => AppFlowyEditorL10n.current.cmdTableLineBreak,
command: 'enter',
handler: _enterInTableCellHandler,
);
final CommandShortcutEvent _leftInTableCell = CommandShortcutEvent(
key: 'Move to left cell if its at start of current cell',
getDescription: () =>
AppFlowyEditorL10n.current.cmdMoveToLeftCellIfItsAtStartOfCurrentCell,
getDescription: () => AppFlowyEditorL10n
.current.cmdTableMoveToLeftCellIfItsAtStartOfCurrentCell,
command: 'arrow left',
handler: _leftInTableCellHandler,
);
final CommandShortcutEvent _rightInTableCell = CommandShortcutEvent(
key: 'Move to right cell if its at the end of current cell',
getDescription: () =>
AppFlowyEditorL10n.current.cmdMoveToRightCellIfItsAtTheEndOfCurrentCell,
getDescription: () => AppFlowyEditorL10n
.current.cmdTableMoveToRightCellIfItsAtTheEndOfCurrentCell,
command: 'arrow right',
handler: _rightInTableCellHandler,
);
final CommandShortcutEvent _upInTableCell = CommandShortcutEvent(
key: 'Move to up cell at same offset',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveToUpCellAtSameOffset,
getDescription: () =>
AppFlowyEditorL10n.current.cmdTableMoveToUpCellAtSameOffset,
command: 'arrow up',
handler: _upInTableCellHandler,
);
@ -46,23 +47,21 @@ final CommandShortcutEvent _upInTableCell = CommandShortcutEvent(
final CommandShortcutEvent _downInTableCell = CommandShortcutEvent(
key: 'Move to down cell at same offset',
getDescription: () =>
AppFlowyEditorL10n.current.cmdMoveToDownCellAtSameOffset,
AppFlowyEditorL10n.current.cmdTableMoveToDownCellAtSameOffset,
command: 'arrow down',
handler: _downInTableCellHandler,
);
final CommandShortcutEvent _tabInTableCell = CommandShortcutEvent(
key: 'Navigate around the cells at same offset',
getDescription: () =>
AppFlowyEditorL10n.current.cmdNavigateAroundTheCellsAtSameOffset,
getDescription: () => AppFlowyEditorL10n.current.cmdTableNavigateCells,
command: 'tab',
handler: _tabInTableCellHandler,
);
final CommandShortcutEvent _shiftTabInTableCell = CommandShortcutEvent(
key: 'Navigate around the cells at same offset in reverse',
getDescription: () =>
AppFlowyEditorL10n.current.cmdNavigateAroundTheCellsAtSameOffsetInReverse,
getDescription: () => AppFlowyEditorL10n.current.cmdTableNavigateCellsReverse,
command: 'shift+tab',
handler: _shiftTabInTableCellHandler,
);
@ -70,7 +69,7 @@ final CommandShortcutEvent _shiftTabInTableCell = CommandShortcutEvent(
final CommandShortcutEvent _backSpaceInTableCell = CommandShortcutEvent(
key: 'Stop at the beginning of the cell',
getDescription: () =>
AppFlowyEditorL10n.current.cmdStopAtTheBeginningOfTheCell,
AppFlowyEditorL10n.current.cmdTableStopAtTheBeginningOfTheCell,
command: 'backspace',
handler: _backspaceInTableCellHandler,
);

View file

@ -11,6 +11,7 @@ import 'package:flutter/material.dart';
// toggle the todo list
final CommandShortcutEvent toggleTodoListCommand = CommandShortcutEvent(
key: 'toggle the todo list',
getDescription: () => AppFlowyEditorL10n.current.cmdToggleTodoList,
command: 'ctrl+enter',
macOSCommand: 'cmd+enter',
handler: _toggleTodoListCommandHandler,

View file

@ -19,6 +19,7 @@ final List<CommandShortcutEvent> arrowDownKeys = [
// move the cursor downward vertically
final CommandShortcutEvent moveCursorDownCommand = CommandShortcutEvent(
key: 'move the cursor downward',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorDown,
command: 'arrow down',
handler: _moveCursorDownCommandHandler,
);
@ -42,6 +43,7 @@ CommandShortcutEventHandler _moveCursorDownCommandHandler = (editorState) {
/// move the cursor to the bottommost position of the document and select everything in between
CommandShortcutEvent moveCursorBottomSelectCommand = CommandShortcutEvent(
key: 'move cursor to end of file and select all',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorBottomSelect,
command: 'ctrl+shift+arrow down',
macOSCommand: 'cmd+shift+arrow down',
handler: _moveCursorBottomSelectCommandHandler,
@ -73,6 +75,7 @@ CommandShortcutEventHandler _moveCursorBottomSelectCommandHandler =
/// move the cursor to the bottommost position of the document
CommandShortcutEvent moveCursorBottomCommand = CommandShortcutEvent(
key: 'move cursor to end of file',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorBottom,
command: 'ctrl+arrow down',
macOSCommand: 'cmd+arrow down',
handler: _moveCursorBottomCommandHandler,
@ -103,6 +106,7 @@ CommandShortcutEventHandler _moveCursorBottomCommandHandler = (editorState) {
/// moves vertically down one line and selects everything between
CommandShortcutEvent moveCursorDownSelectCommand = CommandShortcutEvent(
key: 'move cursor down and select one line',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorDownSelect,
command: 'shift+arrow down',
macOSCommand: 'shift+arrow down',
handler: _moveCursorDownSelectCommandHandler,

View file

@ -20,7 +20,8 @@ final List<CommandShortcutEvent> arrowLeftKeys = [
// arrow left key
// move the cursor forward one character
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',
handler: _arrowLeftCommandHandler,
);
@ -42,6 +43,7 @@ CommandShortcutEventHandler _arrowLeftCommandHandler = (editorState) {
// move the cursor to the beginning of the block
final CommandShortcutEvent moveCursorToBeginCommand = CommandShortcutEvent(
key: 'move the cursor at the start of line',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineStart,
command: 'home',
macOSCommand: 'cmd+arrow left',
handler: _moveCursorToBeginCommandHandler,
@ -64,6 +66,7 @@ CommandShortcutEventHandler _moveCursorToBeginCommandHandler = (editorState) {
// move the cursor to the left word
final CommandShortcutEvent moveCursorToLeftWordCommand = CommandShortcutEvent(
key: 'move the cursor to the left word',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordLeft,
command: 'ctrl+arrow left',
macOSCommand: 'alt+arrow left',
handler: _moveCursorToLeftWordCommandHandler,
@ -123,6 +126,7 @@ CommandShortcutEventHandler _moveCursorToLeftWordCommandHandler =
final CommandShortcutEvent moveCursorLeftWordSelectCommand =
CommandShortcutEvent(
key: 'move the cursor to select the left word',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordLeftSelect,
command: 'ctrl+shift+arrow left',
macOSCommand: 'alt+shift+arrow left',
handler: _moveCursorLeftWordSelectCommandHandler,
@ -157,6 +161,7 @@ CommandShortcutEventHandler _moveCursorLeftWordSelectCommandHandler =
// selects only one character
final CommandShortcutEvent moveCursorLeftSelectCommand = CommandShortcutEvent(
key: 'move the cursor left select',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLeftSelect,
command: 'shift+arrow left',
handler: _moveCursorLeftSelectCommandHandler,
);
@ -185,6 +190,7 @@ CommandShortcutEventHandler _moveCursorLeftSelectCommandHandler =
//
final CommandShortcutEvent moveCursorBeginSelectCommand = CommandShortcutEvent(
key: 'move cursor to select till start of line',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineStartSelect,
command: 'shift+home',
macOSCommand: 'cmd+shift+arrow left',
handler: _moveCursorBeginSelectCommandHandler,

View file

@ -20,7 +20,8 @@ final List<CommandShortcutEvent> arrowRightKeys = [
// arrow right key
// move the cursor backward one character
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',
handler: _arrowRightCommandHandler,
);
@ -42,6 +43,7 @@ CommandShortcutEventHandler _arrowRightCommandHandler = (editorState) {
// move the cursor to the end of the block
final CommandShortcutEvent moveCursorToEndCommand = CommandShortcutEvent(
key: 'move the cursor to the end of line',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineEnd,
command: 'end',
macOSCommand: 'cmd+arrow right',
handler: _moveCursorToEndCommandHandler,
@ -64,6 +66,7 @@ CommandShortcutEventHandler _moveCursorToEndCommandHandler = (editorState) {
// move the cursor to the right word
final CommandShortcutEvent moveCursorToRightWordCommand = CommandShortcutEvent(
key: 'move the cursor to the right word',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordRight,
command: 'ctrl+arrow right',
macOSCommand: 'alt+arrow right',
handler: _moveCursorToRightWordCommandHandler,
@ -127,6 +130,7 @@ CommandShortcutEventHandler _moveCursorToRightWordCommandHandler =
final CommandShortcutEvent moveCursorRightWordSelectCommand =
CommandShortcutEvent(
key: 'move the cursor to select the right word',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorWordRightSelect,
command: 'ctrl+shift+arrow right',
macOSCommand: 'alt+shift+arrow right',
handler: _moveCursorRightWordSelectCommandHandler,
@ -161,6 +165,7 @@ CommandShortcutEventHandler _moveCursorRightWordSelectCommandHandler =
// selects only one character
final CommandShortcutEvent moveCursorRightSelectCommand = CommandShortcutEvent(
key: 'move the cursor right select',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorRightSelect,
command: 'shift+arrow right',
handler: _moveCursorRightSelectCommandHandler,
);
@ -189,6 +194,7 @@ CommandShortcutEventHandler _moveCursorRightSelectCommandHandler =
// arrow right key + shift + ctrl or cmd
final CommandShortcutEvent moveCursorEndSelectCommand = CommandShortcutEvent(
key: 'move cursor to select till end of line',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorLineEndSelect,
command: 'shift+end',
macOSCommand: 'cmd+shift+arrow right',
handler: _moveCursorEndSelectCommandHandler,

View file

@ -19,6 +19,7 @@ final List<CommandShortcutEvent> arrowUpKeys = [
// move the cursor upward vertically
final CommandShortcutEvent moveCursorUpCommand = CommandShortcutEvent(
key: 'move the cursor upward',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorUp,
command: 'arrow up',
handler: _moveCursorUpCommandHandler,
);
@ -42,6 +43,7 @@ CommandShortcutEventHandler _moveCursorUpCommandHandler = (editorState) {
/// move the cursor to the topmost position of the document and select everything in between
final CommandShortcutEvent moveCursorTopSelectCommand = CommandShortcutEvent(
key: 'move cursor to start of file and select all',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorTopSelect,
command: 'ctrl+shift+arrow up',
macOSCommand: 'cmd+shift+arrow up',
handler: _moveCursorTopSelectCommandHandler,
@ -70,6 +72,7 @@ CommandShortcutEventHandler _moveCursorTopSelectCommandHandler = (editorState) {
/// move the cursor to the topmost position of the document
final CommandShortcutEvent moveCursorTopCommand = CommandShortcutEvent(
key: 'move cursor to start of file',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorTop,
command: 'ctrl+arrow up',
macOSCommand: 'cmd+arrow up',
handler: _moveCursorTopCommandHandler,
@ -100,6 +103,7 @@ CommandShortcutEventHandler _moveCursorTopCommandHandler = (editorState) {
/// moves vertically down one line and selects everything between
final CommandShortcutEvent moveCursorUpSelectCommand = CommandShortcutEvent(
key: 'move cursor up and select one line',
getDescription: () => AppFlowyEditorL10n.current.cmdMoveCursorUpSelect,
command: 'shift+arrow up',
macOSCommand: 'shift+arrow up',
handler: _moveCursorUpSelectCommandHandler,

View file

@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent backspaceCommand = CommandShortcutEvent(
key: 'backspace',
getDescription: () => AppFlowyEditorL10n.current.cmdDeleteLeft,
command: 'backspace, shift+backspace',
handler: _backspaceCommandHandler,
);

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent copyCommand = CommandShortcutEvent(
key: 'copy the selected content',
getDescription: () => AppFlowyEditorL10n.current.cmdCopySelection,
command: 'ctrl+c',
macOSCommand: 'cmd+c',
handler: _copyCommandHandler,

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent cutCommand = CommandShortcutEvent(
key: 'cut the selected content',
getDescription: () => AppFlowyEditorL10n.current.cmdCutSelection,
command: 'ctrl+x',
macOSCommand: 'cmd+x',
handler: _cutCommandHandler,

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent deleteCommand = CommandShortcutEvent(
key: 'Delete Key',
getDescription: () => AppFlowyEditorL10n.current.cmdDeleteRight,
command: 'delete',
handler: _deleteCommandHandler,
);

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent endCommand = CommandShortcutEvent(
key: 'scroll to the bottom of the document',
getDescription: () => AppFlowyEditorL10n.current.cmdScrollToBottom,
command: 'ctrl+end',
macOSCommand: 'end',
handler: _endCommandHandler,

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent exitEditingCommand = CommandShortcutEvent(
key: 'exit the editing mode',
getDescription: () => AppFlowyEditorL10n.current.cmdExitEditing,
command: 'escape',
handler: _exitEditingCommandHandler,
);

View file

@ -76,6 +76,7 @@ CommandShortcutEvent openFindDialog({
}) =>
CommandShortcutEvent(
key: 'show the find dialog',
getDescription: () => AppFlowyEditorL10n.current.cmdOpenFind,
command: 'ctrl+f',
macOSCommand: 'cmd+f',
handler: (editorState) => _showFindAndReplaceDialog(
@ -93,6 +94,7 @@ CommandShortcutEvent openReplaceDialog({
}) =>
CommandShortcutEvent(
key: 'show the find and replace dialog',
getDescription: () => AppFlowyEditorL10n.current.cmdOpenFindAndReplace,
command: 'ctrl+h',
macOSCommand: 'cmd+h',
handler: (editorState) => _showFindAndReplaceDialog(

View file

@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
///
final CommandShortcutEvent homeCommand = CommandShortcutEvent(
key: 'scroll to the top of the document',
getDescription: () => AppFlowyEditorL10n.current.cmdScrollToTop,
command: 'ctrl+home',
macOSCommand: 'home',
handler: _homeCommandHandler,

Some files were not shown because too many files have changed in this diff Show more