@@ -477,7 +477,7 @@ private final class ClipboardPreviewViewController: NSViewController {
477477 closeButton. onPress = { [ weak self] in
478478 self ? . onClose ? ( )
479479 }
480- closeButton. toolTip = " 关闭预览 "
480+ closeButton. toolTip = AppLocalization . text ( " preview.close " , defaultValue : " 关闭预览 " )
481481 closeButton. translatesAutoresizingMaskIntoConstraints = false
482482
483483 let titleLabel = NSTextField ( labelWithString: displayTypeTitle ( ) )
@@ -924,17 +924,17 @@ private final class ClipboardPreviewViewController: NSViewController {
924924 private func displayTypeTitle( ) -> String {
925925 switch content. itemType {
926926 case " link " :
927- return " 链接 "
927+ return AppLocalization . itemTypeTitle ( " link " )
928928 case " image " :
929- return " 图片 "
929+ return AppLocalization . itemTypeTitle ( " image " )
930930 case " file " :
931- return " 文件 "
931+ return AppLocalization . itemTypeTitle ( " file " )
932932 case " color " :
933- return " 颜色 "
933+ return AppLocalization . itemTypeTitle ( " color " )
934934 case " rich_text " :
935- return " 富文本 "
935+ return AppLocalization . itemTypeTitle ( " rich_text " )
936936 default :
937- return " 文本 "
937+ return AppLocalization . itemTypeTitle ( " text " )
938938 }
939939 }
940940
@@ -947,7 +947,10 @@ private final class ClipboardPreviewViewController: NSViewController {
947947
948948 if content. itemType == " file " , !content. fileURLs. isEmpty {
949949 if content. fileURLs. count > 1 {
950- return [ " \( content. fileURLs. count) 个文件 " , content. fileURLs [ 0 ] . path]
950+ return [
951+ AppLocalization . format ( " preview.fileCount " , defaultValue: " %lld 个文件 " , Int64 ( content. fileURLs. count) ) ,
952+ content. fileURLs [ 0 ] . path
953+ ]
951954 }
952955 return [ content. fileURLs [ 0 ] . path]
953956 }
@@ -964,8 +967,8 @@ private final class ClipboardPreviewViewController: NSViewController {
964967 let characterCount = text. count
965968 let lineCount = text. isEmpty ? 0 : text. split ( separator: " \n " , omittingEmptySubsequences: false ) . count
966969 return [
967- " \( Self . decimalString ( characterCount) ) 个字符 " ,
968- " \( Self . decimalString ( lineCount) ) 行 "
970+ AppLocalization . format ( " preview.characterCount " , defaultValue : " %@ 个字符 " , Self . decimalString ( characterCount) ) ,
971+ AppLocalization . format ( " preview.lineCount " , defaultValue : " %@ 行 " , Self . decimalString ( lineCount) )
969972 ]
970973 }
971974
@@ -1538,7 +1541,7 @@ private final class PreviewImageDocumentView: NSView {
15381541 . font: NSFont . systemFont ( ofSize: 14 , weight: . medium) ,
15391542 . foregroundColor: NSColor . secondaryLabelColor
15401543 ]
1541- let text = NSString ( string: " 预览不可用 " )
1544+ let text = NSString ( string: AppLocalization . text ( " preview.unavailable " , defaultValue : " 预览不可用 " ) )
15421545 let size = text. size ( withAttributes: attributes)
15431546 text. draw (
15441547 at: NSPoint ( x: bounds. midX - size. width / 2 , y: bounds. midY - size. height / 2 ) ,
0 commit comments