Sprache Deutsch/Englisch
Umschalter in den Einstellungen und auf der Anmeldeseite; Meldungen des Launchers (Lang.cs) und der Website (Accept-Language) in der gewaehlten Sprache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+7
-4
@@ -32,6 +32,7 @@ public sealed class MainForm : Form
|
||||
ClientSize = new Size(1120, 700);
|
||||
MinimumSize = new Size(900, 600);
|
||||
StartPosition = FormStartPosition.CenterScreen;
|
||||
Lang.Set(settings.Language);
|
||||
LauncherLog.Info("BSO Launcher " + SelfUpdate.CurrentVersion + " gestartet" + (Api.Dev ? " (-dev)" : "") + ", Website " + Api.Base);
|
||||
if (Api.Base != Api.BaseUrl) Text += " (DEV)";
|
||||
try { Icon = Icon.ExtractAssociatedIcon(Environment.ProcessPath ?? Application.ExecutablePath); } catch { }
|
||||
@@ -120,7 +121,7 @@ public sealed class MainForm : Form
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var answer = MessageBox.Show("Die Microsoft Edge WebView2 Runtime fehlt (" + e.Message + ").\n\nDownload-Seite oeffnen?",
|
||||
var answer = MessageBox.Show(Lang.T("Die Microsoft Edge WebView2 Runtime fehlt (" + e.Message + ").\n\nDownload-Seite oeffnen?"),
|
||||
Installer.AppName, MessageBoxButtons.YesNo, MessageBoxIcon.Error);
|
||||
if (answer == DialogResult.Yes) OpenUrl("https://developer.microsoft.com/microsoft-edge/webview2/");
|
||||
Close();
|
||||
@@ -189,7 +190,7 @@ public sealed class MainForm : Form
|
||||
else web.CoreWebView2?.PostWebMessageAsJson(json);
|
||||
}
|
||||
|
||||
void Progress(string task, double value, string text) => Emit(new { @event = "progress", task, value, text });
|
||||
void Progress(string task, double value, string text) => Emit(new { @event = "progress", task, value, text = Lang.T(text) });
|
||||
|
||||
async Task OnMessage(string raw)
|
||||
{
|
||||
@@ -220,7 +221,7 @@ public sealed class MainForm : Form
|
||||
catch (Exception e)
|
||||
{
|
||||
LauncherLog.Error(e.Message);
|
||||
Emit(new { id, ok = false, error = e.Message });
|
||||
Emit(new { id, ok = false, error = Lang.T(e.Message) });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,6 +247,7 @@ public sealed class MainForm : Form
|
||||
username = settings.Username,
|
||||
loggedIn = settings.Token != null,
|
||||
master = Api.Base,
|
||||
language = Lang.Current,
|
||||
dev = Api.Dev || Api.Base != Api.BaseUrl
|
||||
};
|
||||
|
||||
@@ -328,11 +330,12 @@ public sealed class MainForm : Form
|
||||
settings.AutoConnect = BoolArg(args, "autoConnect") ?? settings.AutoConnect;
|
||||
settings.KeepOpen = BoolArg(args, "keepOpen") ?? settings.KeepOpen;
|
||||
settings.AutoUpdateMod = BoolArg(args, "autoUpdateMod") ?? settings.AutoUpdateMod;
|
||||
if (Arg(args, "language") is "de" or "en") { settings.Language = Arg(args, "language"); Lang.Set(settings.Language); }
|
||||
settings.Save();
|
||||
return null;
|
||||
case "chooseGameFolder":
|
||||
{
|
||||
using var dialog = new FolderBrowserDialog { Description = "Ordner \"Bus-Simulator 2012\" waehlen", UseDescriptionForTitle = true };
|
||||
using var dialog = new FolderBrowserDialog { Description = Lang.T("Ordner \"Bus-Simulator 2012\" waehlen"), UseDescriptionForTitle = true };
|
||||
if (dialog.ShowDialog(this) != DialogResult.OK) return new { changed = false };
|
||||
string folder = dialog.SelectedPath;
|
||||
// Auch Bin_High_Win64 selbst gewaehlt? Dann den Ordner darueber nehmen
|
||||
|
||||
Reference in New Issue
Block a user