From add5e2431ea5a358fb2c442150123e2ac91bfcbc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 23 Mar 2022 16:22:00 +0200 Subject: [PATCH] Super editor --- lib/ui/settings/account_management.dart | 12 +++++++++++- lib/utils/i18n.dart | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/ui/settings/account_management.dart b/lib/ui/settings/account_management.dart index 790f94726..c4a0c6698 100644 --- a/lib/ui/settings/account_management.dart +++ b/lib/ui/settings/account_management.dart @@ -372,10 +372,20 @@ class _AccountOverview extends StatelessWidget { viewModel.onCompanyChanged( company.rebuild((b) => b..markdownEnabled = value)); }, - title: Text(localization.enableMarkdown), + title: Text(localization.enablePdfMarkdown), subtitle: Text(localization.enableMarkdownHelp), activeColor: Theme.of(context).colorScheme.secondary, ), + SwitchListTile( + value: company.markdownEmailEnabled, + onChanged: (value) { + viewModel.onCompanyChanged( + company.rebuild((b) => b..markdownEmailEnabled = value)); + }, + title: Text(localization.enableEmailMarkdown), + subtitle: Text(localization.enableEmailMarkdownHelp), + activeColor: Theme.of(context).colorScheme.secondary, + ), SwitchListTile( value: company.reportIncludeDrafts, onChanged: (value) { diff --git a/lib/utils/i18n.dart b/lib/utils/i18n.dart index c290bfe48..0e848a672 100644 --- a/lib/utils/i18n.dart +++ b/lib/utils/i18n.dart @@ -16,6 +16,9 @@ mixin LocalizationsProvider on LocaleCodeAware { static final Map> _localizedValues = { 'en': { // STARTER: lang key - do not remove comment + 'enable_email_markdown': 'Enable Email Markdown', + 'enable_email_markdown_help': 'Use visual markdown editor for emails', + 'enable_pdf_markdown': 'Enable PDF Markdown', 'json_help': 'Note: JSON files generated by the v4 app are not supported', 'release_notes': 'Release Notes', 'upgrade_to_view_reports': 'Upgrade your plan to view reports', @@ -74175,6 +74178,18 @@ mixin LocalizationsProvider on LocaleCodeAware { _localizedValues[localeCode]['json_help'] ?? _localizedValues['en']['json_help']; + String get enableEmailMarkdown => + _localizedValues[localeCode]['enable_email_markdown'] ?? + _localizedValues['en']['enable_email_markdown']; + + String get enableEmailMarkdownHelp => + _localizedValues[localeCode]['enable_email_markdown_help'] ?? + _localizedValues['en']['enable_email_markdown_help']; + + String get enablePdfMarkdown => + _localizedValues[localeCode]['enable_pdf_markdown'] ?? + _localizedValues['en']['enable_pdf_markdown']; + // STARTER: lang field - do not remove comment String lookup(String key) {