refactor: remove i18n tongue context

This commit is contained in:
Tienson Qin
2022-02-08 17:31:32 +08:00
parent 5d17315561
commit 982eba9396
36 changed files with 2456 additions and 2665 deletions

View File

@@ -4,43 +4,42 @@
[frontend.util :as util]
[frontend.handler.export :as export]
[frontend.state :as state]
[frontend.context.i18n :as i18n]))
[frontend.context.i18n :refer [t]]))
(rum/defc export
[]
(when-let [current-repo (state/get-current-repo)]
(rum/with-context [[t] i18n/*tongue-context*]
[:div.export
[:h1.title "Export"]
[:div.export
[:h1.title "Export"]
[:ul.mr-1
(when (util/electron?)
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-html! current-repo)}
(t :export-public-pages)]])
[:ul.mr-1
(when (util/electron?)
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-markdown! current-repo)}
(t :export-markdown)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-opml! current-repo)}
(t :export-opml)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-edn-v2! current-repo)}
(t :export-edn)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-json-v2! current-repo)}
(t :export-json)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-roam-json! current-repo)}
(t :export-roam-json)]]]
[:a#download-as-edn-v2.hidden]
[:a#download-as-json-v2.hidden]
[:a#download-as-roam-json.hidden]
[:a#download-as-html.hidden]
[:a#download-as-zip.hidden]
[:a#export-as-markdown.hidden]
[:a#export-as-opml.hidden]
[:a#convert-markdown-to-unordered-list-or-heading.hidden]])))
[:a.font-medium {:on-click #(export/export-repo-as-html! current-repo)}
(t :export-public-pages)]])
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-markdown! current-repo)}
(t :export-markdown)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-opml! current-repo)}
(t :export-opml)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-edn-v2! current-repo)}
(t :export-edn)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-json-v2! current-repo)}
(t :export-json)]]
[:li.mb-4
[:a.font-medium {:on-click #(export/export-repo-as-roam-json! current-repo)}
(t :export-roam-json)]]]
[:a#download-as-edn-v2.hidden]
[:a#download-as-json-v2.hidden]
[:a#download-as-roam-json.hidden]
[:a#download-as-html.hidden]
[:a#download-as-zip.hidden]
[:a#export-as-markdown.hidden]
[:a#export-as-opml.hidden]
[:a#convert-markdown-to-unordered-list-or-heading.hidden]]))
(def *export-block-type (atom :text))