feat: support overriding i18n (#550)

This commit is contained in:
Lucas.Xu 2023-10-24 12:12:46 +08:00 • committed by GitHub
commit 6d163b8897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 161 additions and 152 deletions

View file

@ -10,6 +10,7 @@ export 'src/editor/block_component/rich_text/default_selectable_mixin.dart';
// editor part, including editor component, block component, etc.
export 'src/editor/editor.dart';
export 'src/editor/find_replace_menu/find_and_replace.dart';
export 'src/editor/l10n/appflowy_editor_l10n.dart';
export 'src/editor/selection_menu/selection_menu.dart';
// editor state
export 'src/editor_state.dart';

View file

@ -2,7 +2,7 @@ import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/material.dart';
SelectionMenuItem dividerMenuItem = SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.divider,
name: AppFlowyEditorL10n.current.divider,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
icon: Icons.horizontal_rule,
isSelected: isSelected,

View file

@ -133,8 +133,8 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
height: 36,
child: TabBar(
tabs: [
Tab(text: AppFlowyEditorLocalizations.current.uploadImage),
Tab(text: AppFlowyEditorLocalizations.current.urlImage),
Tab(text: AppFlowyEditorL10n.current.uploadImage),
Tab(text: AppFlowyEditorL10n.current.urlImage),
],
labelColor: widget.headerColor,
unselectedLabelColor: Colors.grey,
@ -204,7 +204,7 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
Widget _buildInvalidLinkText() {
return Text(
AppFlowyEditorLocalizations.current.incorrectLink,
AppFlowyEditorL10n.current.incorrectLink,
style: const TextStyle(color: Colors.red, fontSize: 12),
);
}
@ -240,7 +240,7 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
}
},
child: Text(
AppFlowyEditorLocalizations.current.upload,
AppFlowyEditorL10n.current.upload,
style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary,
fontSize: 14.0,
@ -339,7 +339,7 @@ class _UploadImageMenuState extends State<UploadImageMenu> {
),
const SizedBox(height: 8.0),
Text(
AppFlowyEditorLocalizations.current.chooseImage,
AppFlowyEditorL10n.current.chooseImage,
style: const TextStyle(
fontSize: 14.0,
color: Color(0xff00BCF0),

View file

@ -147,7 +147,7 @@ class _ResizableImageState extends State<ResizableImage> {
SizedBox.fromSize(
size: const Size(10, 10),
),
Text(AppFlowyEditorLocalizations.current.loading),
Text(AppFlowyEditorL10n.current.loading),
],
),
);
@ -163,7 +163,7 @@ class _ResizableImageState extends State<ResizableImage> {
borderRadius: const BorderRadius.all(Radius.circular(4.0)),
border: Border.all(width: 1, color: Colors.black),
),
child: Text(AppFlowyEditorLocalizations.current.imageLoadFailed),
child: Text(AppFlowyEditorL10n.current.imageLoadFailed),
);
}

View file

@ -8,7 +8,7 @@ final Map<String, BlockComponentBuilder> standardBlockComponentBuilderMap = {
ParagraphBlockKeys.type: ParagraphBlockComponentBuilder(
configuration: standardBlockComponentConfiguration.copyWith(
placeholderText: (_) => PlatformExtension.isDesktopOrWeb
? AppFlowyEditorLocalizations.current.slashPlaceHolder
? AppFlowyEditorL10n.current.slashPlaceHolder
: ' ',
),
),

View file

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/editor/toolbar/desktop/items/utils/overlay_util.dart';
import 'package:appflowy_editor/src/editor/block_component/table_block_component/util.dart';
import 'package:appflowy_editor/src/editor/toolbar/desktop/items/utils/overlay_util.dart';
import 'package:flutter/material.dart';
void showActionMenu(
BuildContext context,
@ -41,8 +41,8 @@ void showActionMenu(
_menuItem(
context,
dir == TableDirection.col
? AppFlowyEditorLocalizations.current.colAddAfter
: AppFlowyEditorLocalizations.current.rowAddAfter,
? AppFlowyEditorL10n.current.colAddAfter
: AppFlowyEditorL10n.current.rowAddAfter,
dir == TableDirection.col
? Icons.last_page
: Icons.vertical_align_bottom, () {
@ -52,8 +52,8 @@ void showActionMenu(
_menuItem(
context,
dir == TableDirection.col
? AppFlowyEditorLocalizations.current.colAddBefore
: AppFlowyEditorLocalizations.current.rowAddBefore,
? AppFlowyEditorL10n.current.colAddBefore
: AppFlowyEditorL10n.current.rowAddBefore,
dir == TableDirection.col
? Icons.first_page
: Icons.vertical_align_top, () {
@ -63,8 +63,8 @@ void showActionMenu(
_menuItem(
context,
dir == TableDirection.col
? AppFlowyEditorLocalizations.current.colRemove
: AppFlowyEditorLocalizations.current.rowRemove,
? AppFlowyEditorL10n.current.colRemove
: AppFlowyEditorL10n.current.rowRemove,
Icons.delete, () {
TableActions.delete(node, position, editorState, dir);
dismissOverlay();
@ -72,15 +72,15 @@ void showActionMenu(
_menuItem(
context,
dir == TableDirection.col
? AppFlowyEditorLocalizations.current.colDuplicate
: AppFlowyEditorLocalizations.current.rowDuplicate,
? AppFlowyEditorL10n.current.colDuplicate
: AppFlowyEditorL10n.current.rowDuplicate,
Icons.content_copy, () {
TableActions.duplicate(node, position, editorState, dir);
dismissOverlay();
}),
_menuItem(
context,
AppFlowyEditorLocalizations.current.backgroundColor,
AppFlowyEditorL10n.current.backgroundColor,
Icons.format_color_fill,
() {
final cell = dir == TableDirection.col
@ -112,8 +112,8 @@ void showActionMenu(
_menuItem(
context,
dir == TableDirection.col
? AppFlowyEditorLocalizations.current.colClear
: AppFlowyEditorLocalizations.current.rowClear,
? AppFlowyEditorL10n.current.colClear
: AppFlowyEditorL10n.current.rowClear,
Icons.clear, () {
TableActions.clear(node, position, editorState, dir);
dismissOverlay();
@ -180,14 +180,14 @@ void _showColorMenu(
left: left,
builder: (context) {
return ColorPicker(
title: AppFlowyEditorLocalizations.current.highlightColor,
title: AppFlowyEditorL10n.current.highlightColor,
selectedColorHex: selectedColorHex,
colorOptions: generateHighlightColorOptions(),
onSubmittedColorHex: (color) {
action(color);
dismissOverlay();
},
resetText: AppFlowyEditorLocalizations.current.clearHighlightColor,
resetText: AppFlowyEditorL10n.current.clearHighlightColor,
resetIconName: 'clear_highlight_color',
);
},

View file

@ -251,7 +251,7 @@ class _TableBlockComponentWidgetState extends State<TableBlockComponentWidget>
}
SelectionMenuItem tableMenuItem = SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.table,
name: AppFlowyEditorL10n.current.table,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
icon: Icons.table_view,
isSelected: isSelected,

View file

@ -2,7 +2,6 @@ import 'dart:async';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -52,7 +51,7 @@ TextSpan mobileTextSpanDecoratorForAttribute(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(AppFlowyEditorLocalizations.current.editLink),
title: Text(AppFlowyEditorL10n.current.editLink),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4),
),
@ -122,12 +121,12 @@ class _LinkEditFormState extends State<LinkEditForm> {
keyboardType: TextInputType.text,
validator: (value) {
if (value == null || value.isEmpty) {
return AppFlowyEditorLocalizations.current.linkTextHint;
return AppFlowyEditorL10n.current.linkTextHint;
}
return null;
},
decoration: InputDecoration(
hintText: AppFlowyEditorLocalizations.current.linkText,
hintText: AppFlowyEditorL10n.current.linkText,
suffixIcon: IconButton(
icon: const Icon(
Icons.clear_rounded,
@ -143,12 +142,12 @@ class _LinkEditFormState extends State<LinkEditForm> {
keyboardType: TextInputType.url,
validator: (value) {
if (value == null || value.isEmpty) {
return AppFlowyEditorLocalizations.current.linkAddressHint;
return AppFlowyEditorL10n.current.linkAddressHint;
}
return null;
},
decoration: InputDecoration(
hintText: AppFlowyEditorLocalizations.current.urlHint,
hintText: AppFlowyEditorL10n.current.urlHint,
suffixIcon: IconButton(
icon: const Icon(
Icons.clear_rounded,
@ -164,7 +163,7 @@ class _LinkEditFormState extends State<LinkEditForm> {
children: [
TextButton(
child: Text(
AppFlowyEditorLocalizations.current.removeLink,
AppFlowyEditorL10n.current.removeLink,
style: TextStyle(color: Theme.of(context).colorScheme.error),
),
onPressed: () async {
@ -184,7 +183,7 @@ class _LinkEditFormState extends State<LinkEditForm> {
style: TextButton.styleFrom(
textStyle: Theme.of(context).textTheme.labelLarge,
),
child: Text(AppFlowyEditorLocalizations.current.done),
child: Text(AppFlowyEditorL10n.current.done),
onPressed: () async {
if (_formKey.currentState!.validate()) {
final bool textChanged =

View file

@ -1,7 +1,8 @@
import 'package:appflowy_editor/appflowy_editor.dart';
import 'find_replace_menu_icon_button.dart';
import 'package:flutter/material.dart';
import 'find_replace_menu_icon_button.dart';
const double _iconButtonSize = 30;
class FindAndReplaceMenuWidget extends StatefulWidget {
@ -239,8 +240,7 @@ class _FindMenuState extends State<FindMenu> {
});
},
decoration: _buildInputDecoration(
widget.localizations?.find ??
AppFlowyEditorLocalizations.current.find,
widget.localizations?.find ?? AppFlowyEditorL10n.current.find,
),
),
),
@ -261,7 +261,7 @@ class _FindMenuState extends State<FindMenu> {
onPressed: () => widget.searchService.navigateToMatch(moveUp: true),
icon: const Icon(Icons.arrow_upward),
tooltip: widget.localizations?.previousMatch ??
AppFlowyEditorLocalizations.current.previousMatch,
AppFlowyEditorL10n.current.previousMatch,
),
// next match button
FindAndReplaceMenuIconButton(
@ -269,14 +269,14 @@ class _FindMenuState extends State<FindMenu> {
onPressed: () => widget.searchService.navigateToMatch(),
icon: const Icon(Icons.arrow_downward),
tooltip: widget.localizations?.nextMatch ??
AppFlowyEditorLocalizations.current.nextMatch,
AppFlowyEditorL10n.current.nextMatch,
),
FindAndReplaceMenuIconButton(
iconButtonKey: const Key('closeButton'),
onPressed: widget.onDismiss,
icon: const Icon(Icons.close),
tooltip: widget.localizations?.close ??
AppFlowyEditorLocalizations.current.closeFind,
AppFlowyEditorL10n.current.closeFind,
),
// regex button
if (showRegexButton)
@ -294,7 +294,7 @@ class _FindMenuState extends State<FindMenu> {
height: 20,
color: widget.searchService.regex ? Colors.black : Colors.grey,
),
tooltip: AppFlowyEditorLocalizations.current.regex,
tooltip: AppFlowyEditorL10n.current.regex,
),
// case sensitive button
if (showCaseSensitiveButton)
@ -315,7 +315,7 @@ class _FindMenuState extends State<FindMenu> {
? Colors.black
: Colors.grey,
),
tooltip: AppFlowyEditorLocalizations.current.caseSensitive,
tooltip: AppFlowyEditorL10n.current.caseSensitive,
),
],
);
@ -384,7 +384,7 @@ class _ReplaceMenuState extends State<ReplaceMenu> {
},
decoration: _buildInputDecoration(
widget.localizations?.replace ??
AppFlowyEditorLocalizations.current.replace,
AppFlowyEditorL10n.current.replace,
),
),
),
@ -393,7 +393,7 @@ class _ReplaceMenuState extends State<ReplaceMenu> {
onPressed: _replaceSelectedWord,
icon: const Icon(Icons.find_replace),
tooltip: widget.localizations?.replace ??
AppFlowyEditorLocalizations.current.replace,
AppFlowyEditorL10n.current.replace,
),
FindAndReplaceMenuIconButton(
iconButtonKey: const Key('replaceAllButton'),
@ -402,7 +402,7 @@ class _ReplaceMenuState extends State<ReplaceMenu> {
),
icon: const Icon(Icons.change_circle_outlined),
tooltip: widget.localizations?.replaceAll ??
AppFlowyEditorLocalizations.current.replaceAll,
AppFlowyEditorL10n.current.replaceAll,
),
],
);

View file

@ -0,0 +1,5 @@
import 'package:appflowy_editor/appflowy_editor.dart';
class AppFlowyEditorL10n extends AppFlowyEditorLocalizations {
static AppFlowyEditorLocalizations current = AppFlowyEditorL10n();
}

View file

@ -238,7 +238,7 @@ class SelectionMenu extends SelectionMenuService {
final List<SelectionMenuItem> standardSelectionMenuItems = [
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.text,
name: AppFlowyEditorL10n.current.text,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'text',
isSelected: isSelected,
@ -250,7 +250,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.heading1,
name: AppFlowyEditorL10n.current.heading1,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'h1',
isSelected: isSelected,
@ -262,7 +262,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.heading2,
name: AppFlowyEditorL10n.current.heading2,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'h2',
isSelected: isSelected,
@ -274,7 +274,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.heading3,
name: AppFlowyEditorL10n.current.heading3,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'h3',
isSelected: isSelected,
@ -286,7 +286,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.image,
name: AppFlowyEditorL10n.current.image,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'image',
isSelected: isSelected,
@ -299,7 +299,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.bulletedList,
name: AppFlowyEditorL10n.current.bulletedList,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'bulleted_list',
isSelected: isSelected,
@ -311,7 +311,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.numberedList,
name: AppFlowyEditorL10n.current.numberedList,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'number',
isSelected: isSelected,
@ -323,7 +323,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.checkbox,
name: AppFlowyEditorL10n.current.checkbox,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'checkbox',
isSelected: isSelected,
@ -335,7 +335,7 @@ final List<SelectionMenuItem> standardSelectionMenuItems = [
},
),
SelectionMenuItem(
name: AppFlowyEditorLocalizations.current.quote,
name: AppFlowyEditorL10n.current.quote,
icon: (editorState, isSelected, style) => SelectionMenuIconWidget(
name: 'quote',
isSelected: isSelected,

View file

@ -13,7 +13,7 @@ final ToolbarItem bulletedListItem = ToolbarItem(
isHighlight: isHighlight,
highlightColor: highlightColor,
iconColor: iconColor,
tooltip: AppFlowyEditorLocalizations.current.bulletedList,
tooltip: AppFlowyEditorL10n.current.bulletedList,
onPressed: () => editorState.formatNode(
selection,
(node) => node.copyWith(

View file

@ -45,8 +45,8 @@ void showColorMenu(
builder: (context) {
return ColorPicker(
title: isTextColor
? AppFlowyEditorLocalizations.current.textColor
: AppFlowyEditorLocalizations.current.highlightColor,
? AppFlowyEditorL10n.current.textColor
: AppFlowyEditorL10n.current.highlightColor,
showClearButton: showClearButton,
selectedColorHex: currentColorHex,
colorOptions: isTextColor
@ -70,8 +70,8 @@ void showColorMenu(
keepEditorFocusNotifier.decrease();
},
resetText: isTextColor
? AppFlowyEditorLocalizations.current.resetToDefaultColor
: AppFlowyEditorLocalizations.current.clearHighlightColor,
? AppFlowyEditorL10n.current.resetToDefaultColor
: AppFlowyEditorL10n.current.clearHighlightColor,
resetIconName:
isTextColor ? 'reset_text_color' : 'clear_highlight_color',
);

View file

@ -231,7 +231,7 @@ class _CustomColorItemState extends State<CustomColorItem> {
const SizedBox(width: 8),
Expanded(
child: Text(
AppFlowyEditorLocalizations.current.customColor,
AppFlowyEditorL10n.current.customColor,
style: Theme.of(context).textTheme.labelLarge,
// same style as TextButton.icon
),
@ -241,7 +241,7 @@ class _CustomColorItemState extends State<CustomColorItem> {
children: [
const SizedBox(height: 6),
_customColorDetailsTextField(
labelText: AppFlowyEditorLocalizations.current.hexValue,
labelText: AppFlowyEditorL10n.current.hexValue,
controller: widget.colorController,
// update the color sample box when the text changes
onChanged: (_) => setState(() {}),
@ -249,7 +249,7 @@ class _CustomColorItemState extends State<CustomColorItem> {
),
const SizedBox(height: 10),
_customColorDetailsTextField(
labelText: AppFlowyEditorLocalizations.current.opacity,
labelText: AppFlowyEditorL10n.current.opacity,
controller: widget.opacityController,
// update the color sample box when the text changes
onChanged: (_) => setState(() {}),

View file

@ -21,7 +21,7 @@ ToolbarItem buildHighlightColorItem({List<ColorOption>? colorOptions}) {
isHighlight: isHighlight,
highlightColor: highlightColor,
iconColor: iconColor,
tooltip: AppFlowyEditorLocalizations.current.highlightColor,
tooltip: AppFlowyEditorL10n.current.highlightColor,
onPressed: () {
bool showClearButton = false;
nodes.allSatisfyInSelection(selection, (delta) {

View file

@ -22,7 +22,7 @@ ToolbarItem buildTextColorItem({
isHighlight: isHighlight,
highlightColor: highlightColor,
iconColor: iconColor,
tooltip: AppFlowyEditorLocalizations.current.textColor,
tooltip: AppFlowyEditorL10n.current.textColor,
onPressed: () {
bool showClearButton = false;
nodes.allSatisfyInSelection(

View file

@ -6,31 +6,31 @@ final List<ToolbarItem> markdownFormatItems = [
id: 'underline',
name: 'underline',
tooltip:
'${AppFlowyEditorLocalizations.current.underline}${shortcutTooltips('⌘ + U', 'CTRL + U', 'CTRL + U')}',
'${AppFlowyEditorL10n.current.underline}${shortcutTooltips('⌘ + U', 'CTRL + U', 'CTRL + U')}',
),
_FormatToolbarItem(
id: 'bold',
name: 'bold',
tooltip:
'${AppFlowyEditorLocalizations.current.bold}${shortcutTooltips('⌘ + B', 'CTRL + B', 'CTRL + B')}',
'${AppFlowyEditorL10n.current.bold}${shortcutTooltips('⌘ + B', 'CTRL + B', 'CTRL + B')}',
),
_FormatToolbarItem(
id: 'italic',
name: 'italic',
tooltip:
'${AppFlowyEditorLocalizations.current.italic}${shortcutTooltips('⌘ + I', 'CTRL + I', 'CTRL + I')}',
'${AppFlowyEditorL10n.current.italic}${shortcutTooltips('⌘ + I', 'CTRL + I', 'CTRL + I')}',
),
_FormatToolbarItem(
id: 'strikethrough',
name: 'strikethrough',
tooltip:
'${AppFlowyEditorLocalizations.current.strikethrough}${shortcutTooltips('⌘ + SHIFT + S', 'CTRL + SHIFT + S', 'CTRL + SHIFT + S')}',
'${AppFlowyEditorL10n.current.strikethrough}${shortcutTooltips('⌘ + SHIFT + S', 'CTRL + SHIFT + S', 'CTRL + SHIFT + S')}',
),
_FormatToolbarItem(
id: 'code',
name: 'code',
tooltip:
'${AppFlowyEditorLocalizations.current.embedCode}${shortcutTooltips('⌘ + E', 'CTRL + E', 'CTRL + E')}',
'${AppFlowyEditorL10n.current.embedCode}${shortcutTooltips('⌘ + E', 'CTRL + E', 'CTRL + E')}',
),
];

View file

@ -46,11 +46,11 @@ class _HeadingToolbarItem extends ToolbarItem {
static String levelToTooltips(int level) {
if (level == 1) {
return AppFlowyEditorLocalizations.current.heading1;
return AppFlowyEditorL10n.current.heading1;
} else if (level == 2) {
return AppFlowyEditorLocalizations.current.heading2;
return AppFlowyEditorL10n.current.heading2;
} else if (level == 3) {
return AppFlowyEditorLocalizations.current.heading3;
return AppFlowyEditorL10n.current.heading3;
}
return '';
}

View file

@ -1,9 +1,7 @@
import 'package:appflowy_editor/src/editor_state.dart';
import 'package:appflowy_editor/src/infra/flowy_svg.dart';
import 'package:appflowy_editor/src/l10n/l10n.dart';
import 'package:appflowy_editor/appflowy_editor.dart';
import 'package:appflowy_editor/src/editor/toolbar/desktop/items/utils/overlay_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:appflowy_editor/src/editor/toolbar/desktop/items/utils/overlay_util.dart';
class LinkMenu extends StatefulWidget {
const LinkMenu({
@ -56,7 +54,7 @@ class _LinkMenuState extends State<LinkMenu> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
EditorOverlayTitle(
text: AppFlowyEditorLocalizations.current.addYourLink,
text: AppFlowyEditorL10n.current.addYourLink,
),
const SizedBox(height: 16.0),
_buildInput(),
@ -64,17 +62,17 @@ class _LinkMenuState extends State<LinkMenu> {
if (widget.linkText != null) ...[
_buildIconButton(
iconName: 'link',
text: AppFlowyEditorLocalizations.current.openLink,
text: AppFlowyEditorL10n.current.openLink,
onPressed: widget.onOpenLink,
),
_buildIconButton(
iconName: 'copy',
text: AppFlowyEditorLocalizations.current.copyLink,
text: AppFlowyEditorL10n.current.copyLink,
onPressed: widget.onCopyLink,
),
_buildIconButton(
iconName: 'delete',
text: AppFlowyEditorLocalizations.current.removeLink,
text: AppFlowyEditorL10n.current.removeLink,
onPressed: widget.onRemoveLink,
),
],
@ -98,7 +96,7 @@ class _LinkMenuState extends State<LinkMenu> {
controller: _textEditingController,
onSubmitted: widget.onSubmitted,
decoration: InputDecoration(
hintText: AppFlowyEditorLocalizations.current.urlHint,
hintText: AppFlowyEditorL10n.current.urlHint,
contentPadding: const EdgeInsets.all(16.0),
isDense: true,
suffixIcon: IconButton(

View file

@ -24,7 +24,7 @@ final linkItem = ToolbarItem(
isHighlight: isHref,
highlightColor: highlightColor,
iconColor: iconColor,
tooltip: AppFlowyEditorLocalizations.current.link,
tooltip: AppFlowyEditorL10n.current.link,
onPressed: () {
showLinkMenu(context, editorState, selection, isHref);
},

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