@@ -339,7 +339,7 @@ private void ShowMissingChatCredentialError()
339339 WebView . Visibility = Visibility . Collapsed ;
340340 PlaceholderPanel . Visibility = Visibility . Collapsed ;
341341 ErrorPanel . Visibility = Visibility . Visible ;
342- ErrorText . Text = "Open Connection settings to finish pairing with a gateway." ;
342+ ErrorText . Text = LocalizationHelper . GetString ( "ChatPage_OpenConnectionSettings" ) ;
343343 }
344344
345345 private void StopWebViewNavigation ( )
@@ -380,15 +380,15 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
380380 {
381381 PlaceholderPanel . Visibility = Visibility . Collapsed ;
382382 ErrorPanel . Visibility = Visibility . Visible ;
383- ErrorText . Text = "Open Connection settings to finish pairing with a gateway." ;
383+ ErrorText . Text = LocalizationHelper . GetString ( "ChatPage_OpenConnectionSettings" ) ;
384384 return ;
385385 }
386386
387387 if ( credential . IsBootstrapToken )
388388 {
389389 PlaceholderPanel . Visibility = Visibility . Collapsed ;
390390 ErrorPanel . Visibility = Visibility . Visible ;
391- ErrorText . Text = "Gateway pairing is not complete. Open Connection settings to finish pairing." ;
391+ ErrorText . Text = LocalizationHelper . GetString ( "ChatPage_GatewayPairingIncomplete" ) ;
392392 return ;
393393 }
394394
@@ -406,7 +406,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
406406 ErrorPanel . Visibility = Visibility . Collapsed ;
407407 WebView . Visibility = Visibility . Collapsed ;
408408 WaitingPanel . Visibility = Visibility . Visible ;
409- WaitingStatusText . Text = "The gateway is connected; the chat surface is still coming online." ;
409+ WaitingStatusText . Text = LocalizationHelper . GetString ( "ChatPage_ChatSurfaceComingOnline" ) ;
410410 RetryChatButton . Visibility = Visibility . Collapsed ;
411411 LoadingRing . IsActive = true ;
412412 LoadingRing . Visibility = Visibility . Visible ;
@@ -440,7 +440,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
440440 {
441441 WebView . Visibility = Visibility . Collapsed ;
442442 ErrorPanel . Visibility = Visibility . Visible ;
443- ErrorText . Text = $ "Cannot connect to gateway at { credential . GatewayUrl } \n \n Make sure the gateway is running." ;
443+ ErrorText . Text = string . Format ( LocalizationHelper . GetString ( "ChatPage_CannotConnectToGateway" ) , credential . GatewayUrl ) ;
444444 }
445445 } ;
446446 WebView . CoreWebView2 . NavigationCompleted += _navCompletedHandler ;
@@ -464,7 +464,7 @@ private async Task InitializeWebViewAsync(SettingsManager settings)
464464 PlaceholderPanel . Visibility = Visibility . Collapsed ;
465465 WebView . Visibility = Visibility . Collapsed ;
466466 ErrorPanel . Visibility = Visibility . Visible ;
467- ErrorText . Text = $ "WebView2 failed to initialize: \n { ex . Message } " ;
467+ ErrorText . Text = string . Format ( LocalizationHelper . GetString ( "ChatPage_WebView2InitFailed" ) , ex . Message ) ;
468468 }
469469 }
470470
@@ -481,7 +481,7 @@ private async Task NavigateWhenChatReadyAsync(
481481 var ready = await ChatNavigationReadiness . WaitForOperatorHandshakeAsync ( connectionManager , TimeSpan . FromSeconds ( 30 ) , cancellationToken ) ;
482482 if ( ! ready )
483483 {
484- ShowChatReadinessFailure ( "Timed out waiting for the gateway operator handshake. Retry once the gateway is ready." ) ;
484+ ShowChatReadinessFailure ( LocalizationHelper . GetString ( "ChatPage_TimedOutHandshake" ) ) ;
485485 Logger . Warn ( "[ChatPage] Timed out waiting for operator handshake before chat navigation" ) ;
486486 return ;
487487 }
@@ -490,12 +490,12 @@ private async Task NavigateWhenChatReadyAsync(
490490 ready = await ProbeChatSurfaceAsync ( _chatUrl ! , TimeSpan . FromSeconds ( 30 ) , cancellationToken ) ;
491491 if ( ! ready )
492492 {
493- ShowChatReadinessFailure ( $ "Timed out waiting for chat at { gatewayUrl } . Retry once the gateway is ready." ) ;
493+ ShowChatReadinessFailure ( string . Format ( LocalizationHelper . GetString ( "ChatPage_TimedOutChat" ) , gatewayUrl ) ) ;
494494 Logger . Warn ( "[ChatPage] Timed out waiting for chat HTTP surface before navigation" ) ;
495495 return ;
496496 }
497497
498- WaitingStatusText . Text = "Chat is ready; starting your first hatching conversation…" ;
498+ WaitingStatusText . Text = LocalizationHelper . GetString ( "ChatPage_ChatReady" ) ;
499499 var bootstrapped = await OnboardingChatBootstrapper . BootstrapAsync (
500500 connectionManager ? . OperatorClient ,
501501 ( ( App ) Application . Current ) . Settings ,
@@ -520,7 +520,7 @@ private async Task NavigateWhenChatReadyAsync(
520520 }
521521 catch ( Exception ex )
522522 {
523- ShowChatReadinessFailure ( $ "Chat failed to start: \n { ex . Message } " ) ;
523+ ShowChatReadinessFailure ( string . Format ( LocalizationHelper . GetString ( "ChatPage_ChatFailedToStart" ) , ex . Message ) ) ;
524524 Logger . Warn ( $ "[ChatPage] Chat readiness wait failed: { ex . Message } ") ;
525525 }
526526 }
@@ -608,7 +608,7 @@ private static bool TryBuildChatUrl(string gatewayUrl, string token, out string
608608 if ( ! GatewayUrlHelper . TryNormalizeWebSocketUrl ( gatewayUrl , out var normalizedUrl ) ||
609609 ! Uri . TryCreate ( normalizedUrl , UriKind . Absolute , out var gatewayUri ) )
610610 {
611- errorMessage = $ "Invalid gateway URL: { gatewayUrl } " ;
611+ errorMessage = string . Format ( LocalizationHelper . GetString ( "ChatPage_InvalidGatewayUrl" ) , gatewayUrl ) ;
612612 return false ;
613613 }
614614
@@ -793,7 +793,7 @@ private async Task PickAndAttachFileAsync()
793793 }
794794
795795 var hwnd = WinRT . Interop . WindowNative . GetWindowHandle ( ( Window ) _hub ! ) ;
796- var path = await Win32FilePickerHelper . PickSingleFileAsync ( hwnd , "Attach file" ) ;
796+ var path = await Win32FilePickerHelper . PickSingleFileAsync ( hwnd , LocalizationHelper . GetString ( "ChatPage_AttachFile" ) ) ;
797797
798798 if ( path is null )
799799 {
@@ -822,9 +822,9 @@ private async Task ShowAttachmentErrorAsync(string message)
822822 {
823823 var dialog = new ContentDialog
824824 {
825- Title = "Cannot attach file" ,
825+ Title = LocalizationHelper . GetString ( "ChatPage_CannotAttachFile" ) ,
826826 Content = message ,
827- CloseButtonText = "OK" ,
827+ CloseButtonText = LocalizationHelper . GetString ( "ChatPage_OK" ) ,
828828 DefaultButton = ContentDialogButton . Close ,
829829 XamlRoot = this . XamlRoot
830830 } ;
0 commit comments