diff --git a/docs/dev-practices.md b/docs/dev-practices.md index 33fed9099..dbf56b71e 100644 --- a/docs/dev-practices.md +++ b/docs/dev-practices.md @@ -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 diff --git a/src/main/frontend/components/bug_report.cljs b/src/main/frontend/components/bug_report.cljs index 1b036870c..ebf398819 100644 --- a/src/main/frontend/components/bug_report.cljs +++ b/src/main/frontend/components/bug_report.cljs @@ -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))])) diff --git a/src/main/frontend/handler/events.cljs b/src/main/frontend/handler/events.cljs index b8dd6b117..4e72503dd 100644 --- a/src/main/frontend/handler/events.cljs +++ b/src/main/frontend/handler/events.cljs @@ -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) diff --git a/src/resources/dicts/en.edn b/src/resources/dicts/en.edn index 03cf6a8a1..3c5ab37aa 100644 --- a/src/resources/dicts/en.edn +++ b/src/resources/dicts/en.edn @@ -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" diff --git a/src/resources/dicts/zh-cn.edn b/src/resources/dicts/zh-cn.edn index d9db4b3c7..f7c9c3f82 100644 --- a/src/resources/dicts/zh-cn.edn +++ b/src/resources/dicts/zh-cn.edn @@ -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 "提交"