Try to not confuse ICS rating adustments as shouts
[xboard.git] / winboard / winboard.c
index febef6b..61cda89 100644 (file)
@@ -334,7 +334,7 @@ int dialogItems[][41        ] = {
 { 0 }\r
 };\r
 \r
-static char languageBuf[50000], *foreign[1000], *english[1000], *languageFile[MSG_SIZ];\r
+static char languageBuf[70000], *foreign[1000], *english[1000], *languageFile[MSG_SIZ];\r
 static int lastChecked;\r
 static char oldLanguage[MSG_SIZ], *menuText[10][30];\r
 extern int tinyLayout;\r
@@ -388,11 +388,16 @@ T_(char *s)
 {   // return the translation of the given string\r
     // efficiency can be improved a lot...\r
     int i=0;\r
+    static char buf[MSG_SIZ];\r
 //if(appData.debugMode) fprintf(debugFP, "T_(%s)\n", s);\r
     if(!barbaric) return s;\r
     if(!s) return ""; // sanity\r
     while(english[i]) {\r
         if(!strcmp(s, english[i])) return foreign[i];\r
+       if(english[i][0] == '%' && strstr(s, english[i]+1) == s) { // allow translation of strings with variable ending\r
+           snprintf(buf, MSG_SIZ, "%s%s", foreign[i], s + strlen(english[i]+1)); // keep unmatched portion\r
+           return buf;\r
+       }\r
         i++;\r
     }\r
     return s;\r
@@ -4140,9 +4145,9 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
   switch (message) {\r
   case WM_LBUTTONDOWN:\r
       if (PtInRect((LPRECT) &whiteRect, pt)) {\r
-        ClockClick(flipClock);\r
+        ClockClick(flipClock); break;\r
       } else if (PtInRect((LPRECT) &blackRect, pt)) {\r
-       ClockClick(!flipClock);\r
+       ClockClick(!flipClock); break;\r
       }\r
       dragInfo.start.x = dragInfo.start.y = -1;\r
       dragInfo.from = dragInfo.start;\r
@@ -4222,9 +4227,9 @@ MouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
     if(y == -2) {\r
       /* [HGM] right mouse button in clock area edit-game mode ups clock */\r
       if (PtInRect((LPRECT) &whiteRect, pt)) {\r
-          if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) AdjustClock(flipClock, 1);\r
+          if (GetKeyState(VK_SHIFT) < 0) AdjustClock(flipClock, 1);\r
       } else if (PtInRect((LPRECT) &blackRect, pt)) {\r
-          if (gameMode == EditGame || GetKeyState(VK_SHIFT) < 0) AdjustClock(!flipClock, 1);\r
+          if (GetKeyState(VK_SHIFT) < 0) AdjustClock(!flipClock, 1);\r
       }\r
       break;\r
     }\r