Make language text easier to access

pull/32/head
Miepee 4 years ago
parent 7f3ea40228
commit f0e4c3127c

@ -1,5 +1,6 @@
using AM2RLauncher.Core; using AM2RLauncher.Core;
using AM2RLauncher.Core.XML; using AM2RLauncher.Core.XML;
using AM2RLauncher.Language;
using Eto.Forms; using Eto.Forms;
using LibGit2Sharp; using LibGit2Sharp;
using System; using System;
@ -53,7 +54,7 @@ namespace AM2RLauncher
log.Error("Druid PatchData corruption occurred!"); log.Error("Druid PatchData corruption occurred!");
await Application.Instance.InvokeAsync(() => await Application.Instance.InvokeAsync(() =>
{ {
MessageBox.Show(Language.Text.CorruptPatchData, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(Text.CorruptPatchData, Text.ErrorWindowTitle, MessageBoxType.Error);
}); });
HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData"); HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData");
return; return;
@ -62,7 +63,7 @@ namespace AM2RLauncher
catch (UserCancelledException ex) catch (UserCancelledException ex)
{ {
log.Info(ex.Message); log.Info(ex.Message);
MessageBox.Show(Language.Text.CorruptPatchData, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(Text.CorruptPatchData, Text.ErrorWindowTitle, MessageBoxType.Error);
HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData"); HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData");
} }
catch (LibGit2SharpException ex) // This is for any exceptions from libgit catch (LibGit2SharpException ex) // This is for any exceptions from libgit
@ -74,19 +75,19 @@ namespace AM2RLauncher
if (!(bool)autoUpdateAM2RCheck.Checked) if (!(bool)autoUpdateAM2RCheck.Checked)
{ {
log.Error("Internet connection failed while attempting to pull repository" + currentMirror + "!"); log.Error("Internet connection failed while attempting to pull repository" + currentMirror + "!");
MessageBox.Show(Language.Text.InternetConnectionDrop, Language.Text.WarningWindowTitle, MessageBoxType.Warning); MessageBox.Show(Text.InternetConnectionDrop, Text.WarningWindowTitle, MessageBoxType.Warning);
} }
} }
else else
{ {
log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace); log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace);
MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Text.ErrorWindowTitle, MessageBoxType.Error);
} }
} }
catch (Exception ex) // This is if somehow any other exception might get thrown as well. catch (Exception ex) // This is if somehow any other exception might get thrown as well.
{ {
log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace); log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace);
MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Text.ErrorWindowTitle, MessageBoxType.Error);
} }
finally finally
{ {
@ -170,12 +171,12 @@ namespace AM2RLauncher
ex.Message.ToLower().Contains("failed to resolve address")) ex.Message.ToLower().Contains("failed to resolve address"))
{ {
log.Error("Internet connection dropped while attempting to clone repository" + currentMirror + "!"); log.Error("Internet connection dropped while attempting to clone repository" + currentMirror + "!");
MessageBox.Show(Language.Text.InternetConnectionDrop, Language.Text.WarningWindowTitle, MessageBoxType.Warning); MessageBox.Show(Text.InternetConnectionDrop, Text.WarningWindowTitle, MessageBoxType.Warning);
} }
else else
{ {
log.Error("LibGit2SharpException: " + ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace); log.Error("LibGit2SharpException: " + ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace);
MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Text.ErrorWindowTitle, MessageBoxType.Error);
if (Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/PatchData")) if (Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/PatchData"))
HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData"); HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData");
} }
@ -184,7 +185,7 @@ namespace AM2RLauncher
catch (Exception ex) // This is if somehow any other exception might get thrown as well. catch (Exception ex) // This is if somehow any other exception might get thrown as well.
{ {
log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace); log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace);
MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Text.ErrorWindowTitle, MessageBoxType.Error);
if (Directory.Exists(CrossPlatformOperations.CURRENTPATH + " / PatchData")) if (Directory.Exists(CrossPlatformOperations.CURRENTPATH + " / PatchData"))
HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData"); HelperMethods.DeleteDirectory(CrossPlatformOperations.CURRENTPATH + "/PatchData");
@ -216,7 +217,7 @@ namespace AM2RLauncher
#region Downloading #region Downloading
case UpdateState.Downloading: case UpdateState.Downloading:
var result = MessageBox.Show(Language.Text.CloseOnCloningText, Language.Text.WarningWindowTitle, MessageBoxButtons.YesNo, MessageBoxType.Warning, MessageBoxDefaultButton.No); var result = MessageBox.Show(Text.CloseOnCloningText, Text.WarningWindowTitle, MessageBoxButtons.YesNo, MessageBoxType.Warning, MessageBoxDefaultButton.No);
if (result == DialogResult.No) if (result == DialogResult.No)
return; return;
else else
@ -241,10 +242,10 @@ namespace AM2RLauncher
{ {
Directory = new Uri(CrossPlatformOperations.CURRENTPATH), Directory = new Uri(CrossPlatformOperations.CURRENTPATH),
MultiSelect = false, MultiSelect = false,
Title = Language.Text.Select11FileDialog Title = Text.Select11FileDialog
}; };
fileFinder.Filters.Add(new FileFilter(Language.Text.ZipArchiveText, ".zip")); fileFinder.Filters.Add(new FileFilter(Text.ZipArchiveText, ".zip"));
if (fileFinder.ShowDialog(this) != DialogResult.Ok) if (fileFinder.ShowDialog(this) != DialogResult.Ok)
{ {
@ -265,7 +266,7 @@ namespace AM2RLauncher
if (errorCode != IsZipAM2R11ReturnCodes.Successful) if (errorCode != IsZipAM2R11ReturnCodes.Successful)
{ {
log.Error("User tried to input invalid AM2R_11.zip file (" + errorCode + "). Cancelling import."); log.Error("User tried to input invalid AM2R_11.zip file (" + errorCode + "). Cancelling import.");
MessageBox.Show(Language.Text.ZipIsNotAM2R11 + "\n\nError Code: " + errorCode, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(Text.ZipIsNotAM2R11 + "\n\nError Code: " + errorCode, Text.ErrorWindowTitle, MessageBoxType.Error);
return; return;
} }
@ -307,7 +308,7 @@ namespace AM2RLauncher
// Check if xdelta is installed on linux´and exit if not // Check if xdelta is installed on linux´and exit if not
if ((OS.IsUnix) && !CrossPlatformOperations.CheckIfXdeltaIsInstalled()) if ((OS.IsUnix) && !CrossPlatformOperations.CheckIfXdeltaIsInstalled())
{ {
MessageBox.Show(Language.Text.XdeltaNotFound, Language.Text.WarningWindowTitle, MessageBoxButtons.OK); MessageBox.Show(Text.XdeltaNotFound, Text.WarningWindowTitle, MessageBoxButtons.OK);
SetPlayButtonState(UpdateState.Install); SetPlayButtonState(UpdateState.Install);
UpdateStateMachine(); UpdateStateMachine();
@ -324,7 +325,7 @@ namespace AM2RLauncher
catch (Exception ex) catch (Exception ex)
{ {
log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace); log.Error(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace);
MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(ex.Message + "\n*****Stack Trace*****\n\n" + ex.StackTrace, Text.ErrorWindowTitle, MessageBoxType.Error);
} }
progressBar.Visible = false; progressBar.Visible = false;
progressBar.Value = 0; progressBar.Value = 0;
@ -403,7 +404,7 @@ namespace AM2RLauncher
progressBar.MaxValue = transferProgress.TotalObjects; progressBar.MaxValue = transferProgress.TotalObjects;
if (currentGitObject >= transferProgress.ReceivedObjects) if (currentGitObject >= transferProgress.ReceivedObjects)
return; return;
progressLabel.Text = Language.Text.ProgressbarProgress + " " + transferProgress.ReceivedObjects + " (" + ((int)transferProgress.ReceivedBytes / 1000000) + "MB) / " + transferProgress.TotalObjects + " objects"; progressLabel.Text = Text.ProgressbarProgress + " " + transferProgress.ReceivedObjects + " (" + ((int)transferProgress.ReceivedBytes / 1000000) + "MB) / " + transferProgress.TotalObjects + " objects";
currentGitObject = transferProgress.ReceivedObjects; currentGitObject = transferProgress.ReceivedObjects;
progressBar.Value = transferProgress.ReceivedObjects; progressBar.Value = transferProgress.ReceivedObjects;
}); });
@ -419,7 +420,7 @@ namespace AM2RLauncher
// Check for java, exit safely with a warning if not found! // Check for java, exit safely with a warning if not found!
if (!CrossPlatformOperations.IsJavaInstalled()) if (!CrossPlatformOperations.IsJavaInstalled())
{ {
MessageBox.Show(Language.Text.JavaNotFound, Language.Text.WarningWindowTitle, MessageBoxButtons.OK); MessageBox.Show(Text.JavaNotFound, Text.WarningWindowTitle, MessageBoxButtons.OK);
SetApkButtonState(ApkButtonState.Create); SetApkButtonState(ApkButtonState.Create);
UpdateStateMachine(); UpdateStateMachine();
log.Error("Java not found! Aborting Android APK creation."); log.Error("Java not found! Aborting Android APK creation.");
@ -428,7 +429,7 @@ namespace AM2RLauncher
// Check if xdelta is installed on linux // Check if xdelta is installed on linux
if (OS.IsUnix && !CrossPlatformOperations.CheckIfXdeltaIsInstalled()) if (OS.IsUnix && !CrossPlatformOperations.CheckIfXdeltaIsInstalled())
{ {
MessageBox.Show(Language.Text.XdeltaNotFound, Language.Text.WarningWindowTitle, MessageBoxButtons.OK); MessageBox.Show(Text.XdeltaNotFound, Text.WarningWindowTitle, MessageBoxButtons.OK);
SetApkButtonState(ApkButtonState.Create); SetApkButtonState(ApkButtonState.Create);
UpdateStateMachine(); UpdateStateMachine();
log.Error("Xdelta not found. Aborting Android APK creation..."); log.Error("Xdelta not found. Aborting Android APK creation...");
@ -506,10 +507,10 @@ namespace AM2RLauncher
{ {
Directory = new Uri(CrossPlatformOperations.CURRENTPATH), Directory = new Uri(CrossPlatformOperations.CURRENTPATH),
MultiSelect = false, MultiSelect = false,
Title = Language.Text.SelectModFileDialog Title = Text.SelectModFileDialog
}; };
fileFinder.Filters.Add(new FileFilter(Language.Text.ZipArchiveText, ".zip")); fileFinder.Filters.Add(new FileFilter(Text.ZipArchiveText, ".zip"));
if (fileFinder.ShowDialog(this) != DialogResult.Ok) if (fileFinder.ShowDialog(this) != DialogResult.Ok)
{ {
@ -546,7 +547,7 @@ namespace AM2RLauncher
ProfileXML profile2 = Serializer.Deserialize<ProfileXML>(File.ReadAllText(modsDir + "/" + extractedName + "/profile.xml")); ProfileXML profile2 = Serializer.Deserialize<ProfileXML>(File.ReadAllText(modsDir + "/" + extractedName + "/profile.xml"));
log.Error("Mod is already imported as " + extractedName + "! Cancelling mod import."); log.Error("Mod is already imported as " + extractedName + "! Cancelling mod import.");
MessageBox.Show(Language.Text.ModIsAlreadyInstalledMessage.Replace("$NAME", profile2.Name), Language.Text.WarningWindowTitle, MessageBoxType.Warning); MessageBox.Show(HelperMethods.GetText(Text.ModIsAlreadyInstalledMessage, profile2.Name), Text.WarningWindowTitle, MessageBoxType.Warning);
return; return;
} }
// Directory doesn't exist -> extract! // Directory doesn't exist -> extract!
@ -558,7 +559,7 @@ namespace AM2RLauncher
{ {
log.Error(fileFinder.FileName + " does not contain profile.xml! Cancelling mod import."); log.Error(fileFinder.FileName + " does not contain profile.xml! Cancelling mod import.");
MessageBox.Show(Language.Text.ModIsInvalidMessage.Replace("$NAME", extractedName), Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(HelperMethods.GetText(Text.ModIsInvalidMessage, extractedName), Text.ErrorWindowTitle, MessageBoxType.Error);
Directory.Delete(modsDir + "/" + extractedName, true); Directory.Delete(modsDir + "/" + extractedName, true);
File.Delete(CrossPlatformOperations.CURRENTPATH + "/Mods/" + modFile.Name); File.Delete(CrossPlatformOperations.CURRENTPATH + "/Mods/" + modFile.Name);
return; return;
@ -571,8 +572,8 @@ namespace AM2RLauncher
{ {
log.Error("Mod is for " + profile.OperatingSystem + " while current OS is " + OS.Name + ". Cancelling mod import."); log.Error("Mod is for " + profile.OperatingSystem + " while current OS is " + OS.Name + ". Cancelling mod import.");
MessageBox.Show(Language.Text.ModIsForWrongOS.Replace("$NAME", profile.Name).Replace("$OS", profile.OperatingSystem).Replace("$CURRENTOS", OS.Name), MessageBox.Show(HelperMethods.GetText(Text.ModIsForWrongOS, profile.Name).Replace("$OS", profile.OperatingSystem).Replace("$CURRENTOS", OS.Name),
Language.Text.ErrorWindowTitle, MessageBoxType.Error); Text.ErrorWindowTitle, MessageBoxType.Error);
HelperMethods.DeleteDirectory(modsDir + "/" + extractedName); HelperMethods.DeleteDirectory(modsDir + "/" + extractedName);
return; return;
} }
@ -581,13 +582,13 @@ namespace AM2RLauncher
if (profileList.FirstOrDefault(p => p.Name == profile.Name) != null || Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name)) if (profileList.FirstOrDefault(p => p.Name == profile.Name) != null || Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name))
{ {
log.Error(profile.Name + " is already installed."); log.Error(profile.Name + " is already installed.");
MessageBox.Show(Language.Text.ModIsAlreadyInstalledMessage.Replace("$NAME", profile.Name), Language.Text.WarningWindowTitle, MessageBoxType.Warning); MessageBox.Show(HelperMethods.GetText(Text.ModIsAlreadyInstalledMessage, profile.Name), Text.WarningWindowTitle, MessageBoxType.Warning);
HelperMethods.DeleteDirectory(modsDir + "/" + extractedName); HelperMethods.DeleteDirectory(modsDir + "/" + extractedName);
return; return;
} }
log.Info(profile.Name + " successfully installed."); log.Info(profile.Name + " successfully installed.");
MessageBox.Show(Language.Text.ModSuccessfullyInstalledMessage.Replace("$NAME", profile.Name), Language.Text.SuccessWindowTitle); MessageBox.Show(HelperMethods.GetText(Text.ModSuccessfullyInstalledMessage, profile.Name), Text.SuccessWindowTitle);
LoadProfilesAndAdjustLists(); LoadProfilesAndAdjustLists();
// Adjust profileIndex to point to newly added mod. if its not found for whatever reason, we default to first community updates // Adjust profileIndex to point to newly added mod. if its not found for whatever reason, we default to first community updates
@ -626,6 +627,8 @@ namespace AM2RLauncher
{ {
if (settingsProfileDropDown.SelectedIndex == -1 && settingsProfileDropDown.Items.Count == 0) return; if (settingsProfileDropDown.SelectedIndex == -1 && settingsProfileDropDown.Items.Count == 0) return;
string profileName = settingsProfileDropDown.Items[settingsProfileDropDown.SelectedIndex].Text;
log.Info("SettingsProfileDropDown.SelectedIndex has been changed to " + settingsProfileDropDown.SelectedIndex + "."); log.Info("SettingsProfileDropDown.SelectedIndex has been changed to " + settingsProfileDropDown.SelectedIndex + ".");
if (settingsProfileDropDown.SelectedIndex <= 0 || settingsProfileDropDown.Items.Count == 0) if (settingsProfileDropDown.SelectedIndex <= 0 || settingsProfileDropDown.Items.Count == 0)
{ {
@ -638,21 +641,21 @@ namespace AM2RLauncher
else else
{ {
deleteModButton.Enabled = true; deleteModButton.Enabled = true;
deleteModButton.ToolTip = Language.Text.DeleteModButtonToolTip.Replace("$NAME", settingsProfileDropDown.Items[settingsProfileDropDown.SelectedIndex].Text); deleteModButton.ToolTip = HelperMethods.GetText(Text.DeleteModButtonToolTip, profileName);
// On non-installable profiles we want to disable updating // On non-installable profiles we want to disable updating
updateModButton.Enabled = profileList[settingsProfileDropDown.SelectedIndex].Installable; updateModButton.Enabled = profileList[settingsProfileDropDown.SelectedIndex].Installable;
updateModButton.ToolTip = Language.Text.UpdateModButtonToolTip.Replace("$NAME", settingsProfileDropDown.Items[settingsProfileDropDown.SelectedIndex].Text); updateModButton.ToolTip = HelperMethods.GetText(Text.UpdateModButtonToolTip, profileName);
} }
profileButton.Enabled = Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profileList[settingsProfileDropDown.SelectedIndex].Name); profileButton.Enabled = Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profileName);
profileButton.ToolTip = Language.Text.OpenProfileFolderToolTip.Replace("$NAME", settingsProfileDropDown.Items[settingsProfileDropDown.SelectedIndex].Text); profileButton.ToolTip = HelperMethods.GetText(Text.OpenProfileFolderToolTip, profileName);
saveButton.Enabled = true; saveButton.Enabled = true;
saveButton.ToolTip = Language.Text.OpenSaveFolderToolTip.Replace("$NAME", settingsProfileDropDown.Items[settingsProfileDropDown.SelectedIndex].Text); saveButton.ToolTip = HelperMethods.GetText(Text.OpenSaveFolderToolTip, profileName);
if (settingsProfileDropDown.SelectedIndex < 0 || settingsProfileDropDown.Items.Count == 0) if (settingsProfileDropDown.SelectedIndex < 0 || settingsProfileDropDown.Items.Count == 0)
return; return;
profileNotesTextArea.TextColor = colGreen; profileNotesTextArea.TextColor = colGreen;
profileNotesTextArea.Text = Language.Text.ProfileNotes + "\n" + profileList[settingsProfileDropDown.SelectedIndex].ProfileNotes; profileNotesTextArea.Text = Text.ProfileNotes + "\n" + profileList[settingsProfileDropDown.SelectedIndex].ProfileNotes;
} }
@ -738,8 +741,8 @@ namespace AM2RLauncher
profileIndex = profileDropDown.SelectedIndex; profileIndex = profileDropDown.SelectedIndex;
log.Debug("profileDropDown.SelectedIndex has been changed to " + profileIndex + "."); log.Debug("profileDropDown.SelectedIndex has been changed to " + profileIndex + ".");
profileAuthorLabel.Text = Language.Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author; profileAuthorLabel.Text = Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author;
profileVersionLabel.Text = Language.Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version; profileVersionLabel.Text = Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version;
if (profileDropDown.SelectedIndex != 0 && (profileList[profileDropDown.SelectedIndex].SaveLocation == "%localappdata%/AM2R" || if (profileDropDown.SelectedIndex != 0 && (profileList[profileDropDown.SelectedIndex].SaveLocation == "%localappdata%/AM2R" ||
profileList[profileDropDown.SelectedIndex].SaveLocation == "default")) profileList[profileDropDown.SelectedIndex].SaveLocation == "default"))
@ -789,7 +792,7 @@ namespace AM2RLauncher
// Create warning dialog when enabling // Create warning dialog when enabling
if (enabled) if (enabled)
{ {
MessageBox.Show(Language.Text.WarningWindowText, Language.Text.WarningWindowTitle, MessageBoxType.Warning); MessageBox.Show(Text.WarningWindowText, Text.WarningWindowTitle, MessageBoxType.Warning);
currentMirror = customMirrorTextBox.Text; currentMirror = customMirrorTextBox.Text;
} }
else else
@ -845,7 +848,7 @@ namespace AM2RLauncher
if (!gitURLRegex.IsMatch(mirrorText)) if (!gitURLRegex.IsMatch(mirrorText))
{ {
log.Info("User used " + mirrorText + " as a custom Mirror, didn't pass git validation test."); log.Info("User used " + mirrorText + " as a custom Mirror, didn't pass git validation test.");
MessageBox.Show(Language.Text.InvalidGitURL.Replace("$NAME", mirrorText), Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(HelperMethods.GetText(Text.InvalidGitURL, mirrorText), Text.ErrorWindowTitle, MessageBoxType.Error);
return; return;
} }
@ -893,7 +896,7 @@ namespace AM2RLauncher
ProfileXML profile = profileList[settingsProfileDropDown.SelectedIndex]; ProfileXML profile = profileList[settingsProfileDropDown.SelectedIndex];
log.Info("User is attempting to delete profile " + profile.Name + "."); log.Info("User is attempting to delete profile " + profile.Name + ".");
DialogResult result = MessageBox.Show(Language.Text.DeleteModWarning.Replace("$NAME", profile.Name), Language.Text.WarningWindowTitle, DialogResult result = MessageBox.Show(HelperMethods.GetText(Text.DeleteModWarning, profile.Name), Text.WarningWindowTitle,
MessageBoxButtons.OKCancel, MessageBoxType.Warning, MessageBoxDefaultButton.Cancel); MessageBoxButtons.OKCancel, MessageBoxType.Warning, MessageBoxDefaultButton.Cancel);
if (result == DialogResult.Ok) if (result == DialogResult.Ok)
@ -901,7 +904,7 @@ namespace AM2RLauncher
log.Info("User did not cancel. Proceeding to delete " + profile); log.Info("User did not cancel. Proceeding to delete " + profile);
DeleteProfileAndAdjustLists(profile); DeleteProfileAndAdjustLists(profile);
log.Info(profile + " has been deleted"); log.Info(profile + " has been deleted");
MessageBox.Show(Language.Text.DeleteModButtonSuccess.Replace("$NAME", profile.Name), Language.Text.SuccessWindowTitle); MessageBox.Show(HelperMethods.GetText(Text.DeleteModButtonSuccess, profile.Name), Text.SuccessWindowTitle);
} }
else else
{ {
@ -925,10 +928,10 @@ namespace AM2RLauncher
{ {
Directory = new Uri(CrossPlatformOperations.CURRENTPATH), Directory = new Uri(CrossPlatformOperations.CURRENTPATH),
MultiSelect = false, MultiSelect = false,
Title = Language.Text.SelectModFileDialog Title = Text.SelectModFileDialog
}; };
fileFinder.Filters.Add(new FileFilter(Language.Text.ZipArchiveText, ".zip")); fileFinder.Filters.Add(new FileFilter(Text.ZipArchiveText, ".zip"));
if (fileFinder.ShowDialog(this) != DialogResult.Ok) if (fileFinder.ShowDialog(this) != DialogResult.Ok)
{ {
@ -972,7 +975,7 @@ namespace AM2RLauncher
if (!File.Exists(extractedFolder + "/profile.xml")) if (!File.Exists(extractedFolder + "/profile.xml"))
{ {
log.Error(fileFinder.FileName + " does not contain profile.xml! Cancelling mod update."); log.Error(fileFinder.FileName + " does not contain profile.xml! Cancelling mod update.");
MessageBox.Show(Language.Text.ModIsInvalidMessage.Replace("$NAME", extractedName), Language.Text.ErrorWindowTitle, MessageBoxType.Error); MessageBox.Show(HelperMethods.GetText(Text.ModIsInvalidMessage, extractedName), Text.ErrorWindowTitle, MessageBoxType.Error);
Directory.Delete(extractedFolder, true); Directory.Delete(extractedFolder, true);
File.Delete(CrossPlatformOperations.CURRENTPATH + "/Mods/" + modFile.Name); File.Delete(CrossPlatformOperations.CURRENTPATH + "/Mods/" + modFile.Name);
return; return;
@ -984,7 +987,7 @@ namespace AM2RLauncher
if (profileList.FirstOrDefault(p => p.Name == profile.Name) != null || Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name)) if (profileList.FirstOrDefault(p => p.Name == profile.Name) != null || Directory.Exists(CrossPlatformOperations.CURRENTPATH + "/Profiles/" + profile.Name))
{ {
// Mod is already installed, so we can update! // Mod is already installed, so we can update!
DialogResult updateResult = MessageBox.Show(Language.Text.UpdateModWarning.Replace("$NAME", currentProfile.Name), Language.Text.WarningWindowTitle, DialogResult updateResult = MessageBox.Show(HelperMethods.GetText(Text.UpdateModWarning, currentProfile.Name), Text.WarningWindowTitle,
MessageBoxButtons.OKCancel, MessageBoxType.Warning, MessageBoxDefaultButton.Cancel); MessageBoxButtons.OKCancel, MessageBoxType.Warning, MessageBoxDefaultButton.Cancel);
if (updateResult == DialogResult.Ok) if (updateResult == DialogResult.Ok)
@ -993,7 +996,7 @@ namespace AM2RLauncher
if (Profile.IsProfileInstalled(currentProfile)) if (Profile.IsProfileInstalled(currentProfile))
{ {
//TODO: localize //TODO: localize
DialogResult archiveResult = MessageBox.Show(Language.Text.ArchiveMod.Replace("$NAME", currentProfile.Name + " " + Language.Text.VersionLabel + currentProfile.Version), Language.Text.WarningWindowTitle, MessageBoxButtons.YesNo, MessageBoxType.Warning, MessageBoxDefaultButton.No); DialogResult archiveResult = MessageBox.Show(HelperMethods.GetText(Text.ArchiveMod, currentProfile.Name + " " + Text.VersionLabel + currentProfile.Version), Text.WarningWindowTitle, MessageBoxButtons.YesNo, MessageBoxType.Warning, MessageBoxDefaultButton.No);
// User wants to archive profile // User wants to archive profile
if (archiveResult == DialogResult.Yes) if (archiveResult == DialogResult.Yes)
@ -1017,8 +1020,8 @@ namespace AM2RLauncher
// Cancel the operation! // Cancel the operation!
// Show message to tell user that mod could not be found, install this separately // Show message to tell user that mod could not be found, install this separately
log.Error("Mod is not installed! Cancelling mod update."); log.Error("Mod is not installed! Cancelling mod update.");
MessageBox.Show(Language.Text.UpdateModButtonWrongMod.Replace("$NAME", currentProfile.Name).Replace("$SELECT", profile.Name), MessageBox.Show(HelperMethods.GetText(Text.UpdateModButtonWrongMod, currentProfile.Name).Replace("$SELECT", profile.Name),
Language.Text.WarningWindowTitle, MessageBoxButtons.OK); Text.WarningWindowTitle, MessageBoxButtons.OK);
abort = true; abort = true;
} }
@ -1031,7 +1034,7 @@ namespace AM2RLauncher
} }
log.Info("Successfully updated mod profile " + profile.Name + "."); log.Info("Successfully updated mod profile " + profile.Name + ".");
MessageBox.Show(Language.Text.ModSuccessfullyInstalledMessage.Replace("$NAME", currentProfile.Name), Language.Text.SuccessWindowTitle); MessageBox.Show(HelperMethods.GetText(Text.ModSuccessfullyInstalledMessage, currentProfile.Name), Text.SuccessWindowTitle);
UpdateStateMachine(); UpdateStateMachine();
LoadProfilesAndAdjustLists(); LoadProfilesAndAdjustLists();
@ -1059,7 +1062,7 @@ namespace AM2RLauncher
{ {
case UpdateState.Downloading: case UpdateState.Downloading:
{ {
var result = MessageBox.Show(Language.Text.CloseOnCloningText, Language.Text.WarningWindowTitle, MessageBoxButtons.YesNo, var result = MessageBox.Show(Text.CloseOnCloningText, Text.WarningWindowTitle, MessageBoxButtons.YesNo,
MessageBoxType.Warning, MessageBoxDefaultButton.No); MessageBoxType.Warning, MessageBoxDefaultButton.No);
if (result == DialogResult.No) if (result == DialogResult.No)
{ {
@ -1071,7 +1074,7 @@ namespace AM2RLauncher
break; break;
} }
case UpdateState.Installing: case UpdateState.Installing:
MessageBox.Show(Language.Text.CloseOnInstallingText, Language.Text.WarningWindowTitle, MessageBoxButtons.OK, MessageBoxType.Warning); MessageBox.Show(Text.CloseOnInstallingText, Text.WarningWindowTitle, MessageBoxButtons.OK, MessageBoxType.Warning);
e.Cancel = true; e.Cancel = true;
break; break;
} }

@ -2,6 +2,7 @@
using System; using System;
using AM2RLauncher.Core; using AM2RLauncher.Core;
using AM2RLauncher.Core.XML; using AM2RLauncher.Core.XML;
using AM2RLauncher.Language;
namespace AM2RLauncher namespace AM2RLauncher
{ {
@ -81,7 +82,7 @@ namespace AM2RLauncher
// Our default values // Our default values
apkButton.Enabled = false; apkButton.Enabled = false;
apkButton.ToolTip = Language.Text.ApkButtonDisabledToolTip; apkButton.ToolTip = Text.ApkButtonDisabledToolTip;
// If profile supports Android and if we are NOT already creating an APK... // If profile supports Android and if we are NOT already creating an APK...
if (!IsProfileIndexValid()) if (!IsProfileIndexValid())
@ -101,7 +102,7 @@ namespace AM2RLauncher
case UpdateState.Playing: return; case UpdateState.Playing: return;
case UpdateState.Install: case UpdateState.Install:
case UpdateState.Play: apkButton.Enabled = true; apkButton.ToolTip = Language.Text.ApkButtonEnabledToolTip.Replace("$NAME", profileDropDown?.Items[profileDropDown.SelectedIndex]?.Text ?? ""); break; case UpdateState.Play: apkButton.Enabled = true; apkButton.ToolTip = HelperMethods.GetText(Text.ApkButtonEnabledToolTip, profileDropDown?.Items[profileDropDown.SelectedIndex]?.Text ?? ""); break;
} }
} }
@ -167,19 +168,19 @@ namespace AM2RLauncher
settingsProfileDropDown.Enabled = enabled; settingsProfileDropDown.Enabled = enabled;
profileButton.Enabled = enabled; profileButton.Enabled = enabled;
//TODO: these .replace($NAME) are in a lot of places, replace them with some fuction. //TODO: these .replace($NAME) are in a lot of places, replace them with some fuction.
profileButton.ToolTip = Language.Text.OpenProfileFolderToolTip.Replace("$NAME", selectedProfileName); profileButton.ToolTip = HelperMethods.GetText(Text.OpenProfileFolderToolTip, selectedProfileName);
saveButton.Enabled = enabled; saveButton.Enabled = enabled;
saveButton.ToolTip = Language.Text.OpenSaveFolderToolTip.Replace("$NAME", selectedProfileName); saveButton.ToolTip = HelperMethods.GetText(Text.OpenSaveFolderToolTip, selectedProfileName);
addModButton.Enabled = enabled; addModButton.Enabled = enabled;
addModButton.ToolTip = Language.Text.AddNewModToolTip; addModButton.ToolTip = Text.AddNewModToolTip;
// Only enable these, when we're not on the community updates // Only enable these, when we're not on the community updates
if (settingsProfileDropDown.SelectedIndex > 0) if (settingsProfileDropDown.SelectedIndex > 0)
{ {
updateModButton.Enabled = profileList[settingsProfileDropDown.SelectedIndex].Installable; updateModButton.Enabled = profileList[settingsProfileDropDown.SelectedIndex].Installable;
updateModButton.ToolTip = Language.Text.UpdateModButtonToolTip.Replace("$NAME", selectedProfileName); updateModButton.ToolTip = HelperMethods.GetText(Text.UpdateModButtonToolTip, selectedProfileName);
deleteModButton.Enabled = enabled; deleteModButton.Enabled = enabled;
deleteModButton.ToolTip = Language.Text.DeleteModButtonToolTip.Replace("$NAME", selectedProfileName); deleteModButton.ToolTip = HelperMethods.GetText(Text.DeleteModButtonToolTip, selectedProfileName);
} }
Color col = enabled ? colGreen : colInactive; Color col = enabled ? colGreen : colInactive;
@ -203,13 +204,13 @@ namespace AM2RLauncher
string profileName = ((profileDropDown != null) && (profileDropDown.Items.Count > 0)) ? profileDropDown.Items[profileDropDown.SelectedIndex].Text : ""; string profileName = ((profileDropDown != null) && (profileDropDown.Items.Count > 0)) ? profileDropDown.Items[profileDropDown.SelectedIndex].Text : "";
switch (updateState) switch (updateState)
{ {
case UpdateState.Download: playButton.Enabled = true; playButton.ToolTip = Language.Text.PlayButtonDownloadToolTip; break; case UpdateState.Download: playButton.Enabled = true; playButton.ToolTip = Text.PlayButtonDownloadToolTip; break;
case UpdateState.Downloading: playButton.Enabled = true; playButton.ToolTip = ""; playButton.ToolTip = Language.Text.PlayButtonDownladingToolTip; break; case UpdateState.Downloading: playButton.Enabled = true; playButton.ToolTip = ""; playButton.ToolTip = Text.PlayButtonDownladingToolTip; break;
case UpdateState.Select11: playButton.Enabled = true; playButton.ToolTip = Language.Text.PlayButtonSelect11ToolTip; break; case UpdateState.Select11: playButton.Enabled = true; playButton.ToolTip = Text.PlayButtonSelect11ToolTip; break;
case UpdateState.Install: playButton.Enabled = true; playButton.ToolTip = Language.Text.PlayButtonInstallToolTip.Replace("$NAME", profileName); break; case UpdateState.Install: playButton.Enabled = true; playButton.ToolTip = HelperMethods.GetText(Text.PlayButtonInstallToolTip, profileName); break;
case UpdateState.Installing: playButton.Enabled = false; playButton.ToolTip = Language.Text.PlayButtonInstallingToolTip; break; case UpdateState.Installing: playButton.Enabled = false; playButton.ToolTip = Text.PlayButtonInstallingToolTip; break;
case UpdateState.Play: playButton.Enabled = true; playButton.ToolTip = Language.Text.PlayButtonPlayToolTip.Replace("$NAME", profileName); break; case UpdateState.Play: playButton.Enabled = true; playButton.ToolTip = HelperMethods.GetText(Text.PlayButtonPlayToolTip, profileName); break;
case UpdateState.Playing: playButton.Enabled = false; playButton.ToolTip = Language.Text.PlayButtonPlayingToolTip; break; case UpdateState.Playing: playButton.Enabled = false; playButton.ToolTip = Text.PlayButtonPlayingToolTip; break;
} }
playButton.Text = GetPlayButtonText(); playButton.Text = GetPlayButtonText();
@ -241,13 +242,13 @@ namespace AM2RLauncher
{ {
switch (updateState) switch (updateState)
{ {
case UpdateState.Download: return Language.Text.Download; case UpdateState.Download: return Text.Download;
case UpdateState.Downloading: return Language.Text.Abort; case UpdateState.Downloading: return Text.Abort;
case UpdateState.Select11: return Language.Text.Select11; case UpdateState.Select11: return Text.Select11;
case UpdateState.Install: return Language.Text.Install; case UpdateState.Install: return Text.Install;
case UpdateState.Installing: return Language.Text.Installing; case UpdateState.Installing: return Text.Installing;
case UpdateState.Play: return Language.Text.Play; case UpdateState.Play: return Text.Play;
case UpdateState.Playing: return Language.Text.Playing; case UpdateState.Playing: return Text.Playing;
default: return null; default: return null;
} }
} }
@ -260,8 +261,8 @@ namespace AM2RLauncher
{ {
switch (apkButtonState) switch (apkButtonState)
{ {
case ApkButtonState.Create: return Language.Text.CreateAPK; case ApkButtonState.Create: return Text.CreateAPK;
case ApkButtonState.Creating: return Language.Text.CreatingAPK; case ApkButtonState.Creating: return Text.CreatingAPK;
default: return null; default: return null;
} }
} }
@ -287,9 +288,9 @@ namespace AM2RLauncher
{ {
//TODO: localizations //TODO: localizations
if (profile.Name.Contains("Community Updates")) if (profile.Name.Contains("Community Updates"))
profile.ProfileNotes = Language.Text.ArchiveNotesCommunityUpdates; profile.ProfileNotes = Text.ArchiveNotesCommunityUpdates;
else else
profile.ProfileNotes = Language.Text.ArchiveNotesMods + "\n\n" + profile.ProfileNotes; profile.ProfileNotes = Text.ArchiveNotesMods + "\n\n" + profile.ProfileNotes;
} }
profileDropDown.Items.Add(profile.Name); profileDropDown.Items.Add(profile.Name);
@ -323,8 +324,8 @@ namespace AM2RLauncher
// Refresh the author and version label on the main tab // Refresh the author and version label on the main tab
if (profileList.Count > 0) if (profileList.Count > 0)
{ {
profileAuthorLabel.Text = Language.Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author; profileAuthorLabel.Text = Text.Author + " " + profileList[profileDropDown.SelectedIndex].Author;
profileVersionLabel.Text = Language.Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version; profileVersionLabel.Text = Text.VersionLabel + " " + profileList[profileDropDown.SelectedIndex].Version;
} }
log.Info("Reloading UI components after loading successful."); log.Info("Reloading UI components after loading successful.");

@ -1,5 +1,6 @@
using AM2RLauncher.Core; using AM2RLauncher.Core;
using AM2RLauncher.Core.XML; using AM2RLauncher.Core.XML;
using AM2RLauncher.Language;
using Eto.Drawing; using Eto.Drawing;
using Eto.Forms; using Eto.Forms;
using log4net; using log4net;
@ -134,7 +135,7 @@ namespace AM2RLauncher
log.Info("Beginning UI initialization..."); log.Info("Beginning UI initialization...");
// System tray indicator // System tray indicator
showButton = new ButtonMenuItem { Text = Language.Text.TrayButtonShow }; showButton = new ButtonMenuItem { Text = Text.TrayButtonShow };
trayIndicator = new TrayIndicator trayIndicator = new TrayIndicator
{ {
Menu = new ContextMenu(showButton), Menu = new ContextMenu(showButton),
@ -189,8 +190,8 @@ namespace AM2RLauncher
foreach (var mirror in mirrorList) foreach (var mirror in mirrorList)
{ {
string text = mirror; string text = mirror;
if (text.Contains("github.com")) text = Language.Text.MirrorGithubText; if (text.Contains("github.com")) text = Text.MirrorGithubText;
else if (text.Contains("gitlab.com")) text = Language.Text.MirrorGitlabText; else if (text.Contains("gitlab.com")) text = Text.MirrorGitlabText;
mirrorDescriptionList.Add(new ListItem() { Key = mirror, Text = text }); mirrorDescriptionList.Add(new ListItem() { Key = mirror, Text = text });
} }
#endregion #endregion
@ -246,7 +247,7 @@ namespace AM2RLauncher
// APK button // APK button
apkButton = new ColorButton apkButton = new ColorButton
{ {
Text = Language.Text.CreateAPK, Text = Text.CreateAPK,
Height = 40, Height = 40,
Width = 250, Width = 250,
TextColor = colGreen, TextColor = colGreen,
@ -286,7 +287,7 @@ namespace AM2RLauncher
{ {
BackgroundColor = colBG, BackgroundColor = colBG,
Height = 15, Height = 15,
Text = Language.Text.CurrentProfile, Text = Text.CurrentProfile,
TextColor = colGreen TextColor = colGreen
}; };
@ -315,7 +316,7 @@ namespace AM2RLauncher
{ {
BackgroundColor = colBG, BackgroundColor = colBG,
Height = 16, Height = 16,
Text = Language.Text.Author + " ", Text = Text.Author + " ",
TextColor = colGreen TextColor = colGreen
}; };
@ -325,7 +326,7 @@ namespace AM2RLauncher
{ {
BackgroundColor = colBG, BackgroundColor = colBG,
Height = 16, Height = 16,
Text = Language.Text.VersionLabel + " ", Text = Text.VersionLabel + " ",
TextColor = colGreen TextColor = colGreen
}; };
@ -337,7 +338,7 @@ namespace AM2RLauncher
BackgroundColor = colBG, BackgroundColor = colBG,
Width = 20, Width = 20,
Height = 55, Height = 55,
Text = Language.Text.SaveLocationWarning, Text = Text.SaveLocationWarning,
TextColor = colRed TextColor = colRed
}; };
@ -345,16 +346,16 @@ namespace AM2RLauncher
// Social buttons // Social buttons
var redditButton = new ImageButton { ToolTip = Language.Text.RedditToolTip, Image = redditIcon }; var redditButton = new ImageButton { ToolTip = Text.RedditToolTip, Image = redditIcon };
redditButton.Click += RedditIconOnClick; redditButton.Click += RedditIconOnClick;
var githubButton = new ImageButton { ToolTip = Language.Text.GithubToolTip, Image = githubIcon }; var githubButton = new ImageButton { ToolTip = Text.GithubToolTip, Image = githubIcon };
githubButton.Click += GithubIconOnClick; githubButton.Click += GithubIconOnClick;
var youtubeButton = new ImageButton { ToolTip = Language.Text.YoutubeToolTip, Image = youtubeIcon }; var youtubeButton = new ImageButton { ToolTip = Text.YoutubeToolTip, Image = youtubeIcon };
youtubeButton.Click += YoutubeIconOnClick; youtubeButton.Click += YoutubeIconOnClick;
var discordButton = new ImageButton { ToolTip = Language.Text.DiscordToolTip, Image = discordIcon }; var discordButton = new ImageButton { ToolTip = Text.DiscordToolTip, Image = discordIcon };
discordButton.Click += DiscordIconOnClick; discordButton.Click += DiscordIconOnClick;
@ -395,7 +396,7 @@ namespace AM2RLauncher
mainPage = new TabPage mainPage = new TabPage
{ {
BackgroundColor = colBGNoAlpha, BackgroundColor = colBGNoAlpha,
Text = Language.Text.PlayTab, Text = Text.PlayTab,
Content = drawable Content = drawable
}; };
#endregion #endregion
@ -411,14 +412,14 @@ namespace AM2RLauncher
changelogNoConnectionLabel = new Label changelogNoConnectionLabel = new Label
{ {
Text = Language.Text.NoInternetConnection, Text = Text.NoInternetConnection,
TextColor = colGreen TextColor = colGreen
}; };
changelogPage = new TabPage changelogPage = new TabPage
{ {
BackgroundColor = colBGNoAlpha, BackgroundColor = colBGNoAlpha,
Text = Language.Text.ChangelogTab, Text = Text.ChangelogTab,
Content = new TableLayout Content = new TableLayout
{ {
@ -442,13 +443,13 @@ namespace AM2RLauncher
newsNoConnectionLabel = new Label newsNoConnectionLabel = new Label
{ {
Text = Language.Text.NoInternetConnection, Text = Text.NoInternetConnection,
TextColor = colGreen TextColor = colGreen
}; };
newsPage = new TabPage newsPage = new TabPage
{ {
Text = Language.Text.NewsTab, Text = Text.NewsTab,
BackgroundColor = colBGNoAlpha, BackgroundColor = colBGNoAlpha,
Content = new TableLayout Content = new TableLayout
@ -492,7 +493,7 @@ namespace AM2RLauncher
// LanguageLabel // LanguageLabel
languageLabel = new Label languageLabel = new Label
{ {
Text = Language.Text.LanguageNotice, Text = Text.LanguageNotice,
TextColor = colGreen TextColor = colGreen
}; };
@ -500,7 +501,7 @@ namespace AM2RLauncher
List<ListItem> languageList = new List<ListItem> List<ListItem> languageList = new List<ListItem>
{ {
Language.Text.SystemLanguage, Text.SystemLanguage,
"Deutsch", "Deutsch",
"English", "English",
"Español", "Español",
@ -535,7 +536,7 @@ namespace AM2RLauncher
autoUpdateAM2RCheck = new CheckBox autoUpdateAM2RCheck = new CheckBox
{ {
Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdateAM2R")), Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdateAM2R")),
Text = Language.Text.AutoUpdateAM2R, Text = Text.AutoUpdateAM2R,
TextColor = colGreen TextColor = colGreen
}; };
@ -544,7 +545,7 @@ namespace AM2RLauncher
autoUpdateLauncherCheck = new CheckBox autoUpdateLauncherCheck = new CheckBox
{ {
Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdateLauncher")), Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("AutoUpdateLauncher")),
Text = Language.Text.AutoUpdateLauncher, Text = Text.AutoUpdateLauncher,
TextColor = colGreen TextColor = colGreen
}; };
@ -552,7 +553,7 @@ namespace AM2RLauncher
hqMusicPCCheck = new CheckBox hqMusicPCCheck = new CheckBox
{ {
Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("MusicHQPC")), Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("MusicHQPC")),
Text = Language.Text.HighQualityPC, Text = Text.HighQualityPC,
TextColor = colGreen TextColor = colGreen
}; };
@ -560,7 +561,7 @@ namespace AM2RLauncher
hqMusicAndroidCheck = new CheckBox hqMusicAndroidCheck = new CheckBox
{ {
Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("MusicHQAndroid")), Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("MusicHQAndroid")),
Text = Language.Text.HighQualityAndroid, Text = Text.HighQualityAndroid,
TextColor = colGreen TextColor = colGreen
}; };
@ -568,7 +569,7 @@ namespace AM2RLauncher
profileDebugLogCheck = new CheckBox profileDebugLogCheck = new CheckBox
{ {
Checked = bool.Parse(CrossPlatformOperations.ReadFromConfig("ProfileDebugLog")), Checked = bool.Parse(CrossPlatformOperations.ReadFromConfig("ProfileDebugLog")),
Text = Language.Text.ProfileDebugCheckBox, Text = Text.ProfileDebugCheckBox,
TextColor = colGreen TextColor = colGreen
}; };
@ -578,7 +579,7 @@ namespace AM2RLauncher
{ {
customEnvVarLabel = new Label customEnvVarLabel = new Label
{ {
Text = Language.Text.CustomEnvVarLabel, Text = Text.CustomEnvVarLabel,
TextColor = colGreen TextColor = colGreen
}; };
} }
@ -598,7 +599,7 @@ namespace AM2RLauncher
// Mirror list // Mirror list
mirrorLabel = new Label mirrorLabel = new Label
{ {
Text = Language.Text.DownloadSource, Text = Text.DownloadSource,
TextColor = colGreen TextColor = colGreen
}; };
@ -621,7 +622,7 @@ namespace AM2RLauncher
customMirrorCheck = new CheckBox customMirrorCheck = new CheckBox
{ {
Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("CustomMirrorEnabled")), Checked = Boolean.Parse(CrossPlatformOperations.ReadFromConfig("CustomMirrorEnabled")),
Text = Language.Text.CustomMirrorCheck, Text = Text.CustomMirrorCheck,
TextColor = colGreen TextColor = colGreen
}; };
@ -641,7 +642,7 @@ namespace AM2RLauncher
{ {
BackgroundColor = colBGNoAlpha, BackgroundColor = colBGNoAlpha,
Content = settingsLayout, Content = settingsLayout,
Text = Language.Text.LauncherSettingsTab Text = Text.LauncherSettingsTab
}; };
#endregion #endregion
@ -655,7 +656,7 @@ namespace AM2RLauncher
addModButton = new ColorButton addModButton = new ColorButton
{ {
ToolTip = null, ToolTip = null,
Text = Language.Text.AddNewMod, Text = Text.AddNewMod,
Font = smallButtonFont, Font = smallButtonFont,
Height = 30, Height = 30,
Width = 275, Width = 275,
@ -672,7 +673,7 @@ namespace AM2RLauncher
settingsProfileLabel = new Label settingsProfileLabel = new Label
{ {
Text = Language.Text.CurrentProfile, Text = Text.CurrentProfile,
TextColor = colGreen, TextColor = colGreen,
Width = 275 Width = 275
}; };
@ -692,7 +693,7 @@ namespace AM2RLauncher
profileButton = new ColorButton profileButton = new ColorButton
{ {
ToolTip = null, ToolTip = null,
Text = Language.Text.OpenProfileFolder, Text = Text.OpenProfileFolder,
Font = smallButtonFont, Font = smallButtonFont,
Height = 30, Height = 30,
Width = 275, Width = 275,
@ -705,7 +706,7 @@ namespace AM2RLauncher
saveButton = new ColorButton saveButton = new ColorButton
{ {
ToolTip = null, ToolTip = null,
Text = Language.Text.OpenSaveFolder, Text = Text.OpenSaveFolder,
Font = smallButtonFont, Font = smallButtonFont,
Height = 30, Height = 30,
Width = 275, Width = 275,
@ -718,7 +719,7 @@ namespace AM2RLauncher
updateModButton = new ColorButton updateModButton = new ColorButton
{ {
ToolTip = null, ToolTip = null,
Text = Language.Text.UpdateModButtonText, Text = Text.UpdateModButtonText,
Font = smallButtonFont, Font = smallButtonFont,
Height = 30, Height = 30,
Width = 275, Width = 275,
@ -731,7 +732,7 @@ namespace AM2RLauncher
deleteModButton = new ColorButton deleteModButton = new ColorButton
{ {
ToolTip = null, ToolTip = null,
Text = Language.Text.DeleteModButtonText, Text = Text.DeleteModButtonText,
Font = smallButtonFont, Font = smallButtonFont,
Height = 30, Height = 30,
Width = 275, Width = 275,
@ -749,7 +750,7 @@ namespace AM2RLauncher
SpellCheck = false, SpellCheck = false,
Width = 275, Width = 275,
Height = 150, Height = 150,
Text = Language.Text.ProfileNotes Text = Text.ProfileNotes
}; };
profileLayout.BeginHorizontal(); profileLayout.BeginHorizontal();
@ -761,7 +762,7 @@ namespace AM2RLauncher
{ {
BackgroundColor = colBGNoAlpha, BackgroundColor = colBGNoAlpha,
Content = profileLayout, Content = profileLayout,
Text = Language.Text.ProfileSettingsTab Text = Text.ProfileSettingsTab
}; };
#endregion #endregion

@ -161,4 +161,15 @@ public static class HelperMethods
log.Info("Internet connection established!"); log.Info("Internet connection established!");
return true; return true;
} }
/// <summary>
/// Gets <paramref name="languageText"/> and replaces "$NAME" with <paramref name="replacementText"/>.
/// </summary>
/// <param name="languageText">The text to get</param>
/// <param name="replacementText">The text to replace "$NAME" with.</param>
/// <returns></returns>
public static string GetText(string languageText, string replacementText = "")
{
return languageText.Replace("$NAME", replacementText);
}
} }
Loading…
Cancel
Save