diff --git a/README.md b/README.md index 96e0eaa5..00b4ced1 100644 --- a/README.md +++ b/README.md @@ -332,8 +332,8 @@ Currently, translations are available for these 22 locales: * `Locale('de')` * `Locale('da')` * `Locale('fr')` -* `Locale('zh', 'CN')` -* `Locale('zh', 'HK')` +* `Locale('zh', 'cn')` +* `Locale('zh', 'hk')` * `Locale('ko')` * `Locale('ru')` * `Locale('es')` diff --git a/lib/src/translations/toolbar.i18n.dart b/lib/src/translations/toolbar.i18n.dart index b6e1f92c..f76b9196 100644 --- a/lib/src/translations/toolbar.i18n.dart +++ b/lib/src/translations/toolbar.i18n.dart @@ -202,7 +202,7 @@ extension Localization on String { 'Camera': 'Camera', 'Video': 'Video', }, - 'zh_CN': { + 'zh_cn': { 'Paste a link': '粘贴链接', 'Ok': '好', 'Select Color': '选择颜色', diff --git a/lib/src/widgets/delegate.dart b/lib/src/widgets/delegate.dart index b70a1d35..a75b64e7 100644 --- a/lib/src/widgets/delegate.dart +++ b/lib/src/widgets/delegate.dart @@ -324,13 +324,11 @@ class EditorTextSelectionGestureDetectorBuilder { @protected void onDragSelectionEnd(DragEndDetails details) { renderEditor!.handleDragEnd(details); - if (isDesktop()) { + if (isDesktop() && + delegate.selectionEnabled && + shouldShowSelectionToolbar) { // added to show selection copy/paste toolbar after drag to select - if (delegate.selectionEnabled) { - if (shouldShowSelectionToolbar) { - editor!.showToolbar(); - } - } + editor!.showToolbar(); } }