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
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,10 +67,13 @@ CoCalc specific rules for implementing translations, of which I think are good t
67
67
-**Explicit ID**: Technically, the ID is optional. Then it is computed as a hash upon extraction. However, this has two negative sides:
68
68
- If the message changes, it's hash changes, and you have to start over with the translation. This is good from an idealistic standpoint, but if you just tweak a word or correct a typo, the existing translations are still ok. If the meaning changes completely, it's better to create a new ID. (Of course, changes to the `defaultMessage` need to go through the `extract → upload` step, except that the English translation uses the `defaultMessage` directly.)
69
69
- Sorting: All the translations and also online tools like SimpleLocalize sort the translations by their keys. Look at the translated `i18n/de_DE.json` and you'll see that messages that are related are also next to each other. This also makes it possible to filter for a specific
70
+
- Never reference an ID directly – always reference the object of the "defined message", such that label changes (for updating the translation) or typos do not cause problems.
71
+
- Extracting the IDs check for duplicates, so, no worries about that.
70
72
- Pitfall **No variables in properties**: I think the extraction process does not know how to deal with variables, when extracting strings from properties. So, either define the message objects elsewhere (like it is done with `labels`) or write a multiline string in place. See the examples below for what works.
71
73
-**No `en` translation**: English is the default. The `defaultMessage` is already in the code. We do not download the supposedly translated `en` file and just let the fallback mechanism kick in. This also means that changes to the `defaultMessage` will show up with the next build, even without touching any of the translations.
72
74
-**richTextElements**: in `app/localize.tsx`, a few default `richTextElements` are defined – just for convenience. Anchor tags must be defined individually, because link text and href can't be wrapped that way.
73
75
-**Query parameter**: A new `?lang=en` (or `=de`, `=zh`, ...) query parameters lets you change the language as well. This also changes the account setting. Hence, a URL with `?lang=en` can be used to reset the account setting to English.
76
+
-**Descriptions**: add descriptions, especially for jupyter notebooks or latex, to add more context. The description is not only shown in the translation tool, but also passed on to the language model doing the automatic translations.
description: "Continue running the Kernel of a Jupyter Notebook",
646
+
},
647
+
halt_kernel_menu: {
648
+
id: "jupyter.commands.halt_kernel_menu.menu",
649
+
defaultMessage: "Halt kernel...",
650
+
description: "Halting a Kernel of a Jupyter Notebook",
651
+
},
652
+
validate_label: {
653
+
id: "jupyter.commands.validate.label",
654
+
defaultMessage: "Validate",
655
+
description: "Validate a Jupyter Notebook",
656
+
},
657
+
validate_tooltip: {
658
+
id: "jupyter.commands.validate.tooltip",
659
+
defaultMessage:
660
+
"Restart Jupyter Notebook and run all cells to validate that it works.",
661
+
description: "Validate a Jupyter Notebook",
662
+
},
663
+
validate_title: {
664
+
id: "jupyter.commands.validate.title",
665
+
defaultMessage: "Validate notebook?",
666
+
description: "Validate a Jupyter Notebook",
667
+
},
668
+
validate_body: {
669
+
id: "jupyter.commands.validate.body",
670
+
defaultMessage:
671
+
"Validating the notebook will restart the kernel and run all cells in order, even those with errors. This will ensure that all output is exactly what results from running all cells in order.",
672
+
description: "Validate a Jupyter Notebook",
673
+
},
674
+
refresh_kernels: {
675
+
id: "jupyter.commands.refresh_kernels",
676
+
defaultMessage: "Refresh Kernel List",
677
+
description: "Reload list of all Kernels for Jupyter Notebooks",
678
+
},
679
+
refresh_kernels_tooltip: {
680
+
id: "jupyter.commands.refresh_kernels.tooltip",
681
+
defaultMessage:
682
+
"Reload list of all available Kernels for running Jupyter Notebooks",
683
+
},
684
+
run_all_cells_menu: {
685
+
id: "jupyter.commands.run_all_cells.menu",
686
+
defaultMessage: "Run All Cells",
687
+
description: "Run all cells in a Jupyter Notebook",
688
+
},
689
+
run_all_cells_above_menu: {
690
+
id: "jupyter.commands.run_all_cells_above.menu",
691
+
defaultMessage: "Run All Above Selected Cell",
692
+
description: "Run all cells above selected cell in a Jupyter Notebook",
693
+
},
694
+
run_all_cells_below_menu: {
695
+
id: "jupyter.commands.run_all_cells_below.menu",
696
+
defaultMessage: "Run Selected Cell and All Below",
697
+
description:
698
+
"Run selected cell and all cells below selected cell in a Jupyter Notebook",
0 commit comments