Browse Source

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 11 months ago
parent
commit
fa0830ef0f

+ 9 - 7
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -448,22 +448,24 @@ extension KMEditPDFTextPropertyViewController {
     
     @objc func resetTextPresuppositionButtonAction(sender: NSButton) {
         var popViewDataArr: [String] = []
-        for string in ["Redefine", "Reset"] {
-            popViewDataArr.append(NSLocalizedString(string, comment: ""))
+        
+        var dataArray = [NSLocalizedString("Redefine", comment: ""), NSLocalizedString("Reset", comment: "")]
+        for string in dataArray {
+            popViewDataArr.append(string)
         }
         
         //调整保存参数
         let index = self.textPresuppositionVC?.indexOfSelectedItem ?? 0
         let type = KMEditPDFTextFontType.typeOfRawValue(value: KMEditPDFTextFontType.allValues()[index])
         let model = KMEditPDFTextManager.manager.fetchUserDefaultData(type: type)
-        var disItems: [String] = popViewDataArr
+        var disItems: [String] = dataArray
         
         if model.change || model.redefine {
-            disItems.removeObject("Reset")
+            disItems.removeObject(NSLocalizedString("Reset", comment: ""))
         }
         
         if model.change {
-            disItems.removeObject("Redefine")
+            disItems.removeObject(NSLocalizedString("Redefine", comment: ""))
         }
         
         let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr(popViewDataArr)
@@ -478,9 +480,9 @@ extension KMEditPDFTextPropertyViewController {
 //        vc.customBoxWidthLayoutConstraint.constant = self.popWidth ?? sender.frame.width
         vc.downCallback = { [unowned self](downEntered: Bool, count: String) -> Void in
             if downEntered {
-                if count == "Reset" {
+                if count == NSLocalizedString("Reset", comment: "") {
                     self.resetTextPresuppositionData()
-                } else if count == "Redefine" {
+                } else if count == NSLocalizedString("Redefine", comment: "") {
                     self.reDefineTextPresuppositionData()
                 }
                 createFilePopover.close()