Skip to content

Commit

Permalink
fix: translations
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc committed Jun 9, 2023
1 parent d13ba8d commit 135e322
Show file tree
Hide file tree
Showing 29 changed files with 40 additions and 195 deletions.
2 changes: 1 addition & 1 deletion src/main/frontend/components/conversion.cljs
Expand Up @@ -149,7 +149,7 @@
[:p (t :file-rn/need-action)])
[:p
(ui/button
(str (t :file-rn/all-action) " (" (count rename-items) ")")
(t :file-rn/all-action (count rename-items))
:on-click <rename-all
:class "text-md p-2 mr-1")
(t :file-rn/or-select-actions)
Expand Down
10 changes: 6 additions & 4 deletions src/main/frontend/components/editor.cljs
Expand Up @@ -131,7 +131,7 @@
nil

(empty? matched-pages)
(cons (str (t :new-page) ": " q) matched-pages)
(cons q matched-pages)

;; reorder, shortest and starts-with first.
:else
Expand All @@ -142,8 +142,8 @@
matched-pages)]
(if (gstring/caseInsensitiveStartsWith (first matched-pages) q)
(cons (first matched-pages)
(cons (str (t :new-page) ": " q) (rest matched-pages)))
(cons (str (t :new-page) ": " q) matched-pages))))]
(cons q (rest matched-pages)))
(cons q matched-pages))))]
(ui/auto-complete
matched-pages
{:on-chosen (page-handler/on-chosen-handler input id q pos format)
Expand All @@ -154,7 +154,9 @@
{:children
[:div.flex
(when (db-model/whiteboard-page? page-name) [:span.mr-1 (ui/icon "whiteboard" {:extension? true})])
(search/highlight-exact-query page-name q)]
[:div.flex.space-x-1
[:div (when-not (db/page-exists? page-name) (t :new-page))]
(search/highlight-exact-query page-name q)]]
:open? chosen?
:manual? true
:fixed-position? true
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/components/header.cljs
Expand Up @@ -134,7 +134,7 @@
:icon (ui/icon "bulb")})

(when (and (state/sub :auth/id-token) (user-handler/logged-in?))
{:title (str (t :logout) " (" (user-handler/email) ")")
{:title (t :logout-user (user-handler/email))
:options {:on-click #(user-handler/logout)}
:icon (ui/icon "logout")})]
(concat page-menu-and-hr)
Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/components/page.cljs
Expand Up @@ -820,7 +820,7 @@
[:div.mt-3.text-center.sm:mt-0.sm:ml-4.sm:text-left
[:h3#modal-headline.text-lg.leading-6.font-medium
(if orphaned-pages?
(str (t :remove-orphaned-pages) "?")
(t :remove-orphaned-pages)
(t :page/delete-confirmation))]]]

[:table.table-auto.cp__all_pages_table.mt-4
Expand Down Expand Up @@ -856,7 +856,7 @@
(close-fn)
(doseq [page-name (map :block/name pages)]
(page-handler/delete! page-name #()))
(notification/show! (str (t :tips/all-done) "!") :success)
(notification/show! (t :tips/all-done) :success)
(js/setTimeout #(refresh-fn) 200)))]]))

(rum/defc pagination
Expand Down
8 changes: 4 additions & 4 deletions src/main/frontend/components/plugins.cljs
Expand Up @@ -270,7 +270,7 @@
(if installing-or-updating?
(t :plugin/updating)
(if new-version
(str (t :plugin/update) " 👉 " new-version)
[:span (t :plugin/update) " 👉 " new-version]
(t :plugin/check-update)))]])

(ui/toggle (not disabled?)
Expand Down Expand Up @@ -554,7 +554,7 @@
:options {:on-click #(reset! *sort-by :stars)}
:icon (ui/icon (aim-icon :stars))}

{:title (str (t :plugin/title) " (A - Z)")
{:title (t :plugin/title "A - Z")
:options {:on-click #(reset! *sort-by :letters)}
:icon (ui/icon (aim-icon :letters))}])
{}))
Expand Down Expand Up @@ -586,7 +586,7 @@
:options {:on-click
#(p/let [root (plugin-handler/get-ls-dotdir-root)]
(js/apis.openPath (str root "/preferences.json")))}}
{:title [:span.flex.items-center (ui/icon "bug") (str (t :plugin/open-logseq-dir) "\u00A0") [:code "~/.logseq"]]
{:title [:span.flex.items-center.whitespace-nowrap.space-x-1 (ui/icon "bug") (t :plugin/open-logseq-dir) [:code "~/.logseq"]]
:options {:on-click
#(p/let [root (plugin-handler/get-ls-dotdir-root)]
(js/apis.openPath root))}}]))
Expand Down Expand Up @@ -1192,7 +1192,7 @@
(if check-pending?
(notify!
[:div
[:div (str (t :plugin/checking-for-updates))]
[:div (t :plugin/checking-for-updates)]
(when sub-content [:p.opacity-60 sub-content])]
(ui/loading ""))
(when uid (notification/clear! uid))))
Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/components/repo.cljs
Expand Up @@ -107,7 +107,7 @@
[:div.pl-1.content.mt-3

[:div
[:h2.text-lg.font-medium.my-4 (str (t :graph/local-graphs) ":")]
[:h2.text-lg.font-medium.my-4 (t :graph/local-graphs)]
(when (seq local-graphs)
(repos-inner local-graphs))

Expand All @@ -123,7 +123,7 @@
[:div
[:hr]
[:div.flex.align-items.justify-between
[:h2.text-lg.font-medium.my-4 (str (t :graph/remote-graphs) ":")]
[:h2.text-lg.font-medium.my-4 (t :graph/remote-graphs)]
[:div
(ui/button
[:span.flex.items-center "Refresh"
Expand Down
4 changes: 2 additions & 2 deletions src/main/frontend/components/right_sidebar.cljs
Expand Up @@ -123,11 +123,11 @@
[(t :right-side-bar/help) (onboarding/help)]

:page-graph
[(str (t :right-side-bar/page-graph))
[(t :right-side-bar/page-graph)
(page/page-graph)]

:history
[(str (t :right-side-bar/history))
[(t :right-side-bar/history)
(history)]

:block-ref
Expand Down
8 changes: 4 additions & 4 deletions src/main/frontend/components/search.cljs
Expand Up @@ -257,8 +257,8 @@
{:name icon
:class "highlight"
:extension? true}
[:div.text.font-bold (str label ": ")
[:span.ml-1 name]]))
[:div.text.font-bold label
[:span.ml-2 name]]))

(defn- search-item-render
[search-q {:keys [type data alias]}]
Expand Down Expand Up @@ -312,7 +312,7 @@

:else
(do (log/error "search result with non-existing uuid: " data)
(str (t :search/cache-outdated)))))])
(t :search/cache-outdated))))])

:page-content
(let [{:block/keys [snippet uuid]} data ;; content here is normalized
Expand All @@ -327,7 +327,7 @@
(if page
(page-content-search-result-item repo uuid format snippet search-q search-mode)
(do (log/error "search result with non-existing uuid: " data)
(str (t :search/cache-outdated)))))]))
(t :search/cache-outdated))))]))

nil)]))

Expand Down
10 changes: 1 addition & 9 deletions src/main/frontend/handler/page.cljs
Expand Up @@ -792,10 +792,6 @@
(fn [chosen _click?]
(state/clear-editor-action!)
(let [wrapped? (= page-ref/left-brackets (gp-util/safe-subs edit-content (- pos 2) pos))
prefix (str (t :new-page) ": ")
chosen (if (string/starts-with? chosen prefix) ;; FIXME: What if a page named "New page: XXX"?
(string/replace-first chosen prefix "")
chosen)
chosen (if (and (util/safe-re-find #"\s+" chosen) (not wrapped?))
(page-ref/->page-ref chosen)
chosen)
Expand All @@ -814,11 +810,7 @@
:command :page-ref})))
(fn [chosen _click?]
(state/clear-editor-action!)
(let [prefix (str (t :new-page) ": ")
chosen (if (string/starts-with? chosen prefix)
(string/replace-first chosen prefix "")
chosen)
page-ref-text (get-page-ref-text chosen)]
(let [page-ref-text (get-page-ref-text chosen)]
(editor-handler/insert-command! id
page-ref-text
format
Expand Down
6 changes: 3 additions & 3 deletions src/main/frontend/handler/plugin.cljs
Expand Up @@ -203,23 +203,23 @@
#(do
;;(if theme (select-a-plugin-theme id))
(notification/show!
(str (t :plugin/update) (t :plugins) ": " name " - " (.-version (.-options pl))) :success)
(t :plugin/update-plugin name (.-version (.-options pl))) :success)
(state/consume-updates-from-coming-plugin! payload true))))

(do ;; register new
(p/then
(js/LSPluginCore.register (bean/->js {:key id :url dst}))
(fn [] (when theme (js/setTimeout #(select-a-plugin-theme id) 300))))
(notification/show!
(str (t :plugin/installed) (t :plugins) ": " name) :success)))))
(t :plugin/installed-plugin name) :success)))))

:error
(let [error-code (keyword (string/replace (:error-code payload) #"^[\s\:\[]+" ""))
fake-error? (contains? #{:no-new-version} error-code)
[msg type] (case error-code

:no-new-version
[(str (t :plugin/up-to-date) " :)") :success]
[(t :plugin/up-to-date ":)") :success]

[error-code :error])
pending? (seq (:plugin/updates-pending @state/state))]
Expand Down
1 change: 0 additions & 1 deletion src/resources/dicts/af.edn
Expand Up @@ -47,7 +47,6 @@
:re-index "Herindekseer"
:export-json "Uitvoer as JSON"
:search "Soek"
:new-page "Nuwe bladsy"
:graph "Grafiek"
:all-pages "Alle blaaie"
:all-files "Alle lêers"
Expand Down
10 changes: 0 additions & 10 deletions src/resources/dicts/de.edn
Expand Up @@ -36,8 +36,6 @@
:logout "Ausloggen"
:more "Mehr"
:new-graph "Neuen Graphen hinzufügen"
:new-page "Neue Seite"
:new-whiteboard "Neues Whiteboard"
:open-a-directory "Öffne ein lokales Verzeichnis"
:open-new-window "Neues Fenster"
:page-search "In der aktuellen Seite suchen"
Expand All @@ -51,7 +49,6 @@
:relaunch-confirm-to-work "Sie sollten die App neu starten, damit sie funktioniert. Möchten Sie sie jetzt neu starten?"
:remove-background "Hintergrund entfernen"
:remove-heading "Überschrift entfernen"
:remove-orphaned-pages "Verweiste Seiten entfernen"
:save "Speichern"
:search "Suchen oder Seite erstellen"
:settings "Einstellungen"
Expand Down Expand Up @@ -106,7 +103,6 @@
:file/no-data "Keine Daten"
:file/validate-existing-file-error "Seite existiert bereits mit einer anderen Datei: {1}, aktuelle Datei: {2}. Bitte behalten Sie nur eine davon und indizieren Sie Ihren Graphen neu."

:file-rn/all-action "Alle Aktionen anwenden!"
:file-rn/apply-rename "Anwenden des Vorgangs zur Datei-Umbenennung"
:file-rn/close-panel "Das Panel schließen"
:file-rn/confirm-proceed "Format aktualisieren!"
Expand All @@ -133,10 +129,8 @@
:file-rn/unreachable-title "Warnung! Der Seitenname wird unter dem aktuellen Dateinamenformat zu {1}, es sei denn, die Eigenschaft `title::` wird manuell gesetzt"

:graph/all-graphs "Alle Graphen"
:graph/local-graphs "Lokale Graphen"
:graph/persist "Logseq synchronisiert gerade den internen Status, bitte warten Sie einige Sekunden."
:graph/persist-error "Synchronisation des internen Status fehlgeschlagen."
:graph/remote-graphs "Remote Graphen"
:graph/save "Speichern..."
:graph/save-error "Speichern fehlgeschlagen"
:graph/save-success "Erfolgreich gespeichert"
Expand Down Expand Up @@ -238,14 +232,12 @@
:plugin/reload "Neu laden"
:plugin/restart "App neu starten"
:plugin/stars "Sterne"
:plugin/title "Titel"
:plugin/uninstall "Deinstallieren"
:plugin/unpacked "Entpackt"
:plugin/unpacked-tips "Plugin-Verzeichnis auswählen"
:plugin/update "Aktualisierung"
:plugin/update-available "Aktualisierung verfügbar"
:plugin/updating "Aktualisiere"
:plugin/up-to-date "Es ist auf dem neuesten Stand"

:plugin.install-from-file/menu-title "Aus plugins.edn installieren"
:plugin.install-from-file/title "Plugins aus plugins.edn installieren"
Expand Down Expand Up @@ -337,8 +329,6 @@

:text/image "Bild"

:tips/all-done "Alles erledigt"

:updater/new-version-install "Eine neue Version wurde heruntergeladen."
:updater/quit-and-install "Neu starten, um zu installieren"

Expand Down
23 changes: 13 additions & 10 deletions src/resources/dicts/en.edn
Expand Up @@ -113,9 +113,9 @@
:file-rn/or-select-actions-2 ". These actions are not available once you close this panel."
:file-rn/legend "🟢 Optional rename actions; 🟡 Rename action required to avoid title change; 🔴 Breaking change."
:file-rn/close-panel "Close the Panel"
:file-rn/all-action "Apply all Actions!"
:file-rn/all-action "Apply all Actions! ({1})"
:file-rn/select-format "(Developer Mode Option, Dangerous!) Select filename format"
:file-rn/rename "rename file \"{1}\" to \"{2}\""
:file-rn/rename "rename file \"\" to \"{2}\""
:file-rn/apply-rename "Apply the file rename operation"
:file-rn/suggest-rename "Action required: "
:file-rn/otherwise-breaking "Or title will become"
Expand Down Expand Up @@ -345,10 +345,10 @@
:page-search "Search in the current page"
:graph-search "Search graph"
:home "Home"
:new-page "New page"
:new-page "New page:"
:whiteboard "Whiteboard"
:whiteboards "Whiteboards"
:new-whiteboard "New whiteboard"
:new-whiteboard "New whiteboard:"
:new-graph "Add new graph"
:graph "Graph"
:graph/persist "Logseq is syncing internal status, please wait for several seconds."
Expand All @@ -357,8 +357,8 @@
:graph/save-success "Saved successfully"
:graph/save-error "Save failed"
:graph/all-graphs "All graphs"
:graph/local-graphs "Local graphs"
:graph/remote-graphs "Remote graphs"
:graph/local-graphs "Local graphs:"
:graph/remote-graphs "Remote graphs:"
:export "Export"
:export-graph "Export graph"
:export-page "Export page"
Expand All @@ -372,7 +372,7 @@
:all-pages "All pages"
:all-whiteboards "All whiteboards"
:all-files "All files"
:remove-orphaned-pages "Remove orphaned pages"
:remove-orphaned-pages "Remove orphaned pages?"
:all-journals "All journals"
:settings "Settings"
:settings-of-plugins "Plugins"
Expand All @@ -389,6 +389,7 @@
:loading-files "Loading files"
:login "Login"
:logout "Logout"
:logout-user "Logout ({1})"
:download "Download"
:language "Language"
:remove-background "Remove background"
Expand All @@ -401,11 +402,13 @@
:help/shortcut-page-title "Keyboard shortcuts"

:plugin/installed "Installed"
:plugin/installed-plugin "Installed plugin: {1}"
:plugin/not-installed "Not installed"
:plugin/installing "Installing"
:plugin/install "Install"
:plugin/reload "Reload"
:plugin/update "Update"
:plugin/update-plugin "Update plugin: {1} - {2}"
:plugin/check-update "Check update"
:plugin/check-all-updates "Check all updates"
:plugin/found-updates "New updates"
Expand All @@ -422,7 +425,7 @@
:plugin/marketplace "Marketplace"
:plugin/downloads "Downloads"
:plugin/stars "Stars"
:plugin/title "Title"
:plugin/title "Title ({1})"
:plugin/all "All"
:plugin/unpacked "Unpacked"
:plugin/delete-alert "Are you sure you want to uninstall the plugin [{1}]?"
Expand All @@ -432,7 +435,7 @@
:plugin/restart "Restart App"
:plugin/unpacked-tips "Select the plugin directory"
:plugin/contribute "✨ Write and submit new plugin"
:plugin/up-to-date "It's up to date"
:plugin/up-to-date "It's up to date {1}"
:plugin/custom-js-alert "Found the custom.js file, is it allowed to execute? (If you don't understand the content of this file, it is recommended not to allow execution, which has certain security risks.)"
:plugin/security-warning "Plugins can access your graph and your local files, issue network requests.
They can also cause data corruption or loss. We're working on proper access rules for your graphs.
Expand Down Expand Up @@ -463,7 +466,7 @@
:paginates/prev "Prev"
:paginates/next "Next"

:tips/all-done "All Done"
:tips/all-done "All Done!"

:command-palette/prompt "Type a command"
:select/default-prompt "Select one"
Expand Down

0 comments on commit 135e322

Please sign in to comment.