Add some forgotten translation hooks
[xboard.git] / winboard / winboard.c
index 243ff29..6fc482e 100644 (file)
@@ -277,7 +277,8 @@ int dialogItems[][40] = {
 { DLG_Sound, IDC_Event, OPT_NoSound, OPT_DefaultBeep, OPT_BuiltInSound,\r
   OPT_WavFile, OPT_BrowseSound, OPT_DefaultSounds, IDOK, IDCANCEL, OPT_PlaySound }, \r
 { DLG_GeneralOptions, IDOK, IDCANCEL, OPT_AlwaysOnTop, OPT_HighlightLastMove,\r
-  OPT_AlwaysQueen, OPT_PeriodicUpdates, OPT_AnimateDragging, OPT_PonderNextMove,  OPT_AnimateMoving, OPT_PopupExitMessage, OPT_AutoFlag,  OPT_PopupMoveErrors,\r
+  OPT_AlwaysQueen, OPT_PeriodicUpdates, OPT_AnimateDragging, OPT_PonderNextMove,\r
+  OPT_AnimateMoving, OPT_PopupExitMessage, OPT_AutoFlag, OPT_PopupMoveErrors,\r
   OPT_AutoFlipView, OPT_ShowButtonBar, OPT_AutoRaiseBoard, OPT_ShowCoordinates,\r
   OPT_Blindfold, OPT_ShowThinking, OPT_HighlightDragging, OPT_TestLegality,\r
   OPT_SaveExtPGN, OPT_HideThinkFromHuman, OPT_ExtraInfoInMoveHistory,\r
@@ -351,7 +352,7 @@ LoadLanguageFile(char *name)
                         if(j >= sizeof(english)) { DisplayError("Too many translated strings", 0); return; }\r
                         english[j] = languageBuf + n + 1; *p = 0;\r
                         foreign[j++] = p + 7; languageBuf[i-1] = 0;\r
-if(appData.debugMode) fprintf(debugFP, "translation: replace '%s' by '%s'\n", english[j-1], foreign[j-1]);\r
+//if(appData.debugMode) fprintf(debugFP, "translation: replace '%s' by '%s'\n", english[j-1], foreign[j-1]);\r
                     }\r
                 }\r
             }\r
@@ -368,7 +369,7 @@ if(appData.debugMode) fprintf(debugFP, "translation: replace '%s' by '%s'\n", en
     }\r
     fclose(f);\r
     barbaric = (j != 0);\r
-    if(barbaric) strcpy(oldLanguage, name); else oldLanguage[0] = NULLCHAR;\r
+    strcpy(oldLanguage, buf);\r
 }\r
 \r
 char *\r
@@ -387,7 +388,7 @@ if(appData.debugMode) fprintf(debugFP, "T_(%s)\n", s);
 }\r
 \r
 void\r
-Translate(HANDLE hDlg, int dialogID)\r
+Translate(HWND hDlg, int dialogID)\r
 {   // translate all text items in the given dialog\r
     int i=0, j, k;\r
     char buf[MSG_SIZ], *s;\r
@@ -5603,6 +5604,7 @@ OldOpenFileHook(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       number = NULL;\r
     }\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, 1536);\r
     return FALSE;  /* Allow for further processing */\r
 \r
   case WM_COMMAND:\r
@@ -5622,6 +5624,7 @@ OpenFileHook(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
   OFNOTIFY *ofnot;\r
   switch (uiMsg) {\r
   case WM_INITDIALOG:\r
+    Translate(hdlg, DLG_IndexNumber);\r
     ofname = (OPENFILENAME *)lParam;\r
     number = (UINT *)(ofname->lCustData);\r
     break;\r
@@ -5851,7 +5854,7 @@ InitComboStrings(HANDLE hwndCombo, char **cd)
   SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0);\r
 \r
   while (*cd != NULL) {\r
-    SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) *cd);\r
+    SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) T_(*cd));\r
     cd++;\r
   }\r
 }\r
@@ -6067,6 +6070,7 @@ About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
     SetDlgItemText(hDlg, ABOUTBOX_Version, programVersion);\r
+    Translate(hDlg, ABOUTBOX);\r
     JAWS_COPYRIGHT\r
     return (TRUE);\r
 \r