fix(project): i18n

pull/884/head
defclass 2020-12-07 11:40:42 +08:00 committed by Tienson Qin
parent c9d25bcb95
commit 14f4397d92
2 changed files with 105 additions and 63 deletions

View File

@ -72,64 +72,66 @@
(defn project
[editor-state current-project pages]
(if (= :display @editor-state)
(when current-project
[:div.cp__publishing-pj
[:span.cp__publishing-pj-name current-project]
[:span.cp__publishing-edit
{:on-click
(fn [_]
(reset! editor-state :editor))}
"edit"]])
[:div.flex.cp__publishing_pj_edit
[:input#cp__publishing-project-input
{:placeholder current-project
:default-value current-project}]
[:div.cp__publishing-pj-bt
(ui/button
"Save"
:on-click (fn [e]
(util/stop e)
(let [editor (.getElementById js/document "cp__publishing-project-input")
v (.-value editor)
data {:name v}]
(-> (p/let [result (update-project current-project data)]
(when (:result result)
(state/update-current-project :name v)
(notification/show! "Updated project name successfully." :success)
(reset! editor-state :display)))
(p/catch
(fn [error]
(notification/show! "Failed to updated project name." :failed))))))
:background "green")]
(rum/with-context [[t] i18n/*tongue-context*]
(if (= :display @editor-state)
(when current-project
(do (prn "abc" current-project)
[:div.cp__publishing-pj
[:span.cp__publishing-pj-name current-project]
[:span.cp__publishing-edit
{:on-click
(fn [_]
(reset! editor-state :editor))}
(t :publishing/edit)]]))
[:div.flex.cp__publishing_pj_edit
[:input#cp__publishing-project-input
{:placeholder current-project
:default-value current-project}]
[:div.cp__publishing-pj-bt
(ui/button
(t :publishing/save)
:on-click (fn [e]
(util/stop e)
(let [editor (.getElementById js/document "cp__publishing-project-input")
v (.-value editor)
data {:name v}]
(-> (p/let [result (update-project current-project data)]
(when (:result result)
(state/update-current-project :name v)
(notification/show! "Updated project name successfully." :success)
(reset! editor-state :display)))
(p/catch
(fn [error]
(notification/show! "Failed to updated project name." :failed))))))
:background "green")]
[:div.cp__publishing-pj-bt
(ui/button
"Cancel"
:on-click (fn [e]
(util/stop e)
(reset! editor-state :display))
:background "pink")]
[:div.cp__publishing-pj-bt
(ui/button
"Delete"
:on-click (fn [e]
(util/stop e)
(let [confirm-message
(util/format
"This operation will also delete all publishing under project \"%s\", continue?"
current-project)]
(when (.confirm js/window confirm-message)
(p/let [result (delete-project current-project)]
(when (:result result)
(reset! editor-state :display)
(doseq [page pages]
(let [page (first page)
page-name (:page/name page)]
(page-handler/page-add-properties! page-name {:published false})))
(state/remove-current-project)
(notification/show! "Delete project successful." :success))))))
:background "red")]]))
[:div.cp__publishing-pj-bt
(ui/button
(t :publishing/cancel)
:on-click (fn [e]
(util/stop e)
(reset! editor-state :display))
:background "pink")]
[:div.cp__publishing-pj-bt
(ui/button
(t :publishing/delete)
:on-click (fn [e]
(util/stop e)
(let [confirm-message
(util/format
"This operation will also delete all publishing under project \"%s\", continue?"
current-project)]
(when (.confirm js/window confirm-message)
(p/let [result (delete-project current-project)]
(when (:result result)
(reset! editor-state :display)
(doseq [page pages]
(let [page (first page)
page-name (:page/name page)]
(page-handler/page-add-properties! page-name {:published false})))
(state/remove-current-project)
(notification/show! "Delete project successful." :success))))))
:background "red")]])))
(rum/defcs my-publishing
< rum/reactive db-mixins/query
@ -144,16 +146,16 @@
[:div.flex-1
[:h1.title (t :my-publishing)]
[:div#cp__publishing-pj-ct
[:span "Current Project"]
[:span (t :publishing/current-project)]
(project editor-state current-project pages)]
(when current-repo
[:div#cp__publishing-pg-ct
[:div "Pages"]
[:div (t :publishing/pages)]
[:table.table-auto
[:thead
[:tr
[:th (t :page/name)]
[:th "Delete from Logseq server"]]]
[:th (t :publishing/page-name)]
[:th (t :publishing/delete-from-logseq)]]]
[:tbody
(for [page pages]
(let [page (first page)
@ -183,6 +185,6 @@
(let [message (util/format "Remove Page \"%s\" from Logseq server failed."
page-name)]
(notification/show! message :failed))))))))}
"delete"]]]]))]]])])))
(t :publishing/delete)]]]]))]]])])))

View File

@ -245,6 +245,14 @@ title: How to take dummy notes?
:page/name "Page name"
:page/last-modified "Last modified at"
:page/new-title "What's your new page title?"
:publishing/pages "Pages"
:publishing/page-name "Page name"
:publishing/current-project "Current Project"
:publishing/delete-from-logseq "Delete From Logseq Server"
:publishing/edit "Edit"
:publishing/save "Save"
:publishing/cancel "Cancel"
:publishing/delete "Delete"
:journal/multiple-files-with-different-formats "It seems that you have multiple journal files (with different formats) for the same month, please only keep one journal file for each month."
:journal/go-to "Go to files"
:file/name "File name"
@ -451,6 +459,14 @@ title: How to take dummy notes?
:page/name "Nom de la page"
:page/last-modified "Dernières modifications à"
:page/new-title "Quel est le nouveau titre de la page ?"
:publishing/pages "Pages"
:publishing/page-name "Page name"
:publishing/current-project "Current Project"
:publishing/delete-from-logseq "Delete From Logseq Server"
:publishing/edit "Edit"
:publishing/save "Save"
:publishing/cancel "Cancel"
:publishing/delete "Delete"
:journal/multiple-files-with-different-formats "Il semble que vous avez plusieurs fichier de journal (sous différents formats) pour le même mois, veuillez ne conserver qu'un fichier par mois."
:journal/go-to "Voir les fichiers"
:file/name "Nom de fichier"
@ -697,9 +713,17 @@ title: How to take dummy notes?
:page/show-journals "显示日志"
:page/show-name "显示页面名"
:page/hide-name "隐藏页面名"
:page/name "页面名称"
:page/name "页面名称"
:page/last-modified "最后更改于"
:page/new-title "请输入新页面的名字:"
:publishing/pages "页面"
:publishing/page-name "页面名"
:publishing/current-project "当前项目"
:publishing/delete-from-logseq "从Logseq服务器删除"
:publishing/edit "修改"
:publishing/save "保存"
:publishing/cancel "取消"
:publishing/delete "删除"
:journal/multiple-files-with-different-formats "你似乎在同一个月有多个日记文件(格式不同),请每个月只保留一个日记文件。"
:journal/go-to "前往所有文件"
:file/name "文件名"
@ -951,6 +975,14 @@ title: How to take dummy notes?
:page/name "頁面名稱:"
:page/last-modified "最後更改於"
:page/new-title "請輸入新頁面的名字:"
:publishing/pages "頁面"
:publishing/page-name "頁面名稱"
:publishing/current-project "當前項目"
:publishing/delete-from-logseq "從Logseq服務器刪除"
:publishing/edit "修改"
:publishing/save "保存"
:publishing/cancel "取消"
:publishing/delete "删除"
:journal/multiple-files-with-different-formats "你似乎在同一個月有多個日記文件(格式不同),請每個月只保留一個日記文件。"
:journal/go-to "前往所有文件"
:file/name "文件名"
@ -1193,6 +1225,14 @@ title: How to take dummy notes?
:page/name "Page name"
:page/last-modified "Laaste verander op"
:page/new-title "Wat is die nuwe blad se titel?"
:publishing/pages "Pages"
:publishing/page-name "Page name"
:publishing/current-project "Current Project"
:publishing/delete-from-logseq "Delete From Logseq Server"
:publishing/edit "Edit"
:publishing/save "Save"
:publishing/cancel "Cancel"
:publishing/delete "Delete"
:journal/multiple-files-with-different-formats "Dit wil voorkom asof jy verskeie journaal (met verskeie formate) vir dieselfde maand het, onderhou asb need een journaal lêer vir elke maand."
:journal/go-to "Go to files"
:file/name "Lêer naam"