Skip to content

Commit aebce74

Browse files
fix(localization): add x:Uid to 9 hard-coded XAML strings across 5 pages
Add x:Uid attributes to controls that had user-facing text without localization support, and add matching resource keys to all 5 locale files (en-us, fr-fr, nl-nl, zh-cn, zh-tw). Fixed pages: - AgentEventsPage: LiveText indicator (invariant — Live is a universal broadcast/status term, added to InvariantOrDeferredResourceKeys) - SessionsPage: page subtitle, empty-state subtitle, Open chat button - SkillsPage: Enabled/Disabled expander headers (keys already existed) - VoiceSettingsPage: PiperPreviewLabel and PreviewVoiceLabel buttons - HubWindow: TitleStatusText (key already existed as HubWindow_Disconnected) Reduces candidate hard-coded XAML strings from 68 to 30. Remaining 30 warnings are all in CronPage.xaml (complex form) and SandboxPage.xaml (long prose description) — deferred as separate work. LocalizationValidationTests: all 10 pass. Co-authored-by: Copilot <[email protected]>
1 parent ef6ac8a commit aebce74

11 files changed

Lines changed: 102 additions & 10 deletions

File tree

‎src/OpenClaw.Tray.WinUI/Pages/AgentEventsPage.xaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
Background="#20FF4444">
2222
<StackPanel Orientation="Horizontal" Spacing="4">
2323
<Ellipse x:Name="LiveDot" Width="6" Height="6" Fill="#FFFF4444" VerticalAlignment="Center"/>
24-
<TextBlock x:Name="LiveText" Text="Live" FontSize="11" FontWeight="SemiBold"
24+
<TextBlock x:Uid="AgentEventsPage_LiveText" x:Name="LiveText" Text="Live" FontSize="11" FontWeight="SemiBold"
2525
Foreground="#FFFF4444" VerticalAlignment="Center"/>
2626
</StackPanel>
2727
</Border>

‎src/OpenClaw.Tray.WinUI/Pages/SessionsPage.xaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
Text="Sessions"
3232
Style="{StaticResource TitleTextBlockStyle}"
3333
Margin="0,0,0,2"/>
34-
<TextBlock Text="Conversations this gateway is currently handling, grouped by channel."
34+
<TextBlock x:Uid="SessionsPage_Subtitle" Text="Conversations this gateway is currently handling, grouped by channel."
3535
Style="{StaticResource CaptionTextBlockStyle}"
3636
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
3737
TextWrapping="Wrap" Margin="0,0,0,4"/>
@@ -100,7 +100,7 @@
100100
Text="No active sessions"
101101
Style="{StaticResource BodyStrongTextBlockStyle}"
102102
HorizontalAlignment="Center"/>
103-
<TextBlock Text="Sessions appear here when a channel is connected and traffic is flowing."
103+
<TextBlock x:Uid="SessionsPage_EmptySubtitle" Text="Sessions appear here when a channel is connected and traffic is flowing."
104104
Style="{StaticResource CaptionTextBlockStyle}"
105105
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
106106
TextWrapping="Wrap" TextAlignment="Center"
@@ -184,11 +184,11 @@
184184
<StackPanel Grid.Row="2" Grid.Column="1"
185185
Orientation="Horizontal" Spacing="4"
186186
VerticalAlignment="Center">
187-
<Button Tag="{Binding Key}"
187+
<Button x:Uid="SessionsPage_OpenChat"
188+
Tag="{Binding Key}"
188189
Click="OnOpenChat"
189190
Style="{StaticResource AccentButtonStyle}"
190191
Content="Open chat"
191-
ToolTipService.ToolTip="Open this session in Chat"
192192
AutomationProperties.Name="Open in chat"/>
193193
<Button Tag="{Binding Key}"
194194
IsEnabled="{Binding CanEdit}"

‎src/OpenClaw.Tray.WinUI/Pages/SkillsPage.xaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
HorizontalAlignment="Stretch"
2727
HorizontalContentAlignment="Stretch">
2828
<Expander.Header>
29-
<TextBlock x:Name="EnabledHeaderText" Text="Enabled"
29+
<TextBlock x:Uid="SkillsPage_Enabled" x:Name="EnabledHeaderText" Text="Enabled"
3030
Style="{StaticResource BodyStrongTextBlockStyle}"
3131
VerticalAlignment="Center"/>
3232
</Expander.Header>
@@ -39,7 +39,7 @@
3939
HorizontalContentAlignment="Stretch"
4040
Visibility="Collapsed">
4141
<Expander.Header>
42-
<TextBlock x:Name="DisabledHeaderText" Text="Disabled"
42+
<TextBlock x:Uid="SkillsPage_Disabled" x:Name="DisabledHeaderText" Text="Disabled"
4343
Style="{StaticResource BodyStrongTextBlockStyle}"
4444
VerticalAlignment="Center"/>
4545
</Expander.Header>

‎src/OpenClaw.Tray.WinUI/Pages/VoiceSettingsPage.xaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
Width="100" Visibility="Collapsed">
189189
<StackPanel Orientation="Horizontal" Spacing="6">
190190
<FontIcon x:Name="PiperPreviewIcon" Glyph="&#xE768;" FontSize="14"/>
191-
<TextBlock x:Name="PiperPreviewLabel" Text="Preview"/>
191+
<TextBlock x:Uid="VoiceSettingsPage_PiperPreviewLabel" x:Name="PiperPreviewLabel" Text="Preview"/>
192192
</StackPanel>
193193
</Button>
194194
</StackPanel>
@@ -211,7 +211,7 @@
211211
Width="140">
212212
<StackPanel Orientation="Horizontal" Spacing="6">
213213
<FontIcon x:Name="PreviewVoiceIcon" Glyph="&#xE768;" FontSize="14"/>
214-
<TextBlock x:Name="PreviewVoiceLabel" Text="Preview Voice"/>
214+
<TextBlock x:Uid="VoiceSettingsPage_PreviewVoiceLabel" x:Name="PreviewVoiceLabel" Text="Preview Voice"/>
215215
</StackPanel>
216216
</Button>
217217
</StackPanel>

‎src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4514,4 +4514,22 @@ On your gateway host (Mac/Linux), run:
45144514
</data>
45154515
<data name="HubWindow_Advanced.Content" xml:space="preserve">
45164516
<value>Advanced</value>
4517+
</data>
4518+
<data name="AgentEventsPage_LiveText.Text" xml:space="preserve">
4519+
<value>Live</value>
4520+
</data>
4521+
<data name="SessionsPage_Subtitle.Text" xml:space="preserve">
4522+
<value>Conversations this gateway is currently handling, grouped by channel.</value>
4523+
</data>
4524+
<data name="SessionsPage_EmptySubtitle.Text" xml:space="preserve">
4525+
<value>Sessions appear here when a channel is connected and traffic is flowing.</value>
4526+
</data>
4527+
<data name="SessionsPage_OpenChat.Content" xml:space="preserve">
4528+
<value>Open chat</value>
4529+
</data>
4530+
<data name="VoiceSettingsPage_PiperPreviewLabel.Text" xml:space="preserve">
4531+
<value>Preview</value>
4532+
</data>
4533+
<data name="VoiceSettingsPage_PreviewVoiceLabel.Text" xml:space="preserve">
4534+
<value>Preview Voice</value>
45174535
</data></root>

‎src/OpenClaw.Tray.WinUI/Strings/fr-fr/Resources.resw‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4466,4 +4466,22 @@ Sur votre hôte passerelle (Mac/Linux), exécutez :
44664466
</data>
44674467
<data name="HubWindow_Advanced.Content" xml:space="preserve">
44684468
<value>Avancé</value>
4469+
</data>
4470+
<data name="AgentEventsPage_LiveText.Text" xml:space="preserve">
4471+
<value>Live</value>
4472+
</data>
4473+
<data name="SessionsPage_Subtitle.Text" xml:space="preserve">
4474+
<value>Conversations actuellement gérées par cette passerelle, regroupées par canal.</value>
4475+
</data>
4476+
<data name="SessionsPage_EmptySubtitle.Text" xml:space="preserve">
4477+
<value>Les sessions s'affichent ici lorsqu'un canal est connecté et que le trafic circule.</value>
4478+
</data>
4479+
<data name="SessionsPage_OpenChat.Content" xml:space="preserve">
4480+
<value>Ouvrir le chat</value>
4481+
</data>
4482+
<data name="VoiceSettingsPage_PiperPreviewLabel.Text" xml:space="preserve">
4483+
<value>Aperçu</value>
4484+
</data>
4485+
<data name="VoiceSettingsPage_PreviewVoiceLabel.Text" xml:space="preserve">
4486+
<value>Aperçu de la voix</value>
44694487
</data></root>

‎src/OpenClaw.Tray.WinUI/Strings/nl-nl/Resources.resw‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4467,4 +4467,22 @@ Voer op uw gateway-host (Mac/Linux) uit:
44674467
</data>
44684468
<data name="HubWindow_Advanced.Content" xml:space="preserve">
44694469
<value>Geavanceerd</value>
4470+
</data>
4471+
<data name="AgentEventsPage_LiveText.Text" xml:space="preserve">
4472+
<value>Live</value>
4473+
</data>
4474+
<data name="SessionsPage_Subtitle.Text" xml:space="preserve">
4475+
<value>Gesprekken die deze gateway momenteel afhandelt, gegroepeerd per kanaal.</value>
4476+
</data>
4477+
<data name="SessionsPage_EmptySubtitle.Text" xml:space="preserve">
4478+
<value>Sessies verschijnen hier wanneer een kanaal is verbonden en er verkeer stroomt.</value>
4479+
</data>
4480+
<data name="SessionsPage_OpenChat.Content" xml:space="preserve">
4481+
<value>Chat openen</value>
4482+
</data>
4483+
<data name="VoiceSettingsPage_PiperPreviewLabel.Text" xml:space="preserve">
4484+
<value>Voorbeeld</value>
4485+
</data>
4486+
<data name="VoiceSettingsPage_PreviewVoiceLabel.Text" xml:space="preserve">
4487+
<value>Stem bekijken</value>
44704488
</data></root>

‎src/OpenClaw.Tray.WinUI/Strings/zh-cn/Resources.resw‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4466,5 +4466,22 @@
44664466
</data>
44674467
<data name="HubWindow_Advanced.Content" xml:space="preserve">
44684468
<value>高级</value>
4469+
</data> <data name="AgentEventsPage_LiveText.Text" xml:space="preserve">
4470+
<value>Live</value>
4471+
</data>
4472+
<data name="SessionsPage_Subtitle.Text" xml:space="preserve">
4473+
<value>此网关当前处理的对话,按频道分组。</value>
4474+
</data>
4475+
<data name="SessionsPage_EmptySubtitle.Text" xml:space="preserve">
4476+
<value>当频道连接且流量流动时,会话会出现在此处。</value>
4477+
</data>
4478+
<data name="SessionsPage_OpenChat.Content" xml:space="preserve">
4479+
<value>打开聊天</value>
4480+
</data>
4481+
<data name="VoiceSettingsPage_PiperPreviewLabel.Text" xml:space="preserve">
4482+
<value>预览</value>
4483+
</data>
4484+
<data name="VoiceSettingsPage_PreviewVoiceLabel.Text" xml:space="preserve">
4485+
<value>预览语音</value>
44694486
</data></root>
44704487

‎src/OpenClaw.Tray.WinUI/Strings/zh-tw/Resources.resw‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4466,5 +4466,22 @@
44664466
</data>
44674467
<data name="HubWindow_Advanced.Content" xml:space="preserve">
44684468
<value>進階</value>
4469+
</data> <data name="AgentEventsPage_LiveText.Text" xml:space="preserve">
4470+
<value>Live</value>
4471+
</data>
4472+
<data name="SessionsPage_Subtitle.Text" xml:space="preserve">
4473+
<value>此網關目前處理的對話,依頻道分組。</value>
4474+
</data>
4475+
<data name="SessionsPage_EmptySubtitle.Text" xml:space="preserve">
4476+
<value>當頻道連接且流量流通時,工作階段會顯示在此處。</value>
4477+
</data>
4478+
<data name="SessionsPage_OpenChat.Content" xml:space="preserve">
4479+
<value>開啟聊天</value>
4480+
</data>
4481+
<data name="VoiceSettingsPage_PiperPreviewLabel.Text" xml:space="preserve">
4482+
<value>預覽</value>
4483+
</data>
4484+
<data name="VoiceSettingsPage_PreviewVoiceLabel.Text" xml:space="preserve">
4485+
<value>預覽語音</value>
44694486
</data></root>
44704487

‎src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
Tapped="OnTitleBarStatusTapped">
7878
<StackPanel Orientation="Horizontal" Spacing="6">
7979
<Ellipse x:Name="TitleStatusDot" Width="8" Height="8" VerticalAlignment="Center" Fill="Gray"/>
80-
<TextBlock x:Name="TitleStatusText" Text="Disconnected"
80+
<TextBlock x:Uid="HubWindow_Disconnected" x:Name="TitleStatusText" Text="Disconnected"
8181
FontSize="11" VerticalAlignment="Center" MinWidth="80"
8282
Foreground="{ThemeResource TextFillColorSecondaryBrush}"/>
8383
</StackPanel>

0 commit comments

Comments
 (0)