Bladeren bron

Address remaining feedback for #9801 and #9757

Also add more explicit translation guidance for reviewers
Gabriel Horner 2 jaren geleden
bovenliggende
commit
25c8cfc6ab

+ 18 - 5
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).
-
-Punctuation and delimiting characters (e.g. `:`, `:`, `?`) should be part of the translatable string.
-Those characters and their position may vary depending on the language.
+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.
+
+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
 

+ 4 - 2
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))]))
 

+ 2 - 1
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)

+ 0 - 1
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"

+ 0 - 1
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 "提交"