From a8d3169ebb7f8605bfe958738a72d7e1eb73c001 Mon Sep 17 00:00:00 2001 From: Jon Eugster Date: Sat, 6 Apr 2024 15:25:31 +0200 Subject: [PATCH] add some translation keys --- client/i18next-scanner.config.cjs | 1 + client/public/locales/de/translation.json | 12 ++++++------ client/public/locales/en/translation.json | 11 ++++++----- client/public/locales/zh/translation.json | 9 +++++---- client/src/components/infoview/main.tsx | 9 +++++---- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/client/i18next-scanner.config.cjs b/client/i18next-scanner.config.cjs index 39429b0..e658b99 100644 --- a/client/i18next-scanner.config.cjs +++ b/client/i18next-scanner.config.cjs @@ -78,6 +78,7 @@ module.exports = { ], options: { debug: true, + removeUnusedKeys: true, func: { list: ['i18next.t', 'i18n.t', 't'], extensions: ['.js', '.jsx'] // not .ts or .tsx since we use i18next-scanner-typescript! diff --git a/client/public/locales/de/translation.json b/client/public/locales/de/translation.json index 7eab79f..9efb4cd 100644 --- a/client/public/locales/de/translation.json +++ b/client/public/locales/de/translation.json @@ -50,7 +50,6 @@ "Waiting for Lean server to start…": "Warte auf das Starten des Lean-Servers…", "Level completed! 🎉": "Level gelöst! 🎉", "Level completed with warnings 🎭": "Level mit Warnungen abgeschlossen 🎭", - "Retry proof from here": "Von hier erneut probieren", "Active Goal": "Aktuelles Goal", "Crashed! Go to editor mode and fix your proof! Last server response:": "", "Line": "Zeile", @@ -59,15 +58,11 @@ "Execute": "Ausführen", "Definitions": "Definitionen", "Theorems": "Theoreme", - "locked": "nicht verfügbar", - "disabled": "gesperrt", - "new": "neu", "Not unlocked yet": "Noch nicht verfügbar", "Not available in this level": "In diesem Level nicht verfügbar", "A repository of learning games for the proof assistant <1>Lean (Lean 4) and its mathematical library <5>mathlib": "Eine Sammlung von Lernspielen für den Beweisassistenten <1>Lean (Lean 4) und dessen mathematische Bibliothek <5>mathlib", "No Games loaded. Use <1>http://localhost:3000/#/g/local/FOLDER to open a game directly from a local folder.": "Kein Spiel geladen. öffne <1>http://localhost:3000/#/g/local/FOLDER um ein Spiel direkt von einem lokalen Ordner zu laden.", "

As this server runs lean on our university machines, it has a limited capacity. Our current estimate is about 70 simultaneous games. We hope to address and test this limitation better in the future.

<1>Most aspects of the games and the infrastructure are still in development. Feel free to file a <1>GitHub Issue about any problems you experience!": "", - "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we-ll happily add yours.

": "", "This server has been developed as part of the project <1>ADAM : Anticipating the Digital Age of Mathematics at Heinrich-Heine-Universität in Düsseldorf.": "", "Prerequisites": "Voraussetzungen", "Worlds": "Welten", @@ -90,5 +85,10 @@ "Mobile": "Mobil", "Auto": "Auto", "Desktop": "Desktop", - "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we'll happily add yours.

": "" + "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we'll happily add yours.

": "", + "Level": "", + "Introduction": "", + "Retry proof from here": "", + "Retry": "", + "Failed command": "" } diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index f1a92b6..68666a6 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -50,7 +50,6 @@ "Waiting for Lean server to start…": "Waiting for Lean server to start…", "Level completed! 🎉": "Level completed! 🎉", "Level completed with warnings 🎭": "Level completed with warnings 🎭", - "Retry proof from here": "Retry proof from here", "Active Goal": "Active Goal", "Crashed! Go to editor mode and fix your proof! Last server response:": "Crashed! Go to editor mode and fix your proof! Last server response:", "Line": "Line", @@ -59,9 +58,6 @@ "Execute": "Execute", "Definitions": "Definitions", "Theorems": "Theorems", - "locked": "locked", - "disabled": "disabled", - "new": "new", "Not unlocked yet": "Not unlocked yet", "Not available in this level": "Not available in this level", "A repository of learning games for the proof assistant <1>Lean (Lean 4) and its mathematical library <5>mathlib": "A repository of learning games for the proof assistant <1>Lean (Lean 4) and its mathematical library <5>mathlib", @@ -89,5 +85,10 @@ "Mobile": "Mobile", "Auto": "Auto", "Desktop": "Desktop", - "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we'll happily add yours.

": "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we'll happily add yours.

" + "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we'll happily add yours.

": "<0>If you are considering writing your own game, you should use the <1>GameSkeleton Github Repo as a template and read <3>How to Create a Game.<1>You can directly load your games into the server and play it using the correct URL. The <1>instructions above also explain the details for how to load your game to the server. We'd like to encourage you to contact us if you have any questions.

Featured games on this page are added manually. Please get in contact and we'll happily add yours.

", + "Level": "Level", + "Introduction": "Introduction", + "Retry proof from here": "Retry proof from here", + "Retry": "Retry", + "Failed command": "Failed command" } diff --git a/client/public/locales/zh/translation.json b/client/public/locales/zh/translation.json index b6f6179..fe33128 100644 --- a/client/public/locales/zh/translation.json +++ b/client/public/locales/zh/translation.json @@ -59,9 +59,6 @@ "Execute": "执行", "Definitions": "定义", "Theorems": "定理", - "locked": "锁定中", - "disabled": "已禁用", - "new": "新建", "Not unlocked yet": "尚未解锁", "Not available in this level": "本关卡不提供", "A repository of learning games for the proof assistant <1>Lean (Lean 4) and its mathematical library <5>mathlib": "", @@ -89,5 +86,9 @@ "Load selected file": "加载所选文件", "Mobile": "移动端", "Auto": "自动", - "Desktop": "桌面端" + "Desktop": "桌面端", + "Level": "", + "Introduction": "", + "Retry": "", + "Failed command": "" } diff --git a/client/src/components/infoview/main.tsx b/client/src/components/infoview/main.tsx index 244f7e9..1161652 100644 --- a/client/src/components/infoview/main.tsx +++ b/client/src/components/infoview/main.tsx @@ -265,9 +265,10 @@ const goalFilter = { showLetValue: true } -// TODD: Mark for translation! /** The display of a single entered lean command */ function Command({ proof, i, deleteProof }: { proof: ProofState, i: number, deleteProof: any }) { + let {t} = useTranslation() + // The first step will always have an empty command if (!proof?.steps[i]?.command) { return <> } @@ -275,13 +276,13 @@ function Command({ proof, i, deleteProof }: { proof: ProofState, i: number, dele // If the last step has errors, we display the command in a different style // indicating that it will be removed on the next try. return
- Failed command: {proof?.steps[i].command} + {t("Failed command")}: {proof?.steps[i].command}
} else { return
{proof?.steps[i].command}
-
}