Skip to content

Commit 268a32c

Browse files
committed
- Fixes localisation
1 parent a896491 commit 268a32c

File tree

21 files changed

+71
-69
lines changed

21 files changed

+71
-69
lines changed

FSNotes.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4380,7 +4380,7 @@
43804380
CODE_SIGN_IDENTITY = "Apple Development";
43814381
CODE_SIGN_STYLE = Automatic;
43824382
COMBINE_HIDPI_IMAGES = YES;
4383-
CURRENT_PROJECT_VERSION = 492;
4383+
CURRENT_PROJECT_VERSION = 494;
43844384
DEVELOPMENT_TEAM = 866P6MTE92;
43854385
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
43864386
ENABLE_HARDENED_RUNTIME = YES;
@@ -4415,7 +4415,7 @@
44154415
CODE_SIGN_IDENTITY = "Apple Development";
44164416
CODE_SIGN_STYLE = Automatic;
44174417
COMBINE_HIDPI_IMAGES = YES;
4418-
CURRENT_PROJECT_VERSION = 492;
4418+
CURRENT_PROJECT_VERSION = 494;
44194419
DEPLOYMENT_LOCATION = NO;
44204420
DEVELOPMENT_TEAM = 866P6MTE92;
44214421
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
@@ -4743,7 +4743,7 @@
47434743
CODE_SIGN_IDENTITY = "Developer ID Application";
47444744
CODE_SIGN_STYLE = Manual;
47454745
COMBINE_HIDPI_IMAGES = YES;
4746-
CURRENT_PROJECT_VERSION = 492;
4746+
CURRENT_PROJECT_VERSION = 493;
47474747
DEVELOPMENT_TEAM = 866P6MTE92;
47484748
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
47494749
ENABLE_NS_ASSERTIONS = NO;
@@ -4777,7 +4777,7 @@
47774777
CODE_SIGN_IDENTITY = "Apple Development";
47784778
CODE_SIGN_STYLE = Automatic;
47794779
COMBINE_HIDPI_IMAGES = YES;
4780-
CURRENT_PROJECT_VERSION = 492;
4780+
CURRENT_PROJECT_VERSION = 493;
47814781
DEPLOYMENT_LOCATION = NO;
47824782
DEVELOPMENT_TEAM = 866P6MTE92;
47834783
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;

FSNotes/View/EditTextView.swift

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -54,62 +54,64 @@ class EditTextView: NSTextView, NSTextFinderClient, NSSharingServicePickerDelega
5454
override func draw(_ dirtyRect: NSRect) {
5555
super.draw(dirtyRect)
5656

57-
let range = NSRange(location: 0, length: textStorage!.length)
58-
attributedString().enumerateAttributes(in: range, options: .reverse) {
59-
attributes, range, stop in
57+
if #available(OSX 10.16, *) {
58+
let range = NSRange(location: 0, length: textStorage!.length)
59+
attributedString().enumerateAttributes(in: range, options: .reverse) {
60+
attributes, range, stop in
6061

61-
let tag = attributedString().attributedSubstring(from: range).string
62-
guard attributes.index(forKey: .tag) != nil, let font = attributes[.font] as? NSFont else { return }
62+
let tag = attributedString().attributedSubstring(from: range).string
63+
guard attributes.index(forKey: .tag) != nil, let font = attributes[.font] as? NSFont else { return }
6364

64-
guard let container = self.textContainer else { return }
65-
guard let activeRange = self.layoutManager?.glyphRange(forCharacterRange: range, actualCharacterRange: nil) else { return }
65+
guard let container = self.textContainer else { return }
66+
guard let activeRange = self.layoutManager?.glyphRange(forCharacterRange: range, actualCharacterRange: nil) else { return }
6667

67-
guard var tagRect = self.layoutManager?.boundingRect(forGlyphRange: activeRange, in: container) else { return }
68+
guard var tagRect = self.layoutManager?.boundingRect(forGlyphRange: activeRange, in: container) else { return }
6869

69-
tagRect.origin.x += self.textContainerOrigin.x;
70-
tagRect.origin.y += self.textContainerOrigin.y;
71-
tagRect = self.convertToLayer(tagRect)
70+
tagRect.origin.x += self.textContainerOrigin.x;
71+
tagRect.origin.y += self.textContainerOrigin.y;
72+
tagRect = self.convertToLayer(tagRect)
7273

73-
let tagAttributes = attributedString().attributes(at: range.location, effectiveRange: nil)
74-
let oneCharSize = ("a" as NSString).size(withAttributes: tagAttributes)
74+
let tagAttributes = attributedString().attributes(at: range.location, effectiveRange: nil)
75+
let oneCharSize = ("a" as NSString).size(withAttributes: tagAttributes)
7576

76-
let height = oneCharSize.height > tagRect.size.height ? tagRect.size.height : oneCharSize.height
77-
let tagBorderRect = NSRect(origin: CGPoint(x: tagRect.origin.x-oneCharSize.width*0.1, y: tagRect.origin.y), size: CGSize(width: tagRect.size.width+oneCharSize.width*0.3, height: height))
77+
let height = oneCharSize.height > tagRect.size.height ? tagRect.size.height : oneCharSize.height
78+
let tagBorderRect = NSRect(origin: CGPoint(x: tagRect.origin.x-oneCharSize.width*0.1, y: tagRect.origin.y), size: CGSize(width: tagRect.size.width+oneCharSize.width*0.3, height: height))
7879

79-
NSGraphicsContext.saveGraphicsState()
80+
NSGraphicsContext.saveGraphicsState()
8081

81-
let path = NSBezierPath(roundedRect: tagBorderRect, xRadius: 3, yRadius: 3)
82+
let path = NSBezierPath(roundedRect: tagBorderRect, xRadius: 3, yRadius: 3)
8283

83-
let fillColor = NSColor.tagColor
84-
let strokeColor = NSColor.gray
85-
let textColor = NSColor.white
84+
let fillColor = NSColor.tagColor
85+
let strokeColor = NSColor.gray
86+
let textColor = NSColor.white
8687

87-
path.addClip()
88-
fillColor.setFill()
89-
strokeColor.setStroke()
90-
tagBorderRect.fill(using: .sourceOver)
88+
path.addClip()
89+
fillColor.setFill()
90+
strokeColor.setStroke()
91+
tagBorderRect.fill(using: .sourceOver)
9192

92-
// let transform = NSAffineTransform()
93-
// transform.translateX(by: 0.5, yBy: 0.5)
94-
// path.transform(using: transform as AffineTransform)
95-
// path.stroke()
96-
// transform.translateX(by: -1.5, yBy: -1.5)
97-
// path.transform(using: transform as AffineTransform)
98-
// path.stroke()
93+
// let transform = NSAffineTransform()
94+
// transform.translateX(by: 0.5, yBy: 0.5)
95+
// path.transform(using: transform as AffineTransform)
96+
// path.stroke()
97+
// transform.translateX(by: -1.5, yBy: -1.5)
98+
// path.transform(using: transform as AffineTransform)
99+
// path.stroke()
99100

100-
let resFont = NSFontManager.shared.convert(font, toSize: font.pointSize)
101-
let dict = NSMutableDictionary(dictionary: tagAttributes)
101+
let resFont = NSFontManager.shared.convert(font, toSize: font.pointSize)
102+
let dict = NSMutableDictionary(dictionary: tagAttributes)
102103

103-
dict.addEntries(from: [
104-
NSAttributedString.Key.font: resFont,
105-
NSAttributedString.Key.foregroundColor: textColor
106-
])
107-
dict.removeObject(forKey: NSAttributedString.Key.link)
104+
dict.addEntries(from: [
105+
NSAttributedString.Key.font: resFont,
106+
NSAttributedString.Key.foregroundColor: textColor
107+
])
108+
dict.removeObject(forKey: NSAttributedString.Key.link)
108109

109-
let newRect = tagRect.offsetBy(dx: 0, dy: -1)
110-
(tag as NSString).draw(in: newRect, withAttributes: (dict as! [NSAttributedString.Key : Any]))
110+
let newRect = tagRect.offsetBy(dx: 0, dy: -1)
111+
(tag as NSString).draw(in: newRect, withAttributes: (dict as! [NSAttributedString.Key : Any]))
111112

112-
NSGraphicsContext.restoreGraphicsState()
113+
NSGraphicsContext.restoreGraphicsState()
114+
}
113115
}
114116
}
115117

FSNotes/ar-IQ.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"Delete Folder" = "حذف المجلد";
7272

7373
/* No comment provided by engineer. */
74-
"Delete Tag" = "Delete Tag";
74+
"Delete Tag" = "حذف العلامة";
7575

7676
/* No comment provided by engineer. */
7777
"Detach storage" = "Detach storage";

FSNotes/ar-IQ.lproj/Main.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
"buJ-ug-pKt.title" = "استخدم التحديد للبحث";
186186

187187
/* Class = "NSMenuItem"; title = "Untagged"; ObjectID = "BX0-nb-tVk"; */
188-
"BX0-nb-tVk.title" = "Untagged";
188+
"BX0-nb-tVk.title" = "بدون علامات";
189189

190190
/* Class = "NSTextFieldCell"; title = "Note list spacing:"; ObjectID = "bXK-wP-sZc"; */
191191
"bXK-wP-sZc.title" = "التباعد في قائمة الملاحظات";

FSNotes/de.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"Delete Folder" = "Ordner löschen";
7272

7373
/* No comment provided by engineer. */
74-
"Delete Tag" = "Delete Tag";
74+
"Delete Tag" = "Tag löschen";
7575

7676
/* No comment provided by engineer. */
7777
"Detach storage" = "Speicher abnehmen";

FSNotes/de.lproj/Main.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
"buJ-ug-pKt.title" = "Auswahl suchen";
186186

187187
/* Class = "NSMenuItem"; title = "Untagged"; ObjectID = "BX0-nb-tVk"; */
188-
"BX0-nb-tVk.title" = "Untagged";
188+
"BX0-nb-tVk.title" = "Ungetaggt";
189189

190190
/* Class = "NSTextFieldCell"; title = "Note list spacing:"; ObjectID = "bXK-wP-sZc"; */
191191
"bXK-wP-sZc.title" = "Listenhöhe:";

FSNotes/es.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"Delete Folder" = "Eliminar carpeta";
7272

7373
/* No comment provided by engineer. */
74-
"Delete Tag" = "Delete Tag";
74+
"Delete Tag" = "Eliminar etiqueta";
7575

7676
/* No comment provided by engineer. */
7777
"Detach storage" = "Separar el almacenamiento";

FSNotes/es.lproj/Main.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
"buJ-ug-pKt.title" = "Usar selección para buscar";
186186

187187
/* Class = "NSMenuItem"; title = "Untagged"; ObjectID = "BX0-nb-tVk"; */
188-
"BX0-nb-tVk.title" = "Untagged";
188+
"BX0-nb-tVk.title" = "Sin etiquetar";
189189

190190
/* Class = "NSTextFieldCell"; title = "Note list spacing:"; ObjectID = "bXK-wP-sZc"; */
191191
"bXK-wP-sZc.title" = "Espaciado en la lista:";

FSNotes/fr.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"Delete Folder" = "Supprimer le dossier";
7272

7373
/* No comment provided by engineer. */
74-
"Delete Tag" = "Delete Tag";
74+
"Delete Tag" = "Supprimer la balise";
7575

7676
/* No comment provided by engineer. */
7777
"Detach storage" = "Detach storage";

FSNotes/it.lproj/Localizable.strings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"Delete Folder" = "Elimina cartella";
7272

7373
/* No comment provided by engineer. */
74-
"Delete Tag" = "Delete Tag";
74+
"Delete Tag" = "Elimina tag";
7575

7676
/* No comment provided by engineer. */
7777
"Detach storage" = "Scollega archivio";

0 commit comments

Comments
 (0)