# csc207-2026f-uoft/lostintranslation architecture

> Architecture diagram of the GitHub repository csc207-2026f-uoft/lostintranslation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/csc207-2026f-uoft/lostintranslation
- Repository: https://github.com/csc207-2026f-uoft/lostintranslation

## Overview

This is a Java country-name translation application: users select a country and language, then see the translation in a GUI. The documented workflow uses a Translator service and country/language code converters to present readable names instead of codes; the JSON data supplies translations, while tab-delimited files map names to codes. The README names CanadaTranslator as a translation task and describes JSONTranslator-related data, but source excerpts were not provided, so implementation-specific calls and data-loading details remain unverified.

Main entry points: [`src/main/java/translation/GUI.java`](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/GUI.java) (Translation GUI), [`src/main/java/translation/Translator.java`](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/Translator.java) (Translator service), [`src/main/java/translation/JSONTranslator.java`](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/JSONTranslator.java) (JSON translator), [`src/main/java/translation/CountryCodeConverter.java`](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/CountryCodeConverter.java) (Country code converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_gui["Translation GUI<br/>[GUI.java]"]
end

subgraph group_translation["Translation services"]
  node_translator["Translator service<br/>[Translator.java]"]
  node_json_translator["JSON translator"]
  node_canada_translator["Canada translator"]
  node_country_converter["Country code converter"]
  node_language_converter["Language code converter"]
end

subgraph group_data["Reference data"]
  node_sample_json["Translation data<br/>[sample.json]"]
  node_country_codes["Country mappings<br/>[country-codes.txt]"]
  node_language_codes["Language mappings<br/>[language-codes.txt]"]
end

node_user(("User"))

node_user -->|"selects country and language"| node_gui
node_gui -->|"uses service"| node_translator
node_gui -->|"uses converter"| node_country_converter
node_gui -->|"uses converter"| node_language_converter
node_country_converter -->|"maps country codes"| node_country_codes
node_language_converter -->|"maps language codes"| node_language_codes
node_json_translator -->|"uses translation data"| node_sample_json
node_json_translator -.->|"implements service"| node_translator
node_canada_translator -.->|"implements service"| node_translator

click node_gui "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/GUI.java"
click node_translator "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/Translator.java"
click node_json_translator "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/JSONTranslator.java"
click node_canada_translator "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/CanadaTranslator.java"
click node_country_converter "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/CountryCodeConverter.java"
click node_language_converter "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/LanguageCodeConverter.java"
click node_sample_json "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/resources/sample.json"
click node_country_codes "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/resources/country-codes.txt"
click node_language_codes "https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/resources/language-codes.txt"

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_gui,node_user toneBlue
class node_translator,node_json_translator,node_canada_translator,node_country_converter,node_language_converter toneAmber
class node_sample_json,node_country_codes,node_language_codes toneMint
```

## Components

### User interface

- [Translation GUI](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/GUI.java): `src/main/java/translation/GUI.java`

### Translation services

- [Translator service](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/Translator.java): `src/main/java/translation/Translator.java`
- [JSON translator](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/JSONTranslator.java): `src/main/java/translation/JSONTranslator.java`
- [Canada translator](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/CanadaTranslator.java): `src/main/java/translation/CanadaTranslator.java`
- [Country code converter](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/CountryCodeConverter.java): `src/main/java/translation/CountryCodeConverter.java`
- [Language code converter](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/java/translation/LanguageCodeConverter.java): `src/main/java/translation/LanguageCodeConverter.java`

### Reference data

- [Translation data](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/resources/sample.json): `src/main/resources/sample.json`
- [Country mappings](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/resources/country-codes.txt): `src/main/resources/country-codes.txt`
- [Language mappings](https://github.com/csc207-2026f-uoft/lostintranslation/blob/main/src/main/resources/language-codes.txt): `src/main/resources/language-codes.txt`

### Other components

- **User**

## Connections

- User → Translation GUI: selects country and language (evidence: `README.md`)
- Translation GUI → Translator service: uses service (evidence: `README.md`)
- Translation GUI → Country code converter: uses converter (evidence: `README.md`)
- Translation GUI → Language code converter: uses converter (evidence: `README.md`)
- Country code converter → Country mappings: maps country codes (evidence: `README.md`)
- Language code converter → Language mappings: maps language codes (evidence: `README.md`)
- JSON translator → Translation data: uses translation data (evidence: `README.md`)
- JSON translator → Translator service: implements service
- Canada translator → Translator service: implements service
