Просмотр исходного кода

Bug fix: Ellipses from German command names are not stripped from toolbar buttons

Source commit: c37735f17642b7fdc610fa8499a5fbc55e65e183
Martin Prikryl 4 лет назад
Родитель
Сommit
330491ca89
1 измененных файлов с 12 добавлено и 3 удалено
  1. 12 3
      source/packages/tb2k/TB2Common.pas

+ 12 - 3
source/packages/tb2k/TB2Common.pas

@@ -346,11 +346,20 @@ var
 begin
   Result := S;
   L := Length(Result);
-  if (L > 1) and (Result[L] = ':') and (ByteType(Result, L) = mbSingleByte) then
-    SetLength(Result, L-1)
-  else if (L > 3) and (Result[L-2] = '.') and (Result[L-1] = '.') and
+  // In German translation, Unicode ellipsis character is used with a preceding space,
+  // as opposite to the orignal English triple plain dot with no preceding space.
+  if (L > 1) and ((Result[L] = ':') or (Result[L] = #$2026)) and (ByteType(Result, L) = mbSingleByte) then
+  begin
+    SetLength(Result, L-1);
+    Result := TrimRight(Result);
+  end
+    else
+  if (L > 3) and (Result[L-2] = '.') and (Result[L-1] = '.') and
      (Result[L] = '.') and (ByteType(Result, L-2) = mbSingleByte) then
+  begin
     SetLength(Result, L-3);
+    Result := TrimRight(Result);
+  end;
 end;
 
 function GetTextWidth(const DC: HDC; S: String; const Prefix: Boolean): Integer;