@@ -50,10 +50,10 @@ private void InitializeCombobox(int? defaultQuadrantIndex)
5050 {
5151 // Populate ComboBox
5252 ListSelectorComboBox . ItemsSource = new List < string > {
53- "重要且紧急" , // Important & Urgent
54- "重要不紧急" , // Important & Not Urgent
55- "不重要但紧急" , // Not Important & Urgent
56- "不重要不紧急" // Not Important & Not Urgent
53+ I18n . T ( "Quadrant_ImportantUrgent" ) ,
54+ I18n . T ( "Quadrant_ImportantNotUrgent" ) ,
55+ I18n . T ( "Quadrant_NotImportantUrgent" ) ,
56+ I18n . T ( "Quadrant_NotImportantNotUrgent" )
5757 } ;
5858 ListSelectorComboBox . SelectedIndex = 0 ; // Default to "重要且紧急"
5959
@@ -98,7 +98,16 @@ public void SetPreFilledTask(string description, string quadrant)
9898 { "重要不紧急" , 1 } ,
9999 { "不重要但紧急" , 2 } ,
100100 { "不重要紧急" , 2 } , // 兼容不同表述
101- { "不重要不紧急" , 3 }
101+ { "不重要不紧急" , 3 } ,
102+ { "Important & Urgent" , 0 } ,
103+ { "Important & Not Urgent" , 1 } ,
104+ { "Not Important but Urgent" , 2 } ,
105+ { "Not Important & Urgent" , 2 } ,
106+ { "Not Important & Not Urgent" , 3 } ,
107+ { I18n . T ( "Quadrant_ImportantUrgent" ) , 0 } ,
108+ { I18n . T ( "Quadrant_ImportantNotUrgent" ) , 1 } ,
109+ { I18n . T ( "Quadrant_NotImportantUrgent" ) , 2 } ,
110+ { I18n . T ( "Quadrant_NotImportantNotUrgent" ) , 3 }
102111 } ;
103112
104113 if ( quadrantMap . TryGetValue ( quadrant , out int index ) )
@@ -122,7 +131,7 @@ private void ResetClarificationButton_Click(object sender, RoutedEventArgs e)
122131 ClarificationBorder . Visibility = Visibility . Collapsed ; // Changed
123132 // ClarificationPromptText.Visibility = Visibility.Collapsed; // Old
124133 // ResetClarificationButton.Visibility = Visibility.Collapsed; // Old
125- AddTaskButton . Content = "Add Task" ;
134+ AddTaskButton . Content = I18n . T ( "AddTask_ButtonAdd" ) ;
126135 _isClarificationRound = false ;
127136 TaskDescriptionTextBox . Focus ( ) ; // Set focus back to the textbox
128137 }
@@ -135,13 +144,13 @@ private async void AddTaskButton_Click(object sender, RoutedEventArgs e)
135144
136145 if ( string . IsNullOrWhiteSpace ( currentTaskDescription ) )
137146 {
138- MessageBox . Show ( "Task description cannot be empty." , "Validation Error" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
147+ MessageBox . Show ( I18n . T ( "AddTask_ErrorEmptyDescription" ) , I18n . T ( "AddTask_TitleValidationError" ) , MessageBoxButton . OK , MessageBoxImage . Error ) ;
139148 return ;
140149 }
141150
142151 if ( SelectedListIndex < 0 )
143152 {
144- MessageBox . Show ( "Please select a list." , "Validation Error" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
153+ MessageBox . Show ( I18n . T ( "AddTask_ErrorSelectList" ) , I18n . T ( "AddTask_TitleValidationError" ) , MessageBoxButton . OK , MessageBoxImage . Error ) ;
145154 return ;
146155 }
147156
@@ -161,8 +170,8 @@ private async void AddTaskButton_Click(object sender, RoutedEventArgs e)
161170 // string configErrorSubstring is now defined at the beginning of the method
162171 if ( ! _isLlmConfigErrorNotified && question != null && question . Contains ( configErrorSubstring ) )
163172 {
164- MessageBox . Show ( "The AI assistant features may be limited due to a configuration issue (e.g., missing or placeholder API key). Please check the application's setup if you expect full AI functionality." ,
165- "LLM Configuration Issue" , MessageBoxButton . OK , MessageBoxImage . Warning ) ;
173+ MessageBox . Show ( I18n . T ( "AddTask_LlmConfigIssueText" ) ,
174+ I18n . T ( "AddTask_LlmConfigIssueTitle" ) , MessageBoxButton . OK , MessageBoxImage . Warning ) ;
166175 _isLlmConfigErrorNotified = true ;
167176 }
168177
@@ -172,7 +181,7 @@ private async void AddTaskButton_Click(object sender, RoutedEventArgs e)
172181 ClarificationBorder . Visibility = Visibility . Visible ; // Changed
173182 // ClarificationPromptText.Visibility = Visibility.Visible; // Old
174183 // ResetClarificationButton.Visibility = Visibility.Visible; // Old
175- AddTaskButton . Content = "Submit Clarified Task" ;
184+ AddTaskButton . Content = I18n . T ( "AddTask_ButtonSubmitClarified" ) ;
176185 _isClarificationRound = true ;
177186 TaskDescriptionTextBox . Focus ( ) ; // Focus on textbox for user to edit
178187 return ; // Wait for user to clarify
@@ -191,8 +200,8 @@ private async void AddTaskButton_Click(object sender, RoutedEventArgs e)
191200 ( ( llmImportance != null && llmImportance . Contains ( configErrorSubstring ) ) ||
192201 ( llmUrgency != null && llmUrgency . Contains ( configErrorSubstring ) ) ) )
193202 {
194- MessageBox . Show ( "The AI assistant features may be limited due to a configuration issue (e.g., missing or placeholder API key). Please check the application's setup if you expect full AI functionality." ,
195- "LLM Configuration Issue" , MessageBoxButton . OK , MessageBoxImage . Warning ) ;
203+ MessageBox . Show ( I18n . T ( "AddTask_LlmConfigIssueText" ) ,
204+ I18n . T ( "AddTask_LlmConfigIssueTitle" ) , MessageBoxButton . OK , MessageBoxImage . Warning ) ;
196205 _isLlmConfigErrorNotified = true ;
197206 }
198207
@@ -204,13 +213,13 @@ private async void AddTaskButton_Click(object sender, RoutedEventArgs e)
204213 if ( suggestedIndex != - 1 && ListSelectorComboBox . SelectedItem != null )
205214 {
206215 string label = ListSelectorComboBox . SelectedItem as string ;
207- LlmSuggestionText . Text = $ "AI建议象限( { sourceTag } ): { label } " ;
216+ LlmSuggestionText . Text = I18n . Tf ( "AddTask_SuggestionFormat" , sourceTag , label ) ;
208217 LlmSuggestionText . Visibility = Visibility . Visible ;
209218 }
210219 else
211220 {
212221 // Handle cases where suggestion is ambiguous or mapping fails
213- LlmSuggestionText . Text = "AI建议暂不可用,请手动选择象限。" ;
222+ LlmSuggestionText . Text = I18n . T ( "AddTask_SuggestionUnavailable" ) ;
214223 LlmSuggestionText . Visibility = Visibility . Collapsed ; // Or Visible with a different message
215224 }
216225 // --- End LLM Suggestion Logic ---
@@ -262,7 +271,7 @@ private async void AddTaskButton_Click(object sender, RoutedEventArgs e)
262271 }
263272 catch ( Exception ex )
264273 {
265- MessageBox . Show ( $ "An error occurred: { ex . Message } " , "Error" , MessageBoxButton . OK , MessageBoxImage . Error ) ;
274+ MessageBox . Show ( I18n . Tf ( "AddTask_ErrorOccurredFormat" , ex . Message ) , I18n . T ( "Title_Error" ) , MessageBoxButton . OK , MessageBoxImage . Error ) ;
266275 // Consider how to handle state if error occurs mid-process
267276 // For now, re-enable buttons and let user retry or cancel
268277 }
@@ -338,16 +347,16 @@ private static bool IsKnownPriority(string value)
338347
339348 if ( llmValid )
340349 {
341- return ( llmImportance , llmUrgency , "LLM" ) ;
350+ return ( llmImportance , llmUrgency , I18n . T ( "AddTask_SourceLlm" ) ) ;
342351 }
343352
344353 bool ruleValid = IsKnownPriority ( ruleImportance ) && IsKnownPriority ( ruleUrgency ) ;
345354 if ( ruleValid )
346355 {
347- return ( ruleImportance , ruleUrgency , "规则" ) ;
356+ return ( ruleImportance , ruleUrgency , I18n . T ( "AddTask_SourceRule" ) ) ;
348357 }
349358
350- return ( "Medium" , "Low" , "默认" ) ;
359+ return ( "Medium" , "Low" , I18n . T ( "AddTask_SourceDefault" ) ) ;
351360 }
352361
353362 private static bool ContainsDummy ( string value )
0 commit comments