Add duplicate detection and fix a few from langs I know

pull/4072/head
Gabriel Horner 2022-01-28 16:04:55 -05:00
parent 827884cbb1
commit 9a644cfe90
3 changed files with 51 additions and 71 deletions

25
bb.edn
View File

@ -1,15 +1,6 @@
{:paths ["scripts/src"]
:tasks
{lang:list
logseq.tasks.lang/list-langs
lang:missing
logseq.tasks.lang/list-missing
lang:invalid-dicts
logseq.tasks.lang/invalid-dicts
dev:watch
{dev:watch
logseq.tasks.dev/watch
dev:open-dev-electron-app
@ -21,4 +12,16 @@
dev:electron-start
{:doc "Start electron dev by watching assets and opening dev app"
;; Parallel execution - https://book.babashka.org/#parallel
:task (run '-dev:electron-start {:parallel true})}}}
:task (run '-dev:electron-start {:parallel true})}
lang:list
logseq.tasks.lang/list-langs
lang:missing
logseq.tasks.lang/list-missing
lang:duplicates
logseq.tasks.lang/list-duplicates
lang:invalid-dicts
logseq.tasks.lang/invalid-dicts}}

View File

@ -42,7 +42,7 @@
dicts (get-dicts)
translated-language (dicts lang)
_ (when-not translated-language
(println "Language" lang "does not have an entry in get-dicts.cljs")
(println "Language" lang "does not have an entry in dicts.cljs")
(System/exit 1))
missing (set/difference (set (keys (dicts :en)))
(set (keys translated-language)))]
@ -56,10 +56,10 @@
task-util/print-table))))
(defn invalid-dicts
"Lists translation keys that are invalid"
"Lists translation keys that don't exist in English"
[]
(let [dicts (get-dicts)
;; For now defined as :en but clj-kondo analysis would be more thorough
;; For now defined as :en but clj-kondo analysis could be more thorough
valid-keys (set (keys (dicts :en)))
invalid-dicts
(->> (dissoc dicts :en)
@ -74,3 +74,26 @@
(println "Invalid dict keys found:")
(task-util/print-table invalid-dicts)
(System/exit 1)))))
(defn list-duplicates
"Lists translations that aren't any different than English"
[& args]
(let [dicts (get-dicts)
en-dicts (dicts :en)
lang (or (keyword (first args))
(task-util/print-usage "LOCALE"))
lang-dicts (dicts lang)
invalid-dicts
(sort-by
:invalid-key
(keep
#(when (= (en-dicts %) (lang-dicts %))
{:invalid-key %
:repeat-value (shorten (lang-dicts %) 70)})
(keys lang-dicts)))]
(if (empty? invalid-dicts)
(println "No duplicated keys found!")
(do
(println "Keys with duplicate values found:")
(task-util/print-table invalid-dicts)
(System/exit 1)))))

View File

@ -431,6 +431,7 @@
:help/fold-unfold "Blöcke ein-/ausklappen (wenn nicht im Bearbeitungsmodus)"
:help/markdown-syntax "Markdown-Syntax"
:help/org-mode-syntax "Org-Mode-Syntax"
:new-graph "Add new graph"
:bold "Fett"
:italics "Kursiv"
:html-link "Html-Link"
@ -615,14 +616,6 @@
:open-a-directory "Öffne ein lokales Verzeichnis"}
:fr {:help/about "A propos de Logseq"
:on-boarding/demo-graph "This is a demo graph, changes will not be saved until you open a local folder."
:on-boarding/add-graph "Add a graph"
:on-boarding/open-local-dir "Open a local directory"
:on-boarding/new-graph-desc-1 "Logseq supports both Markdown and Org-mode. You can open an existing directory or create a new one on your device, a directory is also known simply as a folder. Your data will be stored only on this device."
:on-boarding/new-graph-desc-2 "After you have opened your directory, it will create three folders in that directory:"
:on-boarding/new-graph-desc-3 "/journals - store your journal pages"
:on-boarding/new-graph-desc-4 "/pages - store the other pages"
:on-boarding/new-graph-desc-5 "/logseq - store configuration, custom.css, and some metadata."
:help/bug "Signaler une anomalie"
:help/feature "Demander une fonctionnalité"
:help/changelog "Journal des modifications"
@ -639,8 +632,6 @@
:help/reference-autocomplete "Autocomplétion des références à une Page"
:help/block-reference "Référence à un Bloc"
:help/key-commands "Key Commands"
:help/working-with-lists " (working with lists)"
:help/select-nfs-browser "Please use another browser (like latest chrome) which support NFS features to open local directory."
:undo "Annuler"
:redo "Redo"
:general "Général"
@ -663,9 +654,9 @@
:right-side-bar/block-ref "Référence des blocs"
:right-side-bar/journals "Journals"
:right-side-bar/graph-view "Graph view"
:right-side-bar/all-pages "All pages"
:right-side-bar/all-pages "Toutes les pages"
:right-side-bar/flashcards "Flashcards"
:right-side-bar/new-page "New page"
:right-side-bar/new-page "Nouvelle page"
:git/set-access-token "Définir un jeton d'accès personnel GitHub"
:git/token-is-encrypted "Le jeton sera chiffré et gardé dans le stockage local du navigateur (local storage)"
:git/token-server "Le serveur ne le stockera jamais"
@ -712,7 +703,6 @@
:page/make-private "Rendre la page privée"
:page/delete "Supprimer la page (supprime le fichier)"
:page/publish "Publier cette page sur Logseq"
:page/cancel-publishing "Cancel publishing on Logseq"
:page/publish-as-slide "Publier cette page en présentation sur Logseq"
:page/unpublish "Dépublier cette page de Logseq"
:page/show-journals "Afficher le Journal"
@ -722,13 +712,6 @@
: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"
@ -759,16 +742,12 @@
:content/copy-as-json "Copier au format JSON"
:content/click-to-edit "Cliquer pour éditer"
:settings-page/edit-config-edn "Editer config.edn (pour le repo actuel)"
:settings-page/git-desc "is used for pages version control, you can click the vertical three dots menu to check the page's history."
:settings-page/git-confirm "You need to restart the app after updating the Git settings."
:settings-page/git-switcher-label "Enable Git auto commit"
:settings-page/git-commit-delay "Git auto commit seconds"
:settings-page/preferred-file-format "Format de fichier préféré"
:settings-page/preferred-workflow "Workflow préféré"
:settings-page/enable-timetracking "Activer le suivi de temps des tâches"
:settings-page/dont-use-other-peoples-proxy-servers "N'utilisez pas de serveurs proxy que vous ne maîtrisez pas. Cela est très dangereux, vous pourriez vous faire voler vos jetons d'accès et vos notes. Logseq ne pourra être tenu responsable pour toute perte ou vol de données si vous utilisez des serveurs proxy. Vous pouvez également déployer Logseq vous-même, regardez "
:settings-page/custom-cors-proxy-server "CORS personnalisé pour Serveur Proxy"
:settings-page/developer-mode "Developer mode"
:settings-page/developer-mode "Le mode développeur"
:settings-page/enable-developer-mode "Activer le mode développeur"
:settings-page/disable-developer-mode "Désactiver le mode développeur"
:settings-page/developer-mode-desc "Le mode développeur aide les contributeurs et les développeurs d'extension à tester leur intégration avec Logseq."
@ -798,7 +777,6 @@
:join-community "Rejoindre la communauté"
:discord-title "Notre groupe Discord !"
:sign-out "Se déconnecter"
:help-shortcut-title "Click to check shortcuts and other tips"
:loading "Chargement en cours"
:cloning "Clonage en cours"
:parsing-files "Analyse des fichiers"
@ -1718,14 +1696,7 @@
:on-boarding/cuekeeper-desc " - Sistema de GTD (lista de tareas) basado en el navegador"
:on-boarding/sci-desc " - Intérprete compacto de Clojure"
:on-boarding/isomorphic-git-desc " - ¡Una implementación de git en JavaScript puro para node y navegadores!"
:on-boarding/demo-graph "This is a demo graph, changes will not be saved until you open a local folder."
:on-boarding/add-graph "Add a graph"
:on-boarding/open-local-dir "Open a local directory"
:on-boarding/new-graph-desc-1 "Logseq supports both Markdown and Org-mode. You can open an existing directory or create a new one on your device, a directory is also known simply as a folder. Your data will be stored only on this device."
:on-boarding/new-graph-desc-2 "After you have opened your directory, it will create three folders in that directory:"
:on-boarding/new-graph-desc-3 "/journals - store your journal pages"
:on-boarding/new-graph-desc-4 "/pages - store the other pages"
:on-boarding/new-graph-desc-5 "/logseq - store configuration, custom.css, and some metadata."
:on-boarding/add-graph "Añade un grafo"
:help/about "Acerca de Logseq"
:help/roadmap "Hoja de ruta"
:help/bug "Reportar un error"
@ -1770,11 +1741,11 @@
:right-side-bar/favorites "Favoritos"
:right-side-bar/page-graph "Vista gráfica"
:right-side-bar/block-ref "Referencia de bloque"
:right-side-bar/journals "Journals"
:right-side-bar/journals "Diarios"
:right-side-bar/graph-view "Graph view"
:right-side-bar/all-pages "All pages"
:right-side-bar/all-pages "Lista de páginas"
:right-side-bar/flashcards "Flashcards"
:right-side-bar/new-page "New page"
:right-side-bar/new-page "Nueva pagina"
:git/set-access-token "Establece el token de acceso personal de GitHub"
:git/token-is-encrypted "El token será encriptado y guardado en el almacenamiento local del navegador"
:git/token-server "El servidor nunca lo guardará"
@ -1878,10 +1849,6 @@
:content/copy-as-json "Copiar como JSON"
:content/click-to-edit "Clic para editar"
:settings-page/edit-config-edn "Editar config.edn (para este repositorio)"
:settings-page/git-desc "is used for pages version control, you can click the vertical three dots menu to check the page's history."
:settings-page/git-confirm "You need to restart the app after updating the Git settings."
:settings-page/git-switcher-label "Enable Git auto commit"
:settings-page/git-commit-delay "Git auto commit seconds"
:settings-page/show-brackets "Mostrar corchetes"
:settings-page/disable-sentry "Enviar datos de uso y diagnósticos a Logseq"
:settings-page/preferred-outdenting "Disminución lógica de sangría"
@ -2470,11 +2437,9 @@
:right-side-bar/favorites "Favoritos"
:right-side-bar/page-graph "Grafo da página"
:right-side-bar/block-ref "Referência de bloco"
:right-side-bar/journals "Journals"
:right-side-bar/graph-view "Graph view"
:right-side-bar/all-pages "All pages"
:right-side-bar/journals "Diários"
:right-side-bar/flashcards "Flashcards"
:right-side-bar/new-page "New page"
:right-side-bar/new-page "Nova página"
:git/set-access-token "Definir token de acesso pessoal do GitHub"
:git/token-is-encrypted "O token será criptografado e guardado no armazenamento local do navegador"
:git/token-server "Nunca será armazenado pelo servidor"
@ -2742,14 +2707,7 @@
:on-boarding/cuekeeper-desc " - Sistema de GTD (lista de tarefas) baseado no navegador."
:on-boarding/sci-desc " - Interpretador Compacto de Clojure"
:on-boarding/isomorphic-git-desc " - Uma implementação de git em JavaScript puro para node e navegadores!"
:on-boarding/demo-graph "This is a demo graph, changes will not be saved until you open a local folder."
:on-boarding/add-graph "Add a graph"
:on-boarding/open-local-dir "Open a local directory"
:on-boarding/new-graph-desc-1 "Logseq supports both Markdown and Org-mode. You can open an existing directory or create a new one on your device, a directory is also known simply as a folder. Your data will be stored only on this device."
:on-boarding/new-graph-desc-2 "After you have opened your directory, it will create three folders in that directory:"
:on-boarding/new-graph-desc-3 "/journals - store your journal pages"
:on-boarding/new-graph-desc-4 "/pages - store the other pages"
:on-boarding/new-graph-desc-5 "/logseq - store configuration, custom.css, and some metadata."
:on-boarding/add-graph "Adicionar grafo"
:help/start "Começar a usar"
:help/about "Sobre o Logseq"
:help/roadmap "Plano de implementação"
@ -2909,10 +2867,6 @@
:content/copy-as-json "Copiar como JSON"
:content/click-to-edit "Clicar para editar"
:settings-page/edit-config-edn "Editar config.edn para o repositório atual"
:settings-page/git-desc "is used for pages version control, you can click the vertical three dots menu to check the page's history."
:settings-page/git-confirm "You need to restart the app after updating the Git settings."
:settings-page/git-switcher-label "Enable Git auto commit"
:settings-page/git-commit-delay "Git auto commit seconds"
:settings-page/show-brackets "Mostrar parênteses rectos"
:settings-page/spell-checker "Verificador ortográfico"
:settings-page/disable-sentry "Enviar dados de utilização e diagnósticos para Logseq"