diff --git a/AnnoDesigner/AnnoCanvas.xaml.cs b/AnnoDesigner/AnnoCanvas.xaml.cs index 2e89cc5e..91f80920 100644 --- a/AnnoDesigner/AnnoCanvas.xaml.cs +++ b/AnnoDesigner/AnnoCanvas.xaml.cs @@ -674,7 +674,8 @@ public AnnoCanvas(BuildingPresets presetsToUse, } catch (Exception ex) { - _messageBoxService.ShowError(ex.Message, "Loading of the building presets failed"); + _messageBoxService.ShowError(ex.Message, + _localizationHelper.GetLocalization("LoadingPresetsFailed")); } sw.Stop(); @@ -695,7 +696,7 @@ public AnnoCanvas(BuildingPresets presetsToUse, { logger.Error(ex, "Loading of the icon names failed."); - _messageBoxService.ShowError("Loading of the icon names failed", + _messageBoxService.ShowError(_localizationHelper.GetLocalization("LoadingIconNamesFailed"), _localizationHelper.GetLocalization("Error")); } @@ -2393,8 +2394,9 @@ public void OpenFile(string filename, bool forceLoad = false) { logger.Warn(layoutEx, "Version of layout file is not supported."); - if (_messageBoxService.ShowQuestion("Try loading anyway?\nThis is very likely to fail or result in strange things happening.", - "File version unsupported")) + if (_messageBoxService.ShowQuestion( + _localizationHelper.GetLocalization("FileVersionUnsupportedMessage"), + _localizationHelper.GetLocalization("FileVersionUnsupportedTitle"))) { OpenFile(filename, true); } @@ -2413,7 +2415,7 @@ public void OpenFile(string filename, bool forceLoad = false) /// exception containing error information private void IOErrorMessageBox(Exception e) { - _messageBoxService.ShowError(e.Message, "Something went wrong while saving/loading file."); + _messageBoxService.ShowError(e.Message, _localizationHelper.GetLocalization("IOErrorMessage")); } #endregion diff --git a/AnnoDesigner/App.xaml.cs b/AnnoDesigner/App.xaml.cs index a1f0ce0c..0b607503 100644 --- a/AnnoDesigner/App.xaml.cs +++ b/AnnoDesigner/App.xaml.cs @@ -150,7 +150,7 @@ private async void Application_Startup(object sender, StartupEventArgs e) if (!createdNewMutex) { - _messageBoxService.ShowMessage("Another instance of the app is already running."); + _messageBoxService.ShowMessage(Localization.Localization.Instance.GetLocalization("AnotherInstanceIsAlreadyRunning")); Environment.Exit(-1); } } @@ -177,7 +177,7 @@ private async void Application_Startup(object sender, StartupEventArgs e) { logger.Error(ex, "Error upgrading settings."); - _messageBoxService.ShowError("The settings file has become corrupted. We must reset your settings."); + _messageBoxService.ShowError(_localizationHelper.GetLocalization("ErrorUpgradingSettings")); var fileName = ""; if (!string.IsNullOrEmpty(ex.Filename)) diff --git a/AnnoDesigner/Localization/Localization.cs b/AnnoDesigner/Localization/Localization.cs index d9eadf4e..3b0e9651 100644 --- a/AnnoDesigner/Localization/Localization.cs +++ b/AnnoDesigner/Localization/Localization.cs @@ -85,7 +85,11 @@ public static void Init(ICommons commons) { "FileVersion" , "File Version" }, { "PresetsVersion" , "Presets Version" }, { "CheckForUpdates" , "Check for updates" }, + { "VersionCheckErrorMessage" , $"Error checking version.{Environment.NewLine}More information can be found in the log." }, + { "VersionCheckErrorTitle" , "Version check failed." }, { "EnableAutomaticUpdateCheck" , "Enable automatic update check on startup" }, + { "ContinueCheckingForUpdates" , $"Do you want to continue checking for a new version on startup?{Environment.NewLine}{Environment.NewLine}This option can be changed via Tools -> Preferences -> Update Settings." }, + { "ContinueCheckingForUpdatesTitle" , "Continue checking for updates?" }, { "GoToProjectHomepage" , "Go to project homepage" }, { "OpenWelcomePage" , "Open Welcome page" }, { "AboutAnnoDesigner" , "About Anno Designer" }, @@ -142,6 +146,7 @@ public static void Init(ICommons commons) { "UnknownObject" , "Unknown object" }, { "PresetsLoaded" , "Building presets loaded" }, { "ExportImageSuccessful" , "Image was successfully exported." }, + { "ExportImageError" , "Something went wrong while exporting the image." }, { "ApplyColorToSelection" , "Apply color" }, { "ApplyColorToSelectionToolTip" , "Apply color to all buildings in current selection" }, { "ApplyPredefinedColorToSelection" , "Apply predefined color" }, @@ -217,7 +222,19 @@ public static void Init(ICommons commons) { "FileNotFound" , "The file was not found." }, { "Default" , "Default" }, { "ItemsCopied" , "items copied" }, - { "ItemCopied" , "item copied" } + { "ItemCopied" , "item copied" }, + { "LoadingPresetsFailed" , "Loading of the building presets failed." }, + { "LoadingIconNamesFailed" , "Loading of the icon names failed." }, + { "FileVersionUnsupportedMessage" , $"Try loading anyway?{Environment.NewLine}This is very likely to fail or result in strange things happening." }, + { "FileVersionUnsupportedTitle" , "File version unsupported" }, + { "IOErrorMessage" , "Something went wrong while saving/loading file." }, + { "AnotherInstanceIsAlreadyRunning" , "Another instance of the app is already running." }, + { "ErrorUpgradingSettings" , "The settings file has become corrupted. We must reset your settings." }, + { "FileVersionMismatchMessage" , $"Try loading anyway?{Environment.NewLine}This is very likely to fail or result in strange things happening." }, + { "FileVersionMismatchTItle" , "File version mismatch" }, + { "LayoutLoadingError" , "Something went wrong while loading the layout." }, + { "LayoutSavingError" , "Something went wrong while saving the layout." }, + { "InvalidBuildingConfiguration" , "Invalid building configuration." } } }, { @@ -251,7 +268,11 @@ public static void Init(ICommons commons) { "FileVersion" , "Dateiversion" }, { "PresetsVersion" , "Vorlagenversion" }, { "CheckForUpdates" , "Auf Updates prüfen" }, + { "VersionCheckErrorMessage" , $"Etwas ist bei der Updateprüfung schiefgegangen.{Environment.NewLine}Weitere Informationen finden Sie im Protokoll." }, + { "VersionCheckErrorTitle" , "Updateprüfung fehlgeschlagen." }, { "EnableAutomaticUpdateCheck" , "Automatische Updateprüfung beim Start aktivieren" }, + { "ContinueCheckingForUpdates" , $"Möchten Sie beim Start weiterhin nach einer neuen Version suchen?{Environment.NewLine}{Environment.NewLine}Diese Option kann über Werkzeuge -> Einstellungen -> Updates geändert werden." }, + { "ContinueCheckingForUpdatesTitle" , "Weiter nach Aktualisierungen suchen?" }, { "GoToProjectHomepage" , "Gehe zu Projekt Webseite" }, { "OpenWelcomePage" , "Willkommensseite öffnen" }, { "AboutAnnoDesigner" , "über Anno Designer" }, @@ -308,6 +329,7 @@ public static void Init(ICommons commons) { "UnknownObject" , "Unbekanntes Objekt" }, { "PresetsLoaded" , "Gebäudevorlagen geladen" }, { "ExportImageSuccessful" , "Das Bild wurde erfolgreich exportiert." }, + { "ExportImageError" , "Beim Exportieren des Bildes ging etwas schief." }, { "ApplyColorToSelection" , "Farbe anwenden" }, { "ApplyColorToSelectionToolTip" , "Farbe auf alle Gebäude in der aktuellen Auswahl anwenden" }, { "ApplyPredefinedColorToSelection" , "Vordefinierte Farbe anwenden" }, @@ -383,7 +405,19 @@ public static void Init(ICommons commons) { "FileNotFound" , "Die Datei wurde nicht gefunden." }, { "Default" , "Standard" }, { "ItemsCopied" , "Elemente kopiert" }, - { "ItemCopied" , "Element kopiert" } + { "ItemCopied" , "Element kopiert" }, + { "LoadingPresetsFailed" , "Das Laden der Gebäudevorlagen ist fehlgeschlagen." }, + { "LoadingIconNamesFailed" , "Das Laden der Iconnamen ist fehlgeschlagen." }, + { "FileVersionUnsupportedMessage" , $"Versuchen Sie trotzdem zu laden?{Environment.NewLine}Dies wird sehr wahrscheinlich fehlschlagen oder dazu führen, dass seltsame Dinge passieren." }, + { "FileVersionUnsupportedTitle" , "Dateiversion nicht unterstützt" }, + { "IOErrorMessage" , "Etwas ist beim Speichern/Laden der Datei schiefgegangen." }, + { "AnotherInstanceIsAlreadyRunning" , "Eine andere Instanz der App läuft bereits." }, + { "ErrorUpgradingSettings" , "Die Einstellungsdatei ist beschädigt worden. Wir müssen Ihre Einstellungen zurücksetzen." }, + { "FileVersionMismatchMessage" , $"Versuchen Sie trotzdem zu laden?{Environment.NewLine}Dies wird sehr wahrscheinlich fehlschlagen oder dazu führen, dass seltsame Dinge passieren." }, + { "FileVersionMismatchTItle" , "Unstimmigkeit der Dateiversion" }, + { "LayoutLoadingError" , "Beim Laden des Layouts ging etwas schief." }, + { "LayoutSavingError" , "Beim Speichern des Layouts ist etwas schiefgegangen." }, + { "InvalidBuildingConfiguration" , "Ungültige Gebäudekonfiguration." } } }, { @@ -417,7 +451,11 @@ public static void Init(ICommons commons) { "FileVersion" , "Version du fichier" }, { "PresetsVersion" , "Version du préréglage" }, { "CheckForUpdates" , "Vérifiez les mises à jour" }, + { "VersionCheckErrorMessage" , $"Quelque chose s'est mal passé lors de la vérification de la version d'erreur.{Environment.NewLine}Plus d'informations peuvent être trouvées dans le journal. exportation de l'image." }, + { "VersionCheckErrorTitle" , "La vérification de la version a échoué." }, { "EnableAutomaticUpdateCheck" , "Activer les mises à jour automatique au démarrage" }, + { "ContinueCheckingForUpdates" , $"Vous souhaitez continuer à vérifier si une nouvelle version est disponible au démarrage?{Environment.NewLine}{Environment.NewLine} Cette option peut être modifiée via Outils -> Préférences -> Mise à jour des paramètres." }, + { "ContinueCheckingForUpdatesTitle" , "Continuer à vérifier les mises à jour ?" }, { "GoToProjectHomepage" , "Visiter le site internet du projet" }, { "OpenWelcomePage" , "Ouvrir la page d'accueil" }, { "AboutAnnoDesigner" , "À propos d'Anno Designer" }, @@ -474,6 +512,7 @@ public static void Init(ICommons commons) { "UnknownObject" , "Object inconnu" }, { "PresetsLoaded" , "Préréglage du bâtiment importé" }, { "ExportImageSuccessful" , "L'image a été exportée correctement." }, + { "ExportImageError" , "Quelque chose s'est mal passé lors de l'exportation de l'image." }, { "ApplyColorToSelection" , "Appliquer la couleur" }, { "ApplyColorToSelectionToolTip" , "Appliquer la couleur à tous les bâtiments de la sélection courante" }, { "ApplyPredefinedColorToSelection" , "Appliquer la couleur prédéfinie" }, @@ -549,7 +588,19 @@ public static void Init(ICommons commons) { "FileNotFound" , "Le fichier n'a pas été retrouvé." }, { "Default" , "Défaut" }, { "ItemsCopied" , "éléments copiés" }, - { "ItemCopied" , "élément copié" } + { "ItemCopied" , "élément copié" }, + { "LoadingPresetsFailed" , "Le chargement des présélections du bâtiment a échoué." }, + { "LoadingIconNamesFailed" , "Le chargement des noms d'icônes a échoué." }, + { "FileVersionUnsupportedMessage" , $"Essayez de charger quand même?{Environment.NewLine}Il est très probable que cela échoue ou que des choses étranges se produisent." }, + { "FileVersionUnsupportedTitle" , "Version du fichier non prise en charge" }, + { "IOErrorMessage" , "Quelque chose s'est mal passé pendant l'enregistrement et le chargement du fichier." }, + { "AnotherInstanceIsAlreadyRunning" , "Une autre instance de l'application est déjà en cours d'exécution." }, + { "ErrorUpgradingSettings" , "Le fichier de configuration est corrompu. Nous devons réinitialiser vos paramètres." }, + { "FileVersionMismatchMessage" , $"Essayez quand même de charger?{Environment.NewLine}Il est très probable que cela échoue ou que des choses étranges se produisent." }, + { "FileVersionMismatchTItle" , "Mauvaise concordance des versions des fichiers" }, + { "LayoutLoadingError" , "Quelque chose s'est mal passé lors du chargement de la mise en page." }, + { "LayoutSavingError" , "Quelque chose s'est mal passé lors de la sauvegarde de la mise en page." }, + { "InvalidBuildingConfiguration" , "Configuration du bâtiment incorrecte." } } }, { @@ -583,7 +634,11 @@ public static void Init(ICommons commons) { "FileVersion" , "Wersja pliku" }, { "PresetsVersion" , "Presety-wersja" }, { "CheckForUpdates" , "Sprawdź aktualizacje" }, + { "VersionCheckErrorMessage" , $"Coś poszło nie tak podczas sprawdzania wersji Error.{Environment.NewLine}Więcej informacji można znaleźć w dzienniku. eksportowanie obrazu." }, + { "VersionCheckErrorTitle" , "Kontrola wersji nie powiodła się." }, { "EnableAutomaticUpdateCheck" , "Włączyć automatyczne sprawdzanie aktualizacji przy uruchamianiu" }, + { "ContinueCheckingForUpdates" , $"Czy chcesz kontynuować sprawdzanie nowej wersji przy starcie systemu?{Environment.NewLine}{Environment.NewLine}Opcja ta może zostać zmieniona poprzez Narzędzia -> Preferencje -> Ustawienia aktualizacji." }, + { "ContinueCheckingForUpdatesTitle" , "Kontynuować sprawdzanie pod kątem aktualizacji?" }, { "GoToProjectHomepage" , "Przejdź do strony projektu" }, { "OpenWelcomePage" , "Otwórz stronę powitalną" }, { "AboutAnnoDesigner" , "O Anno Designerze" }, @@ -640,6 +695,7 @@ public static void Init(ICommons commons) { "UnknownObject" , "Obiekt nieznany" }, { "PresetsLoaded" , "Presety budynków załadowano" }, { "ExportImageSuccessful" , "Obraz został pomyślnie wyeksportowany." }, + { "ExportImageError" , "Coś poszło nie tak podczas eksportu obrazu." }, { "ApplyColorToSelection" , "Zastosuj kolor" }, { "ApplyColorToSelectionToolTip" , "Zastosowanie koloru do wszystkich budynków w bieżącym wyborze" }, { "ApplyPredefinedColorToSelection" , "Zastosuj predefiniowany kolor" }, @@ -715,7 +771,19 @@ public static void Init(ICommons commons) { "FileNotFound" , "Plik nie został znaleziony." }, { "Default" , "Domyślnie" }, { "ItemsCopied" , "skopiowane elementy" }, - { "ItemCopied" , "skopiowany przedmiot" } + { "ItemCopied" , "skopiowany przedmiot" }, + { "LoadingPresetsFailed" , "Załadowanie ustawień budynku nie powiodło się." }, + { "LoadingIconNamesFailed" , "Wczytywanie nazw ikon nie powiodło się." }, + { "FileVersionUnsupportedMessage" , $"Spróbujesz załadować?{Environment.NewLine}Jest bardzo prawdopodobne, że to się nie uda lub doprowadzi do dziwnych rzeczy." }, + { "FileVersionUnsupportedTitle" , "Wersja pliku nieobsługiwana" }, + { "IOErrorMessage" , "Coś poszło nie tak podczas zapisywania/ładowania pliku." }, + { "AnotherInstanceIsAlreadyRunning" , "Inny przykład aplikacji jest już uruchomiony." }, + { "ErrorUpgradingSettings" , "Plik z ustawieniami został uszkodzony. Musimy zresetować Twoje ustawienia." }, + { "FileVersionMismatchMessage" , $"Próbujesz załadować aplikację?{Environment.NewLine}Jest bardzo prawdopodobne, że to się nie uda lub doprowadzi do dziwnych rzeczy." }, + { "FileVersionMismatchTItle" , "Niedopasowanie wersji pliku" }, + { "LayoutLoadingError" , "Coś poszło nie tak podczas ładowania układu." }, + { "LayoutSavingError" , "Coś poszło nie tak podczas zapisywania układu." }, + { "InvalidBuildingConfiguration" , "Nieprawidłowa konfiguracja budynku." } } }, { @@ -749,7 +817,11 @@ public static void Init(ICommons commons) { "FileVersion" , "Версия файла" }, { "PresetsVersion" , "Версия пресета" }, { "CheckForUpdates" , "Проверить наличие обновлений" }, + { "VersionCheckErrorMessage" , $"Версия для проверки ошибок.{Environment.NewLine}Дополнительную информацию можно найти в журнале." }, + { "VersionCheckErrorTitle" , "Проверка версии не прошла." }, { "EnableAutomaticUpdateCheck" , "Включить автоматическую проверку обновлений при запуске" }, + { "ContinueCheckingForUpdates" , $"Хотите продолжить проверку новой версии при старте?{Environment.NewLine}{Environment.NewLine}Эту опцию можно изменить через Инструменты -> Параметры -> Обновить настройки." }, + { "ContinueCheckingForUpdatesTitle" , "Продолжать проверку обновлений?" }, { "GoToProjectHomepage" , "Перейти на главную страницу" }, { "OpenWelcomePage" , "Открыть страницу приветствия" }, { "AboutAnnoDesigner" , "О Anno Дизайнер" }, @@ -806,6 +878,7 @@ public static void Init(ICommons commons) { "UnknownObject" , "Неизвестный объект" }, { "PresetsLoaded" , "Загружаются пресеты зданий" }, { "ExportImageSuccessful" , "Изображение было успешно экспортировано." }, + { "ExportImageError" , "Что-то пошло не так при экспорте изображения." }, { "ApplyColorToSelection" , "Применить цвет" }, { "ApplyColorToSelectionToolTip" , "Применить цвет ко всем зданиям в текущем выборе" }, { "ApplyPredefinedColorToSelection" , "Применить предопределенный цвет" }, @@ -881,7 +954,19 @@ public static void Init(ICommons commons) { "FileNotFound" , "Файл не был найден." }, { "Default" , "По умолчанию" }, { "ItemsCopied" , "списанные предметы" }, - { "ItemCopied" , "скопированный элемент" } + { "ItemCopied" , "скопированный элемент" }, + { "LoadingPresetsFailed" , "Загрузка строительных предустановок не удалась." }, + { "LoadingIconNamesFailed" , "Загрузка имен иконок не удалась." }, + { "FileVersionUnsupportedMessage" , $"Попробуешь загрузить?{Environment.NewLine}Это очень вероятно приведет к неудаче или к странным вещам." }, + { "FileVersionUnsupportedTitle" , "Версия файла не поддерживается" }, + { "IOErrorMessage" , "Что-то пошло не так при сохранении/загрузке файла." }, + { "AnotherInstanceIsAlreadyRunning" , "Другой экземпляр приложения уже запущен." }, + { "ErrorUpgradingSettings" , "Файл настроек поврежден. Мы должны сбросить ваши настройки." }, + { "FileVersionMismatchMessage" , $"Попробуйте загрузить?{Environment.NewLine}Скорее всего, это приведет к ошибке или странным вещам." }, + { "FileVersionMismatchTItle" , "Несоответствие версии файла" }, + { "LayoutLoadingError" , "Что-то пошло не так во время загрузки макета." }, + { "LayoutSavingError" , "Что-то пошло не так во время сохранения макета." }, + { "InvalidBuildingConfiguration" , "Неверная конфигурация здания." } } }, }; diff --git a/AnnoDesigner/ViewModels/MainViewModel.cs b/AnnoDesigner/ViewModels/MainViewModel.cs index b996e496..60db69d2 100644 --- a/AnnoDesigner/ViewModels/MainViewModel.cs +++ b/AnnoDesigner/ViewModels/MainViewModel.cs @@ -312,7 +312,8 @@ private void ApplyPreset(AnnoObject selectedItem) catch (Exception ex) { logger.Error(ex, "Error applying preset."); - _messageBoxService.ShowError("Something went wrong while applying the preset.", + _messageBoxService.ShowError( + _localizationHelper.GetLocalization("LayoutLoadingError"), _localizationHelper.GetLocalization("Error")); } } @@ -982,8 +983,9 @@ private void ExecuteLoadLayoutFromJsonSub(string jsonString, bool forceLoad = fa { logger.Warn(layoutEx, "Version of layout does not match."); - if (_messageBoxService.ShowQuestion("Try loading anyway?\nThis is very likely to fail or result in strange things happening.", - "File version mismatch")) + if (_messageBoxService.ShowQuestion( + _localizationHelper.GetLocalization("FileVersionMismatchMessage"), + _localizationHelper.GetLocalization("FileVersionMismatchTitle"))) { ExecuteLoadLayoutFromJsonSub(jsonString, true); } @@ -991,7 +993,7 @@ private void ExecuteLoadLayoutFromJsonSub(string jsonString, bool forceLoad = fa catch (Exception ex) { logger.Error(ex, "Error loading layout from JSON."); - _messageBoxService.ShowError("Something went wrong while loading the layout.", + _messageBoxService.ShowError(_localizationHelper.GetLocalization("LayoutLoadingError"), _localizationHelper.GetLocalization("Error")); } } @@ -1071,7 +1073,7 @@ private void ExecuteExportImageSub(bool exportZoom, bool exportSelection) { logger.Error(ex, "Error exporting image."); _messageBoxService.ShowError(Application.Current.MainWindow, - "Something went wrong while exporting the image.", + _localizationHelper.GetLocalization("ExportImageError"), _localizationHelper.GetLocalization("Error")); } } @@ -1223,7 +1225,7 @@ private void ExecuteCopyLayoutToClipboardSub() catch (Exception ex) { logger.Error(ex, "Error saving layout to JSON."); - _messageBoxService.ShowError(ex.Message, "Something went wrong while saving the layout."); + _messageBoxService.ShowError(ex.Message, _localizationHelper.GetLocalization("LayoutSavingError")); } } @@ -1304,7 +1306,8 @@ private void ExecutePlaceBuilding(object param) } catch (Exception) { - _messageBoxService.ShowError("Error: Invalid building configuration.", + _messageBoxService.ShowError( + _localizationHelper.GetLocalization("InvalidBuildingConfiguration"), _localizationHelper.GetLocalization("Error")); } } diff --git a/AnnoDesigner/ViewModels/UpdateSettingsViewModel.cs b/AnnoDesigner/ViewModels/UpdateSettingsViewModel.cs index 28d9ae4c..e979846a 100644 --- a/AnnoDesigner/ViewModels/UpdateSettingsViewModel.cs +++ b/AnnoDesigner/ViewModels/UpdateSettingsViewModel.cs @@ -84,8 +84,8 @@ public async Task CheckForUpdates(bool isAutomaticUpdateCheck) _appSettings.PromptedForAutoUpdateCheck = true; if (!_messageBoxService.ShowQuestion(Application.Current.MainWindow, - "Do you want to continue checking for a new version on startup?\n\nThis option can be changed from the help menu.", - "Continue checking for updates?")) + _localizationHelper.GetLocalization("ContinueCheckingForUpdates"), + _localizationHelper.GetLocalization("ContinueCheckingForUpdatesTitle"))) { AutomaticUpdateCheck = false; } @@ -105,8 +105,8 @@ public async Task CheckForUpdates(bool isAutomaticUpdateCheck) if (isAutomaticUpdateCheck) { _messageBoxService.ShowError(Application.Current.MainWindow, - $"Error checking version.{Environment.NewLine}{Environment.NewLine}More information is found in the log.", - "Version check failed"); + _localizationHelper.GetLocalization("VersionCheckErrorMessage"), + _localizationHelper.GetLocalization("VersionCheckErrorTitle")); } } }