Address remaining feedback for #9801 and #9757

Also add more explicit translation guidance for reviewers
pull/9813/head
Gabriel Horner 2023-07-05 10:58:19 -04:00
parent 64cf564183
commit 25c8cfc6ab
5 changed files with 23 additions and 9 deletions

View File

@ -74,11 +74,24 @@ error if it detects an invalid query.
### Translations
Our translations can be configured incorrectly. We can catch some of these
mistakes [as noted here](./contributing-to-translations.md#fix-mistakes).
We use [tongue](https://github.com/tonsky/tongue), a simple and effective
library, for translations. We have a couple bb tasks for working with
translations under `lang:` e.g. `bb lang:list`. See [the translator
guide](./contributing-to-translations.md) for usage.
Punctuation and delimiting characters (e.g. `:`, `:`, `?`) should be part of the translatable string.
Those characters and their position may vary depending on the language.
One useful task for reviewers (us) and contributors alike, is `bb
lang:validate-translations` which catches [common
mistakes](./contributing-to-translations.md#fix-mistakes)). When reviewing
translations here are some things to keep in mind:
* Punctuation and delimiting characters (e.g. `:`, `:`, `?`) should be part of
the translatable string. Those characters and their position may vary depending on the language.
* Translations usually return strings but they can return hiccup vectors with a
fn translation. Hiccup vectors are needed when word order matters for a
translation and formatting is involved. See [this 3 word Turkish
example](https://github.com/logseq/logseq/commit/1d932f07c4a0aad44606da6df03a432fe8421480#r118971415).
* Translations can have arguments for interpolating strings. When they do, be
sure translators are using them correctly.
### Spell Checker

View File

@ -84,8 +84,10 @@
[route-match]
(let [name (get-in route-match [:parameters :path :tool])]
[:div.flex.flex-col ;; container
[:h1.text-2xl.mx-auto.mb-4 (ui/icon "clipboard") " " (-> (t :bug-report/clipboard-inspector-title) (string/capitalize))]
(cond ;; TODO any fallback?
(cond
(= name "clipboard-data-inspector")
[:h1.text-2xl.mx-auto.mb-4 (ui/icon "clipboard") " " (-> (t :bug-report/clipboard-inspector-title) (string/capitalize))])
(cond
(= name "clipboard-data-inspector")
(clipboard-data-inspector))]))

View File

@ -271,8 +271,9 @@
(not (mobile-util/native-platform?)))
(fn [close-fn]
[:div
;; TODO: fn translation with args
[:p
(t :settings-permission/grant-permission)
"Grant native filesystem permission for directory: "
[:b (config/get-local-dir repo)]]
(ui/button
(t :settings-permission/start-granting)

View File

@ -340,7 +340,6 @@
:settings-page/update-available "Found new release "
:settings-page/update-error-1 "⚠️ Oops, Something Went Wrong!"
:settings-page/update-error-2 " Please check out the "
:settings-permission/grant-permission "Grant native filesystem permission for directory: "
:settings-permission/start-granting "Grant"
:yes "Yes"

View File

@ -246,7 +246,6 @@
:settings-page/custom-global-configuration "自定义全局配置"
:settings-page/edit-global-config-edn "编辑全局 config.edn"
:settings-page/sync "同步"
:settings-permission/grant-permission "授权访问本地目录: "
:settings-permission/start-granting "开始授权"
:yes "是"
:submit "提交"