Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/OpenClaw.Tray.WinUI/Controls/SchemaConfigEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media;
using OpenClawTray.Helpers;
using OpenClawTray.Services;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -413,7 +414,7 @@ private UIElement RenderArrayField(string path, string label, string? descriptio
Children =
{
new FontIcon { Glyph = "\uE710", FontSize = 12 },
new TextBlock { Text = "Add item" }
new TextBlock { Text = LocalizationHelper.GetString("SchemaConfigEditor_AddItem") }
}
},
Margin = new Thickness(0, 4, 0, 0)
Expand Down
4 changes: 2 additions & 2 deletions src/OpenClaw.Tray.WinUI/Pages/AgentEventsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
Background="#20FF4444">
<StackPanel Orientation="Horizontal" Spacing="4">
<Ellipse x:Name="LiveDot" Width="6" Height="6" Fill="#FFFF4444" VerticalAlignment="Center"/>
<TextBlock x:Name="LiveText" Text="Live" FontSize="11" FontWeight="SemiBold"
<TextBlock x:Uid="AgentEventsPage_LiveText" x:Name="LiveText" Text="Live" FontSize="11" FontWeight="SemiBold"
Foreground="#FFFF4444" VerticalAlignment="Center"/>
</StackPanel>
</Border>
Expand Down Expand Up @@ -52,7 +52,7 @@
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon Glyph="{x:Bind helpers:FluentIconCatalog.Clear, Mode=OneTime}"
FontSize="14" IsTextScaleFactorEnabled="False"/>
<TextBlock Text="Clear"/>
<TextBlock x:Uid="AgentEventsPage_ClearButton" Text="Clear"/>
</StackPanel>
</Button>
</Grid>
Expand Down
5 changes: 3 additions & 2 deletions src/OpenClaw.Tray.WinUI/Pages/AgentEventsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using OpenClaw.Shared;
using OpenClawTray.Helpers;
using OpenClawTray.Services;
using OpenClawTray.Windows;

Expand Down Expand Up @@ -44,7 +45,7 @@ public void PopulateAgentFilter(HubWindow hub)
{
AgentFilterCombo.SelectionChanged -= OnAgentFilterComboChanged;
AgentFilterCombo.Items.Clear();
AgentFilterCombo.Items.Add(new ComboBoxItem { Content = "All Agents", Tag = "" });
AgentFilterCombo.Items.Add(new ComboBoxItem { Content = LocalizationHelper.GetString("AgentEventsPage_AllAgents"), Tag = "" });
foreach (var id in hub.GetAgentIds())
AgentFilterCombo.Items.Add(new ComboBoxItem { Content = id, Tag = id });
AgentFilterCombo.SelectedIndex = 0;
Expand Down Expand Up @@ -178,7 +179,7 @@ private void ApplyFilter()
EventsList.Visibility = list.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
EmptyState.Visibility = list.Count > 0 ? Visibility.Collapsed : Visibility.Visible;
CountText.Text = $"({_allEvents.Count})";
StatusText.Text = $"{list.Count} of {_allEvents.Count} events";
StatusText.Text = string.Format(LocalizationHelper.GetString("AgentEventsPage_EventsStatus"), list.Count, _allEvents.Count);
}

private void OnClear(object sender, RoutedEventArgs e)
Expand Down
196 changes: 96 additions & 100 deletions src/OpenClaw.Tray.WinUI/Pages/ChannelsPage.xaml.cs

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions src/OpenClaw.Tray.WinUI/Pages/ChatPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private void ShowMissingChatCredentialError()
WebView.Visibility = Visibility.Collapsed;
PlaceholderPanel.Visibility = Visibility.Collapsed;
ErrorPanel.Visibility = Visibility.Visible;
ErrorText.Text = "Open Connection settings to finish pairing with a gateway.";
ErrorText.Text = LocalizationHelper.GetString("ChatPage_OpenConnectionSettings");
}

private void StopWebViewNavigation()
Expand Down Expand Up @@ -380,15 +380,15 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
{
PlaceholderPanel.Visibility = Visibility.Collapsed;
ErrorPanel.Visibility = Visibility.Visible;
ErrorText.Text = "Open Connection settings to finish pairing with a gateway.";
ErrorText.Text = LocalizationHelper.GetString("ChatPage_OpenConnectionSettings");
return;
}

if (credential.IsBootstrapToken)
{
PlaceholderPanel.Visibility = Visibility.Collapsed;
ErrorPanel.Visibility = Visibility.Visible;
ErrorText.Text = "Gateway pairing is not complete. Open Connection settings to finish pairing.";
ErrorText.Text = LocalizationHelper.GetString("ChatPage_GatewayPairingIncomplete");
return;
}

Expand All @@ -406,7 +406,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
ErrorPanel.Visibility = Visibility.Collapsed;
WebView.Visibility = Visibility.Collapsed;
WaitingPanel.Visibility = Visibility.Visible;
WaitingStatusText.Text = "The gateway is connected; the chat surface is still coming online.";
WaitingStatusText.Text = LocalizationHelper.GetString("ChatPage_ChatSurfaceComingOnline");
RetryChatButton.Visibility = Visibility.Collapsed;
LoadingRing.IsActive = true;
LoadingRing.Visibility = Visibility.Visible;
Expand Down Expand Up @@ -440,7 +440,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
{
WebView.Visibility = Visibility.Collapsed;
ErrorPanel.Visibility = Visibility.Visible;
ErrorText.Text = $"Cannot connect to gateway at {credential.GatewayUrl}\n\nMake sure the gateway is running.";
ErrorText.Text = string.Format(LocalizationHelper.GetString("ChatPage_CannotConnectToGateway"), credential.GatewayUrl);
}
};
WebView.CoreWebView2.NavigationCompleted += _navCompletedHandler;
Expand All @@ -464,7 +464,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
PlaceholderPanel.Visibility = Visibility.Collapsed;
WebView.Visibility = Visibility.Collapsed;
ErrorPanel.Visibility = Visibility.Visible;
ErrorText.Text = $"WebView2 failed to initialize:\n{ex.Message}";
ErrorText.Text = string.Format(LocalizationHelper.GetString("ChatPage_WebView2InitFailed"), ex.Message);
}
}

Expand All @@ -481,7 +481,7 @@ private async Task NavigateWhenChatReadyAsync(
var ready = await ChatNavigationReadiness.WaitForOperatorHandshakeAsync(connectionManager, TimeSpan.FromSeconds(30), cancellationToken);
if (!ready)
{
ShowChatReadinessFailure("Timed out waiting for the gateway operator handshake. Retry once the gateway is ready.");
ShowChatReadinessFailure(LocalizationHelper.GetString("ChatPage_TimedOutHandshake"));
Logger.Warn("[ChatPage] Timed out waiting for operator handshake before chat navigation");
return;
}
Expand All @@ -490,12 +490,12 @@ private async Task NavigateWhenChatReadyAsync(
ready = await ProbeChatSurfaceAsync(_chatUrl!, TimeSpan.FromSeconds(30), cancellationToken);
if (!ready)
{
ShowChatReadinessFailure($"Timed out waiting for chat at {gatewayUrl}. Retry once the gateway is ready.");
ShowChatReadinessFailure(string.Format(LocalizationHelper.GetString("ChatPage_TimedOutChat"), gatewayUrl));
Logger.Warn("[ChatPage] Timed out waiting for chat HTTP surface before navigation");
return;
}

WaitingStatusText.Text = "Chat is ready; starting your first hatching conversation…";
WaitingStatusText.Text = LocalizationHelper.GetString("ChatPage_ChatReady");
var bootstrapped = await OnboardingChatBootstrapper.BootstrapAsync(
connectionManager?.OperatorClient,
((App)Application.Current).Settings,
Expand All @@ -520,7 +520,7 @@ private async Task NavigateWhenChatReadyAsync(
}
catch (Exception ex)
{
ShowChatReadinessFailure($"Chat failed to start:\n{ex.Message}");
ShowChatReadinessFailure(string.Format(LocalizationHelper.GetString("ChatPage_ChatFailedToStart"), ex.Message));
Logger.Warn($"[ChatPage] Chat readiness wait failed: {ex.Message}");
}
}
Expand Down Expand Up @@ -608,7 +608,7 @@ private static bool TryBuildChatUrl(string gatewayUrl, string token, out string
if (!GatewayUrlHelper.TryNormalizeWebSocketUrl(gatewayUrl, out var normalizedUrl) ||
!Uri.TryCreate(normalizedUrl, UriKind.Absolute, out var gatewayUri))
{
errorMessage = $"Invalid gateway URL: {gatewayUrl}";
errorMessage = string.Format(LocalizationHelper.GetString("ChatPage_InvalidGatewayUrl"), gatewayUrl);
return false;
}

Expand Down Expand Up @@ -793,7 +793,7 @@ private async Task PickAndAttachFileAsync()
}

var hwnd = WinRT.Interop.WindowNative.GetWindowHandle((Window)_hub!);
var path = await Win32FilePickerHelper.PickSingleFileAsync(hwnd, "Attach file");
var path = await Win32FilePickerHelper.PickSingleFileAsync(hwnd, LocalizationHelper.GetString("ChatPage_AttachFile"));

if (path is null)
{
Expand Down Expand Up @@ -822,9 +822,9 @@ private async Task ShowAttachmentErrorAsync(string message)
{
var dialog = new ContentDialog
{
Title = "Cannot attach file",
Title = LocalizationHelper.GetString("ChatPage_CannotAttachFile"),
Content = message,
CloseButtonText = "OK",
CloseButtonText = LocalizationHelper.GetString("ChatPage_OK"),
DefaultButton = ContentDialogButton.Close,
XamlRoot = this.XamlRoot
};
Expand Down
30 changes: 20 additions & 10 deletions src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@
Visibility="Collapsed"
Click="OnStripPrimaryClicked"
AutomationProperties.AutomationId="StripPrimaryAction"/>
<Button x:Name="StripTerminalButton"
<Button x:Uid="ConnectionPage_StripTerminalButton"
x:Name="StripTerminalButton"
Width="32" Height="32" Padding="0"
Background="Transparent" BorderThickness="0"
Visibility="Collapsed"
Expand All @@ -178,7 +179,8 @@
</Button>
<!-- Disconnect/connect toggle. ON = connection is live (or attempting).
Tap OFF → disconnect; tap ON (from off) → reconnect. -->
<Button x:Name="StripDashboardButton"
<Button x:Uid="ConnectionPage_StripDashboardButton"
x:Name="StripDashboardButton"
Width="32" Height="32" Padding="0"
Background="Transparent" BorderThickness="0"
Visibility="Collapsed"
Expand All @@ -189,7 +191,8 @@
<FontIcon Glyph="{x:Bind helpers:FluentIconCatalog.OpenInBrowser, Mode=OneTime}" FontSize="14"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"/>
</Button>
<ToggleSwitch x:Name="ConnectionToggle"
<ToggleSwitch x:Uid="ConnectionPage_ConnectionToggle"
x:Name="ConnectionToggle"
MinWidth="0" MinHeight="0"
OnContent="" OffContent=""
Visibility="Collapsed"
Expand Down Expand Up @@ -217,11 +220,13 @@
VerticalAlignment="Center" HorizontalAlignment="Center"
AutomationProperties.AccessibilityView="Raw"/>
<StackPanel Grid.Column="1" VerticalAlignment="Center" Spacing="2">
<TextBlock x:Name="GatewayHostControlsTitleText"
<TextBlock x:Uid="ConnectionPage_GatewayHostControlsTitle"
x:Name="GatewayHostControlsTitleText"
Text="WSL gateway"
Style="{StaticResource BodyStrongTextBlockStyle}"
AutomationProperties.HeadingLevel="Level2"/>
<TextBlock x:Name="GatewayHostControlsDescriptionText"
<TextBlock x:Uid="ConnectionPage_GatewayHostControlsDescription"
x:Name="GatewayHostControlsDescriptionText"
Text="Open a shell or manage the local gateway service in WSL."
Style="{StaticResource CaptionTextBlockStyle}"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Expand Down Expand Up @@ -249,30 +254,35 @@
Spacing="8"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<Button x:Name="GatewayHostOpenTerminalButton"
<Button x:Uid="ConnectionPage_GatewayHostOpenTerminalButton"
x:Name="GatewayHostOpenTerminalButton"
Click="OnOpenGatewayTerminal"
ToolTipService.ToolTip="Open terminal"
AutomationProperties.Name="Open terminal"
AutomationProperties.AutomationId="GatewayHostOpenTerminalAction">
<StackPanel Orientation="Horizontal" Spacing="6">
<FontIcon Glyph="{x:Bind helpers:FluentIconCatalog.Terminal, Mode=OneTime}" FontSize="12"
AutomationProperties.AccessibilityView="Raw"/>
<TextBlock Text="Terminal" FontSize="13"/>
<TextBlock x:Uid="ConnectionPage_GatewayHostTerminalLabel"
Text="Terminal" FontSize="13"/>
</StackPanel>
</Button>
<Button x:Name="GatewayHostStartButton"
<Button x:Uid="ConnectionPage_GatewayHostStartButton"
x:Name="GatewayHostStartButton"
Content="Start"
Click="OnStartGatewayClicked"
ToolTipService.ToolTip="Run openclaw gateway start in WSL"
AutomationProperties.Name="Start WSL gateway"
AutomationProperties.AutomationId="GatewayHostStartAction"/>
<Button x:Name="GatewayHostStopButton"
<Button x:Uid="ConnectionPage_GatewayHostStopButton"
x:Name="GatewayHostStopButton"
Content="Stop"
Click="OnStopGatewayClicked"
ToolTipService.ToolTip="Run openclaw gateway stop in WSL"
AutomationProperties.Name="Stop WSL gateway"
AutomationProperties.AutomationId="GatewayHostStopAction"/>
<Button x:Name="GatewayHostRestartButton"
<Button x:Uid="ConnectionPage_GatewayHostRestartButton"
x:Name="GatewayHostRestartButton"
Content="Restart"
Click="OnRestartGatewayClicked"
ToolTipService.ToolTip="Run openclaw gateway restart in WSL"
Expand Down
Loading
Loading