Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(mermaid): use translations for sample names
Elian Dorana6b89cfa3087
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex eea9ef2b44..7a91c831af 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2204,6 +2204,28 @@"more_info": "Learn more"},"mermaid": {- "sample_diagrams": "Sample diagrams:"+ "sample_diagrams": "Sample diagrams:",+ "sample_flowchart": "Flowchart",+ "sample_class": "Class",+ "sample_sequence": "Sequence",+ "sample_entity_relationship": "Entity Relationship",+ "sample_state": "State",+ "sample_mindmap": "Mindmap",+ "sample_architecture": "Architecture",+ "sample_block": "Block",+ "sample_c4": "C4",+ "sample_gantt": "Gantt",+ "sample_git": "Git",+ "sample_kanban": "Kanban",+ "sample_packet": "Packet",+ "sample_pie": "Pie",+ "sample_quadrant": "Quadrant",+ "sample_radar": "Radar",+ "sample_requirement": "Requirement",+ "sample_sankey": "Sankey",+ "sample_timeline": "Timeline",+ "sample_treemap": "Treemap",+ "sample_user_journey": "User Journey",+ "sample_xy": "XY"}}diff --git a/apps/client/src/widgets/type_widgets/mermaid/sample_diagrams.ts b/apps/client/src/widgets/type_widgets/mermaid/sample_diagrams.tsindex 11833e5535..732cbb54bc 100644--- a/apps/client/src/widgets/type_widgets/mermaid/sample_diagrams.ts+++ b/apps/client/src/widgets/type_widgets/mermaid/sample_diagrams.ts@@ -1,8 +1,9 @@+import { t } from "../../../services/i18n";import type { NoteContentTemplate } from "../../layout/NoteContentSwitcher";const SAMPLE_DIAGRAMS: NoteContentTemplate[] = [{- name: "Flowchart",+ name: t("mermaid.sample_flowchart"),content: `\flowchart TDA[Christmas] -->|Get money| B(Go shopping)@@ -13,7 +14,7 @@ flowchart TD`},{- name: "Class",+ name: t("mermaid.sample_class"),content: `\classDiagramAnimal <|-- Duck@@ -39,7 +40,7 @@ classDiagram`},{- name: "Sequence",+ name: t("mermaid.sample_sequence"),content: `\sequenceDiagramAlice->>+John: Hello John, how are you?@@ -49,7 +50,7 @@ sequenceDiagram`},{- name: "Entity Relationship",+ name: t("mermaid.sample_entity_relationship"),content: `\erDiagramCUSTOMER ||--o{ ORDER : places@@ -77,7 +78,7 @@ erDiagram`},{- name: "State",+ name: t("mermaid.sample_state"),content: `\stateDiagram-v2[*] --> Still@@ -89,7 +90,7 @@ stateDiagram-v2`},{- name: "Mindmap",+ name: t("mermaid.sample_mindmap"),content: `\mindmaproot((mindmap))@@ -111,7 +112,7 @@ mindmap`},{- name: "Architecture",+ name: t("mermaid.sample_architecture"),content: `\architecture-betagroup api(cloud)[API]@@ -127,7 +128,7 @@ architecture-beta`},{- name: "Block",+ name: t("mermaid.sample_block"),content: `\block-betacolumns 1@@ -146,7 +147,7 @@ columns 1`},{- name: "C4",+ name: t("mermaid.sample_c4"),content: `\C4Contexttitle System Context diagram for Internet Banking System@@ -184,7 +185,7 @@ C4Context`},{- name: "Gantt",+ name: t("mermaid.sample_gantt"),content: `\gantttitle A Gantt Diagram@@ -198,7 +199,7 @@ gantt`},{- name: "Git",+ name: t("mermaid.sample_git"),content: `\gitGraphcommit@@ -218,7 +219,7 @@ gitGraph`},{- name: "Kanban",+ name: t("mermaid.sample_kanban"),content: `\---config:@@ -246,7 +247,7 @@ kanban`},{- name: "Packet",+ name: t("mermaid.sample_packet"),content: `\---title: "TCP Packet"@@ -272,7 +273,7 @@ packet`},{- name: "Pie",+ name: t("mermaid.sample_pie"),content: `\pie title Pets adopted by volunteers"Dogs" : 386@@ -281,7 +282,7 @@ pie title Pets adopted by volunteers`},{- name: "Quadrant",+ name: t("mermaid.sample_quadrant"),content: `\quadrantCharttitle Reach and engagement of campaigns@@ -300,7 +301,7 @@ quadrantChart`},{- name: "Radar",+ name: t("mermaid.sample_radar"),content: `\---title: "Grades"@@ -316,7 +317,7 @@ radar-beta`},{- name: "Requirement",+ name: t("mermaid.sample_requirement"),content: `\requirementDiagram@@ -335,7 +336,7 @@ requirementDiagram`},{- name: "Sankey",+ name: t("mermaid.sample_sankey"),content: `\---config:@@ -415,7 +416,7 @@ Wind,Electricity grid,289.366`},{- name: "Timeline",+ name: t("mermaid.sample_timeline"),content: `\timelinetitle History of Social Media Platform@@ -427,7 +428,7 @@ timeline`},{- name: "Treemap",+ name: t("mermaid.sample_treemap"),content: `\treemap-beta"Section 1"@@ -440,7 +441,7 @@ treemap-beta`},{- name: "User Journey",+ name: t("mermaid.sample_user_journey"),content: `\journeytitle My working day@@ -454,7 +455,7 @@ journey`},{- name: "XY",+ name: t("mermaid.sample_xy"),content: `\xychart-betatitle "Sales Revenue"