diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 4b314e4e9..d677c6b40 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3559,6 +3559,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_export_option_choose_format" = "Choose export format"; "lng_export_option_html" = "Human-readable HTML"; "lng_export_option_json" = "Machine-readable JSON"; +"lng_export_option_html_and_json" = "Both"; "lng_export_limits" = "From: {from}, to: {till}"; "lng_export_beginning" = "the oldest message"; "lng_export_end" = "present"; diff --git a/Telegram/SourceFiles/export/output/export_output_abstract.cpp b/Telegram/SourceFiles/export/output/export_output_abstract.cpp index f9df0d1f7..dbdb1bf99 100644 --- a/Telegram/SourceFiles/export/output/export_output_abstract.cpp +++ b/Telegram/SourceFiles/export/output/export_output_abstract.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "export/output/export_output_abstract.h" +#include "export/output/export_output_html_and_json.h" #include "export/output/export_output_html.h" #include "export/output/export_output_json.h" #include "export/output/export_output_stats.h" @@ -50,6 +51,7 @@ std::unique_ptr CreateWriter(Format format) { switch (format) { case Format::Html: return std::make_unique(); case Format::Json: return std::make_unique(); + case Format::HtmlAndJson: return std::make_unique(); } Unexpected("Format in Export::Output::CreateWriter."); } diff --git a/Telegram/SourceFiles/export/view/export_view_settings.cpp b/Telegram/SourceFiles/export/view/export_view_settings.cpp index 94e00b43a..bbc91c2dc 100644 --- a/Telegram/SourceFiles/export/view/export_view_settings.cpp +++ b/Telegram/SourceFiles/export/view/export_view_settings.cpp @@ -75,6 +75,9 @@ void ChooseFormatBox( box->setTitle(tr::lng_export_option_choose_format()); addFormatOption(tr::lng_export_option_html(tr::now), Format::Html); addFormatOption(tr::lng_export_option_json(tr::now), Format::Json); + addFormatOption( + tr::lng_export_option_html_and_json(tr::now), + Format::HtmlAndJson); box->addButton(tr::lng_settings_save(), [=] { done(group->value()); }); box->addButton(tr::lng_cancel(), [=] { box->closeBox(); }); } @@ -347,7 +350,11 @@ void SettingsWidget::addFormatAndLocationLabel( return data.format; }) | rpl::distinct_until_changed( ) | rpl::map([](Format format) { - const auto text = (format == Format::Html) ? "HTML" : "JSON"; + const auto text = (format == Format::Html) + ? "HTML" + : (format == Format::Json) + ? "JSON" + : tr::lng_export_option_html_and_json(tr::now); return Ui::Text::Link(text, u"internal:edit_format"_q); }); const auto label = container->add(