Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

refactor: refactored functions & added translation

Sean Riley Hawkins2648a54482ca
diff --git a/frontend/app_flowy/assets/translations/en.json b/frontend/app_flowy/assets/translations/en.json
index 4e6c8f3420..ce1f984f52 100644
--- a/frontend/app_flowy/assets/translations/en.json
+++ b/frontend/app_flowy/assets/translations/en.json
@@ -96,6 +96,12 @@
"lightMode": "Switch to Light mode",
"darkMode": "Switch to Dark mode"
},
+ "notifications": {
+ "export": {
+ "markdown": "Exported Note To Markdown",
+ "path": "Documents/flowy"
+ }
+ },
"contactsPage": {
"title": "Contacts",
"whatsHappening": "What's happening this week?",
diff --git a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
index 5177c93535..4e17619b9f 100644
--- a/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
+++ b/frontend/app_flowy/lib/workspace/application/doc/share_bloc.dart
@@ -1,6 +1,6 @@
import 'dart:async';
import 'dart:io';
-import 'package:app_flowy/startup/startup.dart';
+import 'package:app_flowy/startup/tasks/rust_sdk.dart';
import 'package:app_flowy/workspace/application/doc/share_service.dart';
import 'package:app_flowy/workspace/application/markdown/delta_markdown.dart';
import 'package:flowy_sdk/protobuf/flowy-text-block/entities.pb.dart';
@@ -8,7 +8,6 @@ import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:path_provider/path_provider.dart';
import 'package:dartz/dartz.dart';
part 'share_bloc.freezed.dart';
@@ -41,21 +40,14 @@ class DocShareBloc extends Bloc<DocShareEvent, DocShareState> {
return value;
}
- Future<Directory> appFlowyDocumentDirectory() async {
- Directory documentsDir = await getApplicationDocumentsDirectory();
+ Future<Directory> get _ExportDir async {
+ Directory documentsDir = await appFlowyDocumentDirectory();
- switch (integrationEnv()) {
- case IntegrationMode.develop:
- return Directory('${documentsDir.path}/flowy_dev').create();
- case IntegrationMode.release:
- return Directory('${documentsDir.path}/flowy').create();
- case IntegrationMode.test:
- return Directory("${Directory.current.path}/.sandbox");
- }
+ return documentsDir;
}
Future<String> get _localPath async {
- final dir = await appFlowyDocumentDirectory();
+ final dir = await _ExportDir;
return dir.path;
}
diff --git a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart b/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart
index efe4b4bf39..7c2a47a8c1 100644
--- a/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart
+++ b/frontend/app_flowy/lib/workspace/presentation/plugins/doc/document.dart
@@ -179,9 +179,9 @@ class DocumentShareButton extends StatelessWidget {
switch (action) {
case ShareAction.markdown:
context.read<DocShareBloc>().add(const DocShareEvent.shareMarkdown());
- const BubbleNotification(
- msgTitle: 'Exported Complete ^_^',
- msgBody: "Check in the flowy folder inside your documents directory")
+ BubbleNotification(
+ msgTitle: LocaleKeys.notifications_export_markdown.tr(),
+ msgBody: 'Path: ${LocaleKeys.notifications_export_path.tr()}')
.show(context);
break;
case ShareAction.copyLink: