diff --git a/.vscode/launch.json b/.vscode/launch.json index 6152e08..b022184 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/Nebula.Launcher/bin/Debug/net9.0/Nebula.Launcher.dll", + "program": "${workspaceFolder}/Nebula.Launcher/bin/Debug/Nebula.Launcher.dll", "args": [], "cwd": "${workspaceFolder}/Nebula.Launcher", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console diff --git a/Nebula.Launcher/Assets/lang/en-US.ftl b/Nebula.Launcher/Assets/lang/en-US.ftl index e69de29..5601214 100644 --- a/Nebula.Launcher/Assets/lang/en-US.ftl +++ b/Nebula.Launcher/Assets/lang/en-US.ftl @@ -0,0 +1,48 @@ +tab-account = Account +tab-servers = Servers +tab-content = Content +tab-settings = Settings +vcruntime-check-error = VC runtime dlls are not present on this computer. Install VC runtime dlls. +migration-label-task = Migration task, please wait... +task-cancel = Cancel + +popup-edit-name = Edit server name +popup-add-favorite = Add favorite +popup-exception = Exception was thrown +popup-information = Information +popup-loading = Loading... +popup-twofa = 2fa + +account-profiles = Profiles +account-profile-select = Select +account-profile-delete = Delete +account-auth-retry = Retry Authentication +account-auth-try-another = Or try another account +account-auth-login = Enter your login +account-auth-password = Enter your password +account-auth-server = Authentication Server +account-auth-button = Authenticate +account-auth-save = Save Profile +account-auth-hello = Hello, +account-auth-logout = Log out + +auth-processing = Processing authentication request... +auth-error = An authentication error has occurred. +auth-error-occured = An error occurred during the authentication process. +auth-invalid-credentials = Invalid username or password. Please try again. +auth-connection-error = Unable to connect to the authentication server. +auth-name-resolution-error = Failed to resolve server address. Check your network or server configuration. +auth-config-read = Reading authentication configuration... +auth-try-auth-config = Attempting to authenticate using saved configuration. + +config-export-logs = Export logs +config-open-data = Open data path +config-reset = Reset to default +config-save = Save changes + +filter-roleplay = Roleplay +filter-language = Language +favorite-add = Add to favorites +servername-set = Set server name +twofa-enabled = You have two-factor authentication enabled. Please enter the code. +twofa-set = Proceed \ No newline at end of file diff --git a/Nebula.Launcher/Assets/lang/ru-RU.ftl b/Nebula.Launcher/Assets/lang/ru-RU.ftl index e69de29..34bf207 100644 --- a/Nebula.Launcher/Assets/lang/ru-RU.ftl +++ b/Nebula.Launcher/Assets/lang/ru-RU.ftl @@ -0,0 +1,48 @@ +tab-account = Аккаунт +tab-servers = Серверы +tab-content = Контент +tab-settings = Настройки +vcruntime-check-error = VC runtime dll-библиотеки отсутствуют на этом компьютере. Установите VC runtime dll. +migration-label-task = Задача миграции, подождите... +task-cancel = Отмена + +popup-edit-name = Изменить имя сервера +popup-add-favorite = Добавить в избранное +popup-exception = Произошло исключение +popup-information = Информация +popup-loading = Загрузка... +popup-twofa = 2FA + +account-profiles = Профили +account-profile-select = Выбрать +account-profile-delete = Удалить +account-auth-retry = Повторить аутентификацию +account-auth-try-another = Или попробуйте другой аккаунт +account-auth-login = Введите логин +account-auth-password = Введите пароль +account-auth-server = Сервер аутентификации +account-auth-button = Аутентифицировать +account-auth-save = Сохранить профиль +account-auth-hello = Привет, +account-auth-logout = Выйти + +auth-processing = Обработка запроса аутентификации... +auth-error = Произошла ошибка аутентификации. +auth-error-occured = Во время аутентификации произошла ошибка. +auth-invalid-credentials = Неверное имя пользователя или пароль. Попробуйте еще раз. +auth-connection-error = Не удается подключиться к серверу аутентификации. +auth-name-resolution-error = Не удалось разрешить адрес сервера. Проверьте сетевые настройки или конфигурацию сервера. +auth-config-read = Чтение конфигурации аутентификации... +auth-try-auth-config = Попытка аутентификации с использованием сохраненной конфигурации. + +config-export-logs = Экспортировать логи +config-open-data = Открыть путь данных +config-reset = Сбросить к значениям по умолчанию +config-save = Сохранить изменения + +filter-roleplay = Ролевая игра +filter-language = Язык +favorite-add = Добавить в избранное +servername-set = Установить имя сервера +twofa-enabled = У вас включена двухфакторная аутентификация. Введите код. +twofa-set = Продолжить \ No newline at end of file diff --git a/Nebula.Launcher/Controls/FilterBox.cs b/Nebula.Launcher/Controls/FilterBox.cs index dbf11da..a0f9314 100644 --- a/Nebula.Launcher/Controls/FilterBox.cs +++ b/Nebula.Launcher/Controls/FilterBox.cs @@ -19,13 +19,16 @@ public class FilterBox : UserControl public Action? OnFilterChanged {get; set;} - public string? FilterBoxName { - set => filterName.Text = value; - get => filterName.Text; + public string FilterBoxName { + set => filterName.LocalId = value; + get => filterName.LocalId; } private StackPanel filterPanel; - private TextBox filterName = new TextBox(); + private LocalizedLabel filterName = new LocalizedLabel() + { + VerticalAlignment = VerticalAlignment.Center + }; public FilterBox() { @@ -34,6 +37,8 @@ public class FilterBox : UserControl Orientation = Orientation.Horizontal, Spacing = 5, }; + + filterPanel.Children.Add(filterName); Content = filterPanel; } diff --git a/Nebula.Launcher/Controls/LocalizedLabel.cs b/Nebula.Launcher/Controls/LocalizedLabel.cs new file mode 100644 index 0000000..4cdc949 --- /dev/null +++ b/Nebula.Launcher/Controls/LocalizedLabel.cs @@ -0,0 +1,20 @@ +using Avalonia; +using Avalonia.Controls; +using Nebula.Launcher.Services; + +namespace Nebula.Launcher.Controls; + +public class LocalizedLabel : Label +{ + public static readonly StyledProperty LocalIdProperty = AvaloniaProperty.Register(nameof(LocalId)); + + public string LocalId + { + get => GetValue(LocalIdProperty); + set + { + SetValue(LocalIdProperty, value); + Content = LocalisationService.GetString(value); + } + } +} \ No newline at end of file diff --git a/Nebula.Launcher/LauncherConVar.cs b/Nebula.Launcher/LauncherConVar.cs index a14ac80..2dc5bf5 100644 --- a/Nebula.Launcher/LauncherConVar.cs +++ b/Nebula.Launcher/LauncherConVar.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using Nebula.Launcher.Models; using Nebula.Launcher.ViewModels.Pages; using Nebula.Shared.Services; @@ -36,7 +37,7 @@ public static class LauncherConVar new ServerHubRecord("AltHub","https://web.networkgamez.com/api/servers") ]); - public static readonly ConVar CurrentLang = ConVarBuilder.Build("launcher.language", "en-US"); + public static readonly ConVar CurrentLang = ConVarBuilder.Build("launcher.language", CultureInfo.CurrentCulture.Name); public static readonly ConVar ILSpyUrl = ConVarBuilder.Build("decompiler.url", "https://github.com/icsharpcode/ILSpy/releases/download/v9.0/ILSpy_binaries_9.0.0.7889-x64.zip"); diff --git a/Nebula.Launcher/Services/LocalisationService.cs b/Nebula.Launcher/Services/LocalisationService.cs index dbaf6dc..b00f29f 100644 --- a/Nebula.Launcher/Services/LocalisationService.cs +++ b/Nebula.Launcher/Services/LocalisationService.cs @@ -1,6 +1,8 @@ using System; +using System.Collections.Generic; using System.Globalization; using System.IO; +using Avalonia.Markup.Xaml; using Avalonia.Platform; using Fluent.Net; using Nebula.Shared; @@ -14,33 +16,63 @@ public partial class LocalisationService [GenerateProperty] private ConfigurationService ConfigurationService { get; } private CultureInfo _currentCultureInfo = CultureInfo.CurrentCulture; - private MessageContext _currentMessageContext; - + private static MessageContext? _currentMessageContext; + private void Initialise() { - // LoadLanguage(CultureInfo.GetCultureInfo(ConfigurationService.GetConfigValue(LauncherConVar.CurrentLang)!)); + LoadLanguage(CultureInfo.GetCultureInfo(ConfigurationService.GetConfigValue(LauncherConVar.CurrentLang)!)); } public void LoadLanguage(CultureInfo cultureInfo) { - _currentCultureInfo = cultureInfo; - using var fs = AssetLoader.Open(new Uri($@"Assets/lang/{_currentCultureInfo.EnglishName}.ftl")); - using var sr = new StreamReader(fs); - - var options = new MessageContextOptions { UseIsolating = false }; - var mc = new MessageContext(cultureInfo.EnglishName, options); - var errors = mc.AddMessages(sr); - foreach (var error in errors) + try { - Console.WriteLine(error); - } + _currentCultureInfo = cultureInfo; + using var fs = AssetLoader.Open(new Uri($@"avares://Nebula.Launcher/Assets/lang/{_currentCultureInfo.Name}.ftl")); + using var sr = new StreamReader(fs); - _currentMessageContext = mc; + var options = new MessageContextOptions { UseIsolating = false }; + var mc = new MessageContext(cultureInfo.Name, options); + var errors = mc.AddMessages(sr); + foreach (var error in errors) + { + Console.WriteLine(error); + } + + + _currentMessageContext = mc; + } catch (Exception e) { + LoadLanguage(CultureInfo.GetCultureInfo("en-US")); + } } private void InitialiseInDesignMode() { Initialise(); } + + public static string GetString(string locale) + { + if (_currentMessageContext is null) + { + Console.WriteLine("ERROR SHIT BITHC!"); + return locale; + } + var message = _currentMessageContext.GetMessage(locale); + if (message == null) return locale; + return _currentMessageContext.Format(message, new Dictionary()); + } } +public class LocaledText : MarkupExtension +{ + public string Key { get; set; } + + public LocaledText(string key) => Key = key; + + public override object ProvideValue(IServiceProvider serviceProvider) + { + // Fetch the localized string using the key + return LocalisationService.GetString(Key); + } +} \ No newline at end of file diff --git a/Nebula.Launcher/ViewModels/MainViewModel.cs b/Nebula.Launcher/ViewModels/MainViewModel.cs index 9c3237f..ddea190 100644 --- a/Nebula.Launcher/ViewModels/MainViewModel.cs +++ b/Nebula.Launcher/ViewModels/MainViewModel.cs @@ -23,10 +23,10 @@ public partial class MainViewModel : ViewModelBase { private readonly List _templates = [ - new ListItemTemplate(typeof(AccountInfoViewModel), "user", "Account"), - new ListItemTemplate(typeof(ServerOverviewModel), "file", "Servers"), - new ListItemTemplate(typeof(ContentBrowserViewModel), "folder", "Content"), - new ListItemTemplate(typeof(ConfigurationViewModel), "settings", "Settings") + new ListItemTemplate(typeof(AccountInfoViewModel), "user", "tab-account"), + new ListItemTemplate(typeof(ServerOverviewModel), "file", "tab-servers"), + new ListItemTemplate(typeof(ContentBrowserViewModel), "folder", "tab-content"), + new ListItemTemplate(typeof(ConfigurationViewModel), "settings", "tab-settings") ]; private readonly List _viewQueue = new(); @@ -41,6 +41,7 @@ public partial class MainViewModel : ViewModelBase [ObservableProperty] private bool _popup; [ObservableProperty] private ListItemTemplate? _selectedListItem; + [GenerateProperty] private LocalisationService LocalisationService { get; } [GenerateProperty] private DebugService DebugService { get; } = default!; [GenerateProperty] private PopupMessageService PopupMessageService { get; } = default!; [GenerateProperty] private ContentService ContentService { get; } = default!; @@ -53,7 +54,11 @@ public partial class MainViewModel : ViewModelBase protected override void InitialiseInDesignMode() { - Items = new ObservableCollection(_templates); + Items = new ObservableCollection(_templates.Select(a=> + { + return new ListItemTemplate(a.ModelType, a.IconKey, LocalisationService.GetString(a.Label)); + } + )); RequirePage(); } @@ -76,7 +81,7 @@ public partial class MainViewModel : ViewModelBase if (!VCRuntimeDllChecker.AreVCRuntimeDllsPresent()) { - OnPopupRequired("VC runtime dlls are not present on this computer. Install VC runtime dlls."); + OnPopupRequired(LocalisationService.GetString("vcruntime-check-error")); Helper.OpenBrowser("https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170"); } } @@ -87,7 +92,7 @@ public partial class MainViewModel : ViewModelBase return; var loadingHandler = ViewHelperService.GetViewModel(); - loadingHandler.LoadingName = "Migration task, please wait..."; + loadingHandler.LoadingName = LocalisationService.GetString("migration-label-task"); loadingHandler.IsCancellable = false; if (!ContentService.CheckMigration(loadingHandler)) diff --git a/Nebula.Launcher/ViewModels/Pages/AccountInfoViewModel.cs b/Nebula.Launcher/ViewModels/Pages/AccountInfoViewModel.cs index f21ef28..404df69 100644 --- a/Nebula.Launcher/ViewModels/Pages/AccountInfoViewModel.cs +++ b/Nebula.Launcher/ViewModels/Pages/AccountInfoViewModel.cs @@ -38,6 +38,7 @@ public partial class AccountInfoViewModel : ViewModelBase [ObservableProperty] private bool _doRetryAuth; private bool _isProfilesEmpty; + [GenerateProperty] private LocalisationService LocalisationService { get; } [GenerateProperty] private PopupMessageService PopupMessageService { get; } = default!; [GenerateProperty] private ConfigurationService ConfigurationService { get; } = default!; [GenerateProperty] private DebugService DebugService { get; } @@ -79,7 +80,7 @@ public partial class AccountInfoViewModel : ViewModelBase public void DoAuth(string? code = null) { var message = ViewHelperService.GetViewModel(); - message.InfoText = "Auth think, please wait..."; + message.InfoText = LocalisationService.GetString("auth-processing"); message.IsInfoClosable = false; PopupMessageService.Popup(message); @@ -102,7 +103,7 @@ public partial class AccountInfoViewModel : ViewModelBase } catch (Exception ex) { - var unexpectedError = new Exception("An unexpected error occurred during authentication.", ex); + var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), ex); _logger.Error(unexpectedError); PopupMessageService.Popup(unexpectedError); } @@ -112,7 +113,7 @@ public partial class AccountInfoViewModel : ViewModelBase if (!IsLogged) { - PopupMessageService.Popup(new Exception("No one of auth server is available.", exception)); + PopupMessageService.Popup(exception ?? new Exception(LocalisationService.GetString("auth-error"))); } }); } @@ -156,7 +157,7 @@ public partial class AccountInfoViewModel : ViewModelBase _logger.Log("TFA required"); break; case AuthenticateDenyCode.InvalidCredentials: - PopupError("Invalid Credentials! Please, try another password or login!", e); + PopupError(LocalisationService.GetString("auth-invalid-credentials"), e); break; default: throw; @@ -168,17 +169,17 @@ public partial class AccountInfoViewModel : ViewModelBase switch (e.HttpRequestError) { case HttpRequestError.ConnectionError: - PopupError("Failed to connect to the authentication server.", e); + PopupError(LocalisationService.GetString("auth-connection-error"), e); DoRetryAuth = true; break; case HttpRequestError.NameResolutionError: - PopupError("Unable to resolve the server address.", e); + PopupError(LocalisationService.GetString("auth-name-resolution-error"), e); DoRetryAuth = true; break; default: - var authError = new Exception("An error occurred during authentication.", e); + var authError = new Exception(LocalisationService.GetString("auth-error"), e); _logger.Error(authError); PopupMessageService.Popup(authError); break; @@ -223,10 +224,10 @@ public partial class AccountInfoViewModel : ViewModelBase Accounts.Add(alpm); } - private async Task ReadAuthConfig() + private void ReadAuthConfig() { var message = ViewHelperService.GetViewModel(); - message.InfoText = "Read configuration file, please wait..."; + message.InfoText = LocalisationService.GetString("auth-config-read"); message.IsInfoClosable = false; PopupMessageService.Popup(message); foreach (var profile in @@ -247,7 +248,7 @@ public partial class AccountInfoViewModel : ViewModelBase public async void DoCurrentAuth() { var message = ViewHelperService.GetViewModel(); - message.InfoText = "Trying to auth with saved data..."; + message.InfoText = LocalisationService.GetString("auth-try-auth-config"); message.IsInfoClosable = false; PopupMessageService.Popup(message); @@ -261,7 +262,7 @@ public partial class AccountInfoViewModel : ViewModelBase } catch (Exception ex) { - var unexpectedError = new Exception("An unexpected error occurred during authentication.", ex); + var unexpectedError = new Exception(LocalisationService.GetString("auth-error"), ex); _logger.Error(unexpectedError); PopupMessageService.Popup(unexpectedError); return; @@ -290,7 +291,7 @@ public partial class AccountInfoViewModel : ViewModelBase private void PopupError(string message, Exception e) { - message = "An error occurred during authentication: " + message; + message = LocalisationService.GetString("auth-error-occured") + message; _logger.Error(new Exception(message, e)); var messageView = ViewHelperService.GetViewModel(); diff --git a/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs b/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs index 61bdc0a..b4fef62 100644 --- a/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs +++ b/Nebula.Launcher/ViewModels/Pages/ConfigurationViewModel.cs @@ -200,7 +200,10 @@ public sealed class ArrayUnitConfigControl : Border, IConfigControl { private readonly List _itemControls = []; private readonly StackPanel _itemsPanel = new StackPanel() { Orientation = Orientation.Vertical }; - private readonly Button _addButton = new Button() { Content = "Add Item", Classes = { "ConfigBorder" }}; + private readonly Button _addButton = new Button() { Content = new Label() + { + Content = "Add Item" + }, Classes = { "ConfigBorder" }}; private readonly int _oldCount; private readonly Type _elementType; private readonly StackPanel _panel = new(); @@ -232,7 +235,7 @@ public sealed class ArrayUnitConfigControl : Border, IConfigControl { var itemPanel = new StackPanel { Orientation = Orientation.Horizontal, Spacing = 2 }; var control = ConfigControlHelper.GetConfigControl(_itemControls.Count.ToString(), value); - var removeButton = new Button { Content = "Remove", Classes = { "ConfigBorder" }}; + var removeButton = new Button { Content = new Label(){ Content = "Remove" }, Classes = { "ConfigBorder" }}; removeButton.Click += (_, _) => { diff --git a/Nebula.Launcher/ViewModels/Popup/AddFavoriteViewModel.cs b/Nebula.Launcher/ViewModels/Popup/AddFavoriteViewModel.cs index 779700e..2cd4bb5 100644 --- a/Nebula.Launcher/ViewModels/Popup/AddFavoriteViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/AddFavoriteViewModel.cs @@ -1,6 +1,7 @@ using System; using CommunityToolkit.Mvvm.ComponentModel; using Nebula.Launcher.ServerListProviders; +using Nebula.Launcher.Services; using Nebula.Launcher.ViewModels.Pages; using Nebula.Launcher.Views.Pages; using Nebula.Shared.Services; @@ -30,7 +31,7 @@ public partial class AddFavoriteViewModel : PopupViewModelBase [GenerateProperty] private ServerOverviewModel ServerOverviewModel { get; } [GenerateProperty] private DebugService DebugService { get; } [GenerateProperty] private FavoriteServerListProvider FavoriteServerListProvider { get; } - public override string Title => "Add to favorite"; + public override string Title => LocalisationService.GetString("popup-add-favorite"); public override bool IsClosable => true; [ObservableProperty] private string _ipInput; diff --git a/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs b/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs index 6a54204..96d15a5 100644 --- a/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/EditServerNameViewModel.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.ComponentModel; +using Nebula.Launcher.Services; using Nebula.Launcher.Views.Popup; using Nebula.Shared.Services; @@ -10,7 +11,7 @@ public sealed partial class EditServerNameViewModel : PopupViewModelBase { [GenerateProperty] public override PopupMessageService PopupMessageService { get; } [GenerateProperty] public ConfigurationService ConfigurationService { get; } - public override string Title => "Edit server name"; + public override string Title => LocalisationService.GetString("popup-edit-name"); public override bool IsClosable => true; [ObservableProperty] private string _ipInput; diff --git a/Nebula.Launcher/ViewModels/Popup/ExceptionListViewModel.cs b/Nebula.Launcher/ViewModels/Popup/ExceptionListViewModel.cs index 207b84d..7fe5332 100644 --- a/Nebula.Launcher/ViewModels/Popup/ExceptionListViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/ExceptionListViewModel.cs @@ -1,5 +1,6 @@ using System; using System.Collections.ObjectModel; +using Nebula.Launcher.Services; using Nebula.Launcher.Views.Popup; using Nebula.Shared.Services; @@ -10,7 +11,7 @@ namespace Nebula.Launcher.ViewModels.Popup; public sealed partial class ExceptionListViewModel : PopupViewModelBase { [GenerateProperty] public override PopupMessageService PopupMessageService { get; } - public override string Title => "Exception was thrown"; + public override string Title => LocalisationService.GetString("popup-exception"); public override bool IsClosable => true; public ObservableCollection Errors { get; } = new(); diff --git a/Nebula.Launcher/ViewModels/Popup/InfoPopupViewModel.cs b/Nebula.Launcher/ViewModels/Popup/InfoPopupViewModel.cs index fc1a107..4dbcb16 100644 --- a/Nebula.Launcher/ViewModels/Popup/InfoPopupViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/InfoPopupViewModel.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.ComponentModel; +using Nebula.Launcher.Services; using Nebula.Launcher.Views.Popup; using Nebula.Shared.Services; @@ -12,7 +13,7 @@ public partial class InfoPopupViewModel : PopupViewModelBase [ObservableProperty] private string _infoText = "Test"; - public override string Title => "Info"; + public override string Title => LocalisationService.GetString("popup-information"); public bool IsInfoClosable { get; set; } = true; public override bool IsClosable => IsInfoClosable; diff --git a/Nebula.Launcher/ViewModels/Popup/LoadingContextViewModel.cs b/Nebula.Launcher/ViewModels/Popup/LoadingContextViewModel.cs index 6e39aab..822f1cd 100644 --- a/Nebula.Launcher/ViewModels/Popup/LoadingContextViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/LoadingContextViewModel.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Mvvm.ComponentModel; +using Nebula.Launcher.Services; using Nebula.Launcher.Views.Popup; using Nebula.Shared.Models; using Nebula.Shared.Services; @@ -16,7 +17,7 @@ public sealed partial class LoadingContextViewModel : PopupViewModelBase, ILoadi [ObservableProperty] private int _resolvedJobs; - public string LoadingName { get; set; } = "Loading..."; + public string LoadingName { get; set; } = LocalisationService.GetString("popup-loading"); public bool IsCancellable { get; set; } = true; public override bool IsClosable => false; diff --git a/Nebula.Launcher/ViewModels/Popup/TfaViewModel.cs b/Nebula.Launcher/ViewModels/Popup/TfaViewModel.cs index 62511ae..6b440d7 100644 --- a/Nebula.Launcher/ViewModels/Popup/TfaViewModel.cs +++ b/Nebula.Launcher/ViewModels/Popup/TfaViewModel.cs @@ -1,4 +1,5 @@ using System; +using Nebula.Launcher.Services; using Nebula.Launcher.Views.Popup; using Nebula.Shared.Services; @@ -24,6 +25,6 @@ public partial class TfaViewModel : PopupViewModelBase } [GenerateProperty] public override PopupMessageService PopupMessageService { get; } - public override string Title => "2fa"; + public override string Title => LocalisationService.GetString("popup-twofa"); public override bool IsClosable => true; } \ No newline at end of file diff --git a/Nebula.Launcher/Views/Pages/AccountInfoView.axaml b/Nebula.Launcher/Views/Pages/AccountInfoView.axaml index acd70a0..89f1c03 100644 --- a/Nebula.Launcher/Views/Pages/AccountInfoView.axaml +++ b/Nebula.Launcher/Views/Pages/AccountInfoView.axaml @@ -5,6 +5,7 @@ x:Class="Nebula.Launcher.Views.Pages.AccountInfoView" x:DataType="pages:AccountInfoViewModel" xmlns="https://github.com/avaloniaui" + xmlns:customControls="clr-namespace:Nebula.Launcher.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages" @@ -28,7 +29,7 @@ - + - + @@ -108,27 +105,21 @@ Command="{Binding DoCurrentAuth}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"> - + - + - + - + - + @@ -161,7 +152,7 @@ Command="{Binding DoAuth}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"> - + @@ -169,7 +160,7 @@ Command="{Binding SaveProfileCommand}" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"> - + diff --git a/Nebula.Launcher/Views/Pages/ConfigurationView.axaml b/Nebula.Launcher/Views/Pages/ConfigurationView.axaml index fbd30b8..e651169 100644 --- a/Nebula.Launcher/Views/Pages/ConfigurationView.axaml +++ b/Nebula.Launcher/Views/Pages/ConfigurationView.axaml @@ -3,6 +3,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:pages="clr-namespace:Nebula.Launcher.ViewModels.Pages" + xmlns:customControls="clr-namespace:Nebula.Launcher.Controls" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" x:Class="Nebula.Launcher.Views.Pages.ConfigurationView" x:DataType="pages:ConfigurationViewModel"> @@ -29,7 +30,7 @@ Padding="5" Margin="5" Command="{Binding InvokeUpdateConfiguration}"> - Save + diff --git a/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml b/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml index 5b640e5..6f5de60 100644 --- a/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml +++ b/Nebula.Launcher/Views/Pages/ServerOverviewView.axaml @@ -51,8 +51,8 @@ VerticalAlignment="Bottom" IsVisible="{Binding IsFilterVisible}"> - - + + diff --git a/Nebula.Launcher/Views/Popup/AddFavoriteView.axaml b/Nebula.Launcher/Views/Popup/AddFavoriteView.axaml index 7075235..7c170d6 100644 --- a/Nebula.Launcher/Views/Popup/AddFavoriteView.axaml +++ b/Nebula.Launcher/Views/Popup/AddFavoriteView.axaml @@ -8,6 +8,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:popup="clr-namespace:Nebula.Launcher.ViewModels.Popup" + xmlns:customControls="clr-namespace:Nebula.Launcher.Controls" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> @@ -18,7 +19,7 @@ - + @@ -32,7 +33,7 @@