Merge branch 'chore/42-translate-multiple-client-components-to-english' into 'main'

Chore/42 translate multiple client components to english

Closes #42

See merge request cs108-fs26/Gruppe-13!69
This commit was merged in pull request #225.
This commit is contained in:
Jona Walpert
2026-04-01 12:26:50 +00:00
5 changed files with 34 additions and 34 deletions
@@ -10,15 +10,15 @@ import org.apache.logging.log4j.Logger;
/** /**
* Entry point for the Casono client application. Handles client startup and connection parameters. * Entry point for the Casono client application. Handles client startup and connection parameters.
* *
* <p>Standardkonstruktor für die Anwendung. * <p>Default constructor for the application.
*/ */
public class ClientApp { public class ClientApp {
private static final Logger LOGGER = LogManager.getLogger(ClientApp.class); private static final Logger LOGGER = LogManager.getLogger(ClientApp.class);
/** Standardkonstruktor. */ /** Default constructor. */
public ClientApp() { public ClientApp() {
// Standardkonstruktor // Default constructor
} }
/** /**
@@ -6,13 +6,13 @@ import javafx.application.Application;
/** /**
* Launcher for the Casono main UI. * Launcher for the Casono main UI.
* *
* <p>Standardkonstruktor für die Anwendung. * <p>Default constructor for the application.
*/ */
public class Launcher { public class Launcher {
/** Standardkonstruktor. */ /** Default constructor. */
public Launcher() { public Launcher() {
// Standardkonstruktor // Default constructor
} }
/** /**
@@ -10,13 +10,13 @@ import javafx.stage.Stage;
/** /**
* JavaFX Application class for the Casono main UI. * JavaFX Application class for the Casono main UI.
* *
* <p>Standardkonstruktor für die Anwendung. * <p>Default constructor for the application.
*/ */
public class Casinomainui extends Application { public class Casinomainui extends Application {
/** Standardkonstruktor. */ /** Default constructor. */
public Casinomainui() { public Casinomainui() {
// Standardkonstruktor // Default constructor
} }
private static final int SCENE_WIDTH = 1200; private static final int SCENE_WIDTH = 1200;
@@ -58,7 +58,7 @@ public class CasinomainuiController {
@FXML @FXML
public void handleCreateLobbyButton() { public void handleCreateLobbyButton() {
if (translationManager.isFull()) { if (translationManager.isFull()) {
LOGGER.warn("Grid voll! Keine weiteren Lobbys moeglich."); LOGGER.warn("Grid is full! No more lobbies available.");
return; return;
} }
int buttonId = nextButtonId++; int buttonId = nextButtonId++;
@@ -68,7 +68,7 @@ public class CasinomainuiController {
LOGGER.info("ButtonID: {}, LobbyID: {}", buttonId, lobbyId); LOGGER.info("ButtonID: {}, LobbyID: {}", buttonId, lobbyId);
gridManager.renderLobbyButtons(); gridManager.renderLobbyButtons();
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Fehler beim Hinzufügen: {}", e.getMessage()); LOGGER.error("Error while adding lobby button: {}", e.getMessage());
} }
} }
} }
@@ -4,19 +4,19 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* Verwaltet das Mapping zwischen Button-IDs und Lobby-IDs rein im Speicher. Keine Dateioperationen, * Manages the mapping between Button IDs and Lobby IDs in memory only. No file operations,
* nur Laufzeitdatenstruktur. * runtime-only data structure.
*/ */
public class LobbyButtonTranslationManager { public class LobbyButtonTranslationManager {
// Singleton-Instanz // Singleton instance
private static LobbyButtonTranslationManager instance; private static LobbyButtonTranslationManager instance;
// Singleton-Zugriff // Singleton access
/** /**
* Liefert die Singleton-Instanz des Managers. * Returns the singleton instance of the manager.
* *
* @return die einzige Instanz von {@code LobbyButtonTranslationManager} * @return the single instance of {@code LobbyButtonTranslationManager}
*/ */
public static LobbyButtonTranslationManager getInstance() { public static LobbyButtonTranslationManager getInstance() {
if (instance == null) { if (instance == null) {
@@ -25,32 +25,32 @@ public class LobbyButtonTranslationManager {
return instance; return instance;
} }
/** Maximale Anzahl an Buttons/Lobbys */ /** Maximum number of buttons/lobbies */
private static final int MAX_BUTTONS = 8; private static final int MAX_BUTTONS = 8;
/** Zuordnung ButtonID → LobbyID */ /** Mapping ButtonID → LobbyID */
private final Map<Integer, Integer> buttonIdToLobbyId = new HashMap<>(); private final Map<Integer, Integer> buttonIdToLobbyId = new HashMap<>();
/** Privater Konstruktor für Singleton-Pattern */ /** Private constructor for the singleton pattern */
private LobbyButtonTranslationManager() { private LobbyButtonTranslationManager() {
// Zuordnung bleibt leer beim Start // Mapping is empty at startup
} }
/** /**
* Prüft, ob das Grid voll ist (MAX_BUTTONS erreicht). * Checks whether the grid is full (MAX_BUTTONS reached).
* *
* @return true, wenn Grid voll; sonst false * @return true if the grid is full; otherwise false
*/ */
public boolean isFull() { public boolean isFull() {
return buttonIdToLobbyId.size() >= MAX_BUTTONS; return buttonIdToLobbyId.size() >= MAX_BUTTONS;
} }
/** /**
* Fügt eine Zuordnung ButtonID → LobbyID hinzu. * Adds a mapping ButtonID → LobbyID.
* *
* @param buttonId Die ID des Buttons * @param buttonId the ID of the button
* @param lobbyId Die ID der Lobby * @param lobbyId the ID of the lobby
* @throws Exception wenn das Grid voll ist * @throws Exception when the grid is full
*/ */
public void addLobbyButton(int buttonId, int lobbyId) throws Exception { public void addLobbyButton(int buttonId, int lobbyId) throws Exception {
if (isFull()) { if (isFull()) {
@@ -60,28 +60,28 @@ public class LobbyButtonTranslationManager {
} }
/** /**
* Entfernt eine Zuordnung für die gegebene ButtonID. * Removes the mapping for the given ButtonID.
* *
* @param buttonId Die ID des zu entfernenden Buttons * @param buttonId the ID of the button to remove
*/ */
public void removeLobbyButton(int buttonId) { public void removeLobbyButton(int buttonId) {
buttonIdToLobbyId.remove(buttonId); buttonIdToLobbyId.remove(buttonId);
} }
/** /**
* Gibt die LobbyID für eine gegebene ButtonID zurück. * Returns the LobbyID for a given ButtonID.
* *
* @param buttonId Die ButtonID * @param buttonId the ButtonID
* @return Die zugehoerige LobbyID oder null, falls nicht vorhanden * @return the associated LobbyID or null if not present
*/ */
public Integer getLobbyIdForButton(int buttonId) { public Integer getLobbyIdForButton(int buttonId) {
return buttonIdToLobbyId.get(buttonId); return buttonIdToLobbyId.get(buttonId);
} }
/** /**
* Gibt die gesamte Zuordnung ButtonID → LobbyID zurück. * Returns the full mapping ButtonID → LobbyID.
* *
* @return Map aller Zuordnungen * @return Map of all mappings
*/ */
public Map<Integer, Integer> getButtonIdToLobbyId() { public Map<Integer, Integer> getButtonIdToLobbyId() {
return buttonIdToLobbyId; return buttonIdToLobbyId;