You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/packages/frontend/i18n/README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,31 @@ We discussed this internally on 2024-08-19 and came to the conclusion that we sh
82
82
- Example: translating the "Run" button in Jupyter to German or Russian, which both have more or less the meaning of "running in the street", is extremely awkward. It's also a well recognizable element, which users are used to, even without knowing what it really means. Same holds for "Kernel", which is even in English a pretty weird choice. Therefore, we do not translate elements like the "Run" button or "Kernel" for Jupyter Kernels. A "Run" menu however, in general, could be translated (e.g. in German it is called "Ausführen").
83
83
- However, what we should translate (or add) are hover text explanations. So, in the case of the "Run" button, there should be a tooltip, which explains in the current language, what this button really does.
84
84
85
+
## SimpleLocalize configuration
86
+
87
+
This is about auto-translations, in "Settings → Auto-translation":
88
+
89
+
- To start: when you add a new language, set its full code, e.g. "fr_FR", name "French" and language "French". Translation provider: OpenAI.
90
+
- You need the API key, it's in Integrations → REST API. See notes above.
91
+
- In the Auto-translate configuration, OpenAI → Configure:
92
+
93
+
- API key: a separate one to track usage, it's fine to restrict its capabilities to list and use models.
94
+
- GPT-4o
95
+
- System prompt: here, the key point is to give some context and to instruct it to retain those ICU messages. That's what I came up with after a few tests and iterations:
96
+
97
+
Translation of strings in the user-interface of the online platform "CoCalc".
98
+
99
+
Stay close to the original meaning of the source text and match the length and style. In particular, short labels of commands must stay short.
100
+
101
+
If a label ends with "...", keep those dots in the translation.
102
+
103
+
Retain the syntax of ICU formatted messages. They could contain variables like `some text {variable} more text` or conditionals like `{variable, select, option1 {...} other {...}}`.
104
+
105
+
- add description as context: Yes. (I assume this uses the "code description")
-**okText**: That's a simple string, where the English variant is defined right here. Note, that the ID of the OK text and the title are very similar.
136
161
-**cancelText**: That references a common message, which is used in many places. It's the "Cancel" text on the button. The `labels` object comes from `import { labels } from "@cocalc/frontend/i18n"`.
162
+
- There is also a tiny component as an example, for how to translate a bit via a component: `i18n/components.tsx` → `<CancelText />`
Many of those messages are actually defined in `i18n/common.ts`. There are groups of messages, e.g. `jupyter.commands`. Messages are only extracted from `*.tsx` and some `*.ts` files – check the code of `i18n/bin/extract.sh` to see what's going on. This file is accompanied by `i18n.test.ts`, which checks the prefixes of all IDs!
"new.file-type-page.header.description": "Was möchten Sie erstellen? Dokumente können gleichzeitig von mehreren Personen bearbeitet werden, führen eine vollständige <A>TimeTravel-Historie</A> der Änderungen und unterstützen die Auswertung von Code.",
266
+
"new.file-type-page.header.description": "Was möchten Sie erstellen? Dokumente können gleichzeitig von mehreren Personen bearbeitet werden, führen eine vollständige <A>ZeitReise-Historie</A> der Änderungen und unterstützen die Auswertung von Code.",
264
267
"new.file-type-page.header.intro": "Benennen Sie Ihre Datei, Ihren Ordner oder fügen Sie einen Link ein. Beenden Sie den Namen mit /, um einen Ordner zu erstellen.",
265
268
"new.file-type-selector.folder.tooltip": "Erstellen Sie einen Ordner (Unterverzeichnis), in dem Sie Ihre Dateien speichern und organisieren können. CoCalc bietet ein voll ausgestattetes Dateisystem. Sie können auch einen Pfad im obigen Eingabefeld eingeben, der mit einem Schrägstrich / endet, und die Eingabetaste drücken.",
266
269
"new.file-type-selector.latex.tooltip": "Erstellen Sie ein technisches Papier in professioneller Qualität, das anspruchsvolle mathematische Formeln enthält und Python-, R- und Sage-Code ausführen kann.",
0 commit comments