# platykalt/corsu architecture

> Architecture diagram of the GitHub repository platykalt/corsu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/platykalt/corsu
- Repository: https://github.com/platykalt/corsu

## Overview

Corsu is a local Corsican interface-translation overlay for desktop software. The main workflow is: a user opens Corsu Setup, chooses components, and the installer applies reversible changes; browser, KDE, and terminal integrations then expose translated interfaces. Separate branches cover the Discord plugin and Keyman word prediction. The excerpts show the setup-to-installer handoff and Discord plugin dispatch; some component relationships are documented only by the README or source index, so uncertain links are omitted.

Main entry points: [`src/corsu.py`](https://github.com/platykalt/corsu/blob/main/src/corsu.py) (Overlay management), [`src/app.py`](https://github.com/platykalt/corsu/blob/main/src/app.py) (Corsu Setup), [`src/installer.py`](https://github.com/platykalt/corsu/blob/main/src/installer.py) (Component installer), [`src/chromium.py`](https://github.com/platykalt/corsu/blob/main/src/chromium.py) (Chromium browser packs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Setup and install"]
  node_setup_ui["Corsu Setup<br/>[app.py]"]
  node_installer["Component installer<br/>[installer.py]"]
end

subgraph group_desktop["Desktop translation"]
  node_overlay["Overlay management<br/>[corsu.py]"]
  node_browser_packs["Chromium browser packs<br/>[chromium.py]"]
  node_other_desktop["Firefox, KDE, terminal<br/>[corsu.py]"]
end

subgraph group_discord["Discord translation"]
  node_discord_plugin["Discord plugin<br/>[index.ts]"]
  node_discord_translation["Discord UI translator<br/>[translate.ts]"]
end

subgraph group_language["Translation resources"]
  node_translation_engine["Translation engine<br/>[engine.py]"]
  node_lexicon["Translation lexicons<br/>[lexicon.tsv]"]
  node_keyman_model["Keyman prediction model"]
  node_translation_import["Upstream translation import"]
end

node_user(("Computer user"))
node_browser_apps["Chromium browsers"]
node_desktop_apps["Firefox, KDE, terminal"]
node_discord["Discord client"]
node_keyman_users(("Keyman users"))

node_user -->|"opens and configures"| node_setup_ui
node_setup_ui -->|"launches if absent"| node_installer
node_setup_ui -->|"toggles components"| node_overlay
node_installer -->|"installs components"| node_overlay
node_installer -->|"installs browser support"| node_browser_packs
node_overlay -.->|"translates labels"| node_translation_engine
node_browser_packs -.->|"translates pack entries"| node_translation_engine
node_browser_packs -->|"rewrites language packs"| node_browser_apps
node_overlay -.->|"changes interface files"| node_desktop_apps
node_discord_plugin -->|"creates and starts"| node_discord_translation
node_discord_translation -->|"translates UI text"| node_discord
node_keyman_users -->|"uses predictions"| node_keyman_model
node_translation_import -->|"imports translations"| node_lexicon
node_translation_engine -.->|"looks up phrases"| node_lexicon

click node_setup_ui "https://github.com/platykalt/corsu/blob/main/src/app.py"
click node_installer "https://github.com/platykalt/corsu/blob/main/src/installer.py"
click node_overlay "https://github.com/platykalt/corsu/blob/main/src/corsu.py"
click node_translation_engine "https://github.com/platykalt/corsu/blob/main/src/engine.py"
click node_lexicon "https://github.com/platykalt/corsu/blob/main/lexicon/lexicon.tsv"
click node_browser_packs "https://github.com/platykalt/corsu/blob/main/src/chromium.py"
click node_other_desktop "https://github.com/platykalt/corsu/blob/main/src/corsu.py"
click node_discord_plugin "https://github.com/platykalt/corsu/blob/main/src/discord-plugin/index.ts"
click node_discord_translation "https://github.com/platykalt/corsu/blob/main/src/discord-plugin/translate.ts"
click node_keyman_model "https://github.com/platykalt/corsu/blob/main/keyboard/platykalt.co.corsu/source/platykalt.co.corsu.model.ts"
click node_translation_import "https://github.com/platykalt/corsu/blob/main/tools/import_translations.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_setup_ui,node_installer,node_user,node_browser_apps,node_discord,node_keyman_users toneBlue
class node_overlay,node_browser_packs,node_other_desktop toneAmber
class node_discord_plugin,node_discord_translation toneMint
class node_translation_engine,node_lexicon,node_keyman_model,node_translation_import toneRose
class node_desktop_apps toneIndigo
```

## Components

### Setup and install

- [Corsu Setup](https://github.com/platykalt/corsu/blob/main/src/app.py): `src/app.py`
- [Component installer](https://github.com/platykalt/corsu/blob/main/src/installer.py): `src/installer.py`

### Desktop translation

- [Overlay management](https://github.com/platykalt/corsu/blob/main/src/corsu.py): `src/corsu.py`
- [Chromium browser packs](https://github.com/platykalt/corsu/blob/main/src/chromium.py): `src/chromium.py`
- [Firefox, KDE, terminal](https://github.com/platykalt/corsu/blob/main/src/corsu.py): `src/corsu.py`

### Discord translation

- [Discord plugin](https://github.com/platykalt/corsu/blob/main/src/discord-plugin/index.ts): `src/discord-plugin/index.ts`
- [Discord UI translator](https://github.com/platykalt/corsu/blob/main/src/discord-plugin/translate.ts): `src/discord-plugin/translate.ts`

### Translation resources

- [Translation engine](https://github.com/platykalt/corsu/blob/main/src/engine.py): `src/engine.py`
- [Translation lexicons](https://github.com/platykalt/corsu/blob/main/lexicon/lexicon.tsv): `lexicon/lexicon.tsv`
- [Keyman prediction model](https://github.com/platykalt/corsu/blob/main/keyboard/platykalt.co.corsu/source/platykalt.co.corsu.model.ts): `keyboard/platykalt.co.corsu/source/platykalt.co.corsu.model.ts`
- [Upstream translation import](https://github.com/platykalt/corsu/blob/main/tools/import_translations.py): `tools/import_translations.py`

### Other components

- **Computer user**
- **Chromium browsers**
- **Firefox, KDE, terminal**
- **Discord client**
- **Keyman users**

## Connections

- Computer user → Corsu Setup: opens and configures (evidence: `README.md`)
- Corsu Setup → Component installer: launches if absent (evidence: `src/app.py`)
- Corsu Setup → Overlay management: toggles components (evidence: `src/app.py`)
- Component installer → Overlay management: installs components (evidence: `src/installer.py`)
- Component installer → Chromium browser packs: installs browser support (evidence: `src/installer.py`)
- Overlay management → Translation engine: translates labels (evidence: `src/corsu.py`)
- Chromium browser packs → Translation engine: translates pack entries (evidence: `src/chromium.py`)
- Chromium browser packs → Chromium browsers: rewrites language packs (evidence: `src/chromium.py`)
- Overlay management → Firefox, KDE, terminal: changes interface files
- Discord plugin → Discord UI translator: creates and starts (evidence: `src/discord-plugin/index.ts`)
- Discord UI translator → Discord client: translates UI text (evidence: `src/discord-plugin/translate.ts`)
- Keyman users → Keyman prediction model: uses predictions (evidence: `README.md`)
- Upstream translation import → Translation lexicons: imports translations (evidence: `tools/import_translations.py`)
- Translation engine → Translation lexicons: looks up phrases
