Skip to content

Commit

Permalink
Feat: Translate create game section
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyah committed May 27, 2026
1 parent c2147f0 commit ce00f14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected void initInteractions() {

getViewElement().selectDefaultStocks();
} catch (IOException | IllegalArgumentException e) {
showAlert(AlertType.ERROR, "Feil ved lasting", "Kunne ikke laste standard aksjedata: " + e.getMessage());
showAlert(AlertType.ERROR, "Error when loading", "Could not read default stock data: " + e.getMessage());
}
});

Expand Down Expand Up @@ -185,9 +185,9 @@ private void handleCreateGame() {

if (saveGameService.saveExists(name)) {
showAlert(AlertType.WARNING,
"Save finnes allerede",
"Det finnes allerede en lagret fil med navnet \""
+ name + "\". Velg et annet filnavn.");
"Save already exists!",
"There already exists a save with the name \""
+ name + "\". Please choose another file name.");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public File getCustomStockFile() {
public void selectDefaultStocks() {
this.stockSelection = StockSelection.DEFAULT;
this.customStockFile = null;
stockSelectionLabel.setText("Default aksje data valgt");
stockSelectionLabel.setText("Default stock data chosen");
refreshStockButtonStyles();
refreshCreateButtonState();
}
Expand All @@ -165,7 +165,7 @@ public void selectCustomStockFile(final File file) {
}
this.stockSelection = StockSelection.CUSTOM;
this.customStockFile = file;
stockSelectionLabel.setText("Egen fil: " + file.getName());
stockSelectionLabel.setText("Custom file: " + file.getName());
refreshStockButtonStyles();
refreshCreateButtonState();
}
Expand All @@ -185,7 +185,7 @@ public void resetFields() {
this.stockSelection = StockSelection.NONE;
this.customStockFile = null;
if (stockSelectionLabel != null) {
stockSelectionLabel.setText("Ingen aksje data valgt");
stockSelectionLabel.setText("No stock data chosen");
}
refreshStockButtonStyles();
refreshCreateButtonState();
Expand All @@ -198,15 +198,15 @@ protected void initLayout() {
title.getStyleClass().add("create-game-title");

// Row 1 - filename
Label fileNameLabel = new Label("Filnavn");
Label fileNameLabel = new Label("User name");
fileNameLabel.getStyleClass().add("create-game-label");
fileNameField = new TextField();
fileNameField.setPromptText("Skriv inn filnavn...");
fileNameField.setPromptText("Write username...");
fileNameField.getStyleClass().add("create-game-input");
VBox fileNameRow = new VBox(6, fileNameLabel, fileNameField);

// Row 2 - starting capital
Label capitalLabel = new Label("Startkapital");
Label capitalLabel = new Label("Start capital");
capitalLabel.getStyleClass().add("create-game-label");
startingCapitalChoice = new ChoiceBox<>();
startingCapitalChoice.getItems().addAll(
Expand All @@ -221,11 +221,11 @@ protected void initLayout() {
VBox capitalRow = new VBox(6, capitalLabel, startingCapitalChoice);

// Row 3 - stock data choice (two buttons side by side)
Label stockLabel = new Label("Aksje data");
Label stockLabel = new Label("Stock data");
stockLabel.getStyleClass().add("create-game-label");

useDefaultStocksButton = new Button("Bruk default aksje data");
chooseStockFileButton = new Button("Velg egen aksje fil");
useDefaultStocksButton = new Button("Use default stock data");
chooseStockFileButton = new Button("Choose custom stock data file");

useDefaultStocksButton.setMaxWidth(Double.MAX_VALUE);
chooseStockFileButton.setMaxWidth(Double.MAX_VALUE);
Expand All @@ -236,14 +236,14 @@ protected void initLayout() {
useDefaultStocksButton, chooseStockFileButton);
stockButtonsRow.setAlignment(Pos.CENTER);

stockSelectionLabel = new Label("Ingen aksje data valgt");
stockSelectionLabel = new Label("No stock data chosen");
stockSelectionLabel.getStyleClass().add("create-game-selection-label");

VBox stockRow = new VBox(6,
stockLabel, stockButtonsRow, stockSelectionLabel);

// Bottom row - cancel (left) / create-game (right)
cancelButton = new Button("Avbryt");
cancelButton = new Button("Cancel");
createGameButton = new Button("Create game");

Region bottomSpacer = new Region();
Expand Down

0 comments on commit ce00f14

Please sign in to comment.