瀏覽代碼

render from menu with "..."

Johann ELSASS 4 年之前
父節點
當前提交
816e8316b4
共有 1 個文件被更改,包括 21 次插入15 次删除
  1. 21 15
      lazpaint/utranslation.pas

+ 21 - 15
lazpaint/utranslation.pas

@@ -96,24 +96,30 @@ begin
   begin
     item := FMainPoFile.FindPoItem(AId);
     if (AId <> '') and Assigned(item) then
-      exit(item.Translation) else
+      exit(item.Translation);
+
+    item := FMainPoFile.OriginalToItem(AText);
+    if Assigned(item) then exit(item.Translation);
+
+    item := FMainPoFile.OriginalToItem(AText+':');
+    if item = nil then item := FMainPoFile.OriginalToItem(AText+' :');
+    if Assigned(item) then
     begin
-      item := FMainPoFile.OriginalToItem(AText);
-      if Assigned(item) then exit(item.Translation) else
+      result := item.Translation.TrimRight;
+      if result.EndsWith(':') then
       begin
-        item := FMainPoFile.OriginalToItem(AText+':');
-        if item = nil then item := FMainPoFile.OriginalToItem(AText+' :');
-        if Assigned(item) then
-        begin
-          result := item.Translation.TrimRight;
-          if result.EndsWith(':') then
-          begin
-            delete(result, length(result), 1);
-            result := result.TrimRight;
-          end;
-          exit;
-        end;
+        delete(result, length(result), 1);
+        result := result.TrimRight;
       end;
+      exit;
+    end;
+
+    item := FMainPoFile.OriginalToItem(AText+'...');
+    if Assigned(item) then
+    begin
+      result := item.Translation.TrimRight;
+      if result.EndsWith('...') then delete(result, length(result)-2, 3);
+      exit;
     end;
   end;
   result := AText;