Skip to content

Commit 3b98f7e

Browse files
committed
Revert locale change
1 parent f941f6b commit 3b98f7e

10 files changed

+17
-17
lines changed

Sources/RichTextKit/Bundle/Bundle+RichTextKit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extension Bundle {
6969
}
7070

7171
func bundlePath(for locale: Locale) -> String? {
72-
bundlePath(named: locale.identifier) ?? bundlePath(named: locale.language.languageCode?.identifier)
72+
bundlePath(named: locale.identifier) ?? bundlePath(named: locale.languageCode)
7373
}
7474

7575
func bundlePath(named name: String?) -> String? {

Sources/RichTextKit/Component/RichTextViewComponent+Pasting.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public extension RichTextViewComponent {
5959
at index: Int,
6060
moveCursorToPastedContent move: Bool = false
6161
) {
62-
#if iOS || os(tvOS) || os(macOS) || os(visionOS)
62+
#if os(watchOS)
63+
assertionFailure("Image pasting is not supported on this platform")
64+
#else
6365
guard validateImageInsertion(for: imagePasteConfiguration) else { return }
6466
let items = images.count * 2 // The number of inserted "items" is the images and a newline for each
6567
let insertRange = NSRange(location: index, length: 0)
@@ -74,8 +76,6 @@ public extension RichTextViewComponent {
7476
self.moveInputCursor(to: self.selectedRange.location)
7577
}
7678
}
77-
#else
78-
assertionFailure("Image pasting is not supported on this platform")
7979
#endif
8080
}
8181

@@ -113,7 +113,7 @@ public extension RichTextViewComponent {
113113
}
114114
}
115115

116-
#if iOS || os(tvOS) || os(macOS) || os(visionOS)
116+
#if iOS || macOS || os(tvOS) || os(visionOS)
117117
private extension RichTextViewComponent {
118118

119119
func getAttachmentString(

Sources/RichTextKit/Coordinator/RichTextCoordinator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ import UIKit
132132

133133
extension RichTextCoordinator: UITextViewDelegate {}
134134

135-
#elseif os(macOS)
135+
#elseif macOS
136136
import AppKit
137137

138138
extension RichTextCoordinator: NSTextViewDelegate {}

Sources/RichTextKit/Images/RichTextImageAttachment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import UIKit
1414
import AppKit
1515
#endif
1616

17-
#if iOS || os(tvOS) || os(macOS) || os(visionOS)
17+
#if iOS || macOS || os(tvOS) || os(visionOS)
1818
import UniformTypeIdentifiers
1919

2020
/**

Sources/RichTextKit/Pdf/RichTextPdfDataReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public extension RichTextPdfDataReader {
3131
func richTextPdfData(configuration: PdfPageConfiguration = .standard) throws -> Data {
3232
#if iOS || os(visionOS)
3333
try richText.iosPdfData(for: configuration)
34-
#elseif os(macOS)
34+
#elseif macOS
3535
try richText.macosPdfData(for: configuration)
3636
#else
3737
throw PdfDataError.unsupportedPlatform

Tests/RichTextKitTests/RichTextCoordinator+SubscriptionsTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class RichTextCoordinator_SubscriptionsTests: XCTestCase {
5656
eventually {
5757
#if iOS || os(tvOS)
5858
XCTAssertEqual(self.textView.richTextFontName, ".SFUI-Regular")
59-
#elseif os(macOS)
59+
#elseif macOS
6060
XCTAssertEqual(self.textView.richTextFontName, ".AppleSystemUIFont")
6161
#endif
6262
}

Tests/RichTextKitTests/RichTextCoordinatorTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ final class RichTextCoordinatorTests: XCTestCase {
7070
XCTAssertEqual(context.selectedRange, view.selectedRange)
7171
#if iOS || os(tvOS)
7272
XCTAssertEqual(context.textAlignment, view.richTextAlignment)
73-
#elseif os(macOS)
73+
#elseif macOS
7474
XCTAssertEqual(context.textAlignment, macOSAlignment)
7575
#endif
7676
}
@@ -100,7 +100,7 @@ final class RichTextCoordinatorTests: XCTestCase {
100100
XCTAssertFalse(context.isEditingText)
101101
}
102102

103-
#elseif os(macOS)
103+
#elseif macOS
104104

105105
let notification = Notification(
106106
name: NSText.didEndEditingNotification,

Tests/RichTextKitTests/RichTextViewRepresentable+AlignmentTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ final class RichTextViewComponent_AlignmentTests: XCTestCase {
6464
assertEqualAlignment(textView.richTextAttributes(at: selectedRange)[.paragraphStyle])
6565
#if iOS || os(tvOS)
6666
assertEqualAlignment(textView.typingAttributes[.paragraphStyle])
67-
#elseif os(macOS)
67+
#elseif macOS
6868
assertNonEqualAlignment(textView.typingAttributes[.paragraphStyle])
6969
#endif
7070
}
@@ -77,7 +77,7 @@ final class RichTextViewComponent_AlignmentTests: XCTestCase {
7777
assertEqualAlignment(textView.richTextAttributes(at: selectedRange)[.paragraphStyle])
7878
#if iOS || os(tvOS)
7979
assertEqualAlignment(textView.typingAttributes[.paragraphStyle])
80-
#elseif os(macOS)
80+
#elseif macOS
8181
assertNonEqualAlignment(textView.typingAttributes[.paragraphStyle])
8282
#endif
8383
}
@@ -90,7 +90,7 @@ final class RichTextViewComponent_AlignmentTests: XCTestCase {
9090
assertNonEqualAlignment(textView.richTextAttributes(at: secondRowRange)[.paragraphStyle])
9191
#if iOS || os(tvOS)
9292
assertEqualAlignment(textView.typingAttributes[.paragraphStyle])
93-
#elseif os(macOS)
93+
#elseif macOS
9494
assertNonEqualAlignment(textView.typingAttributes[.paragraphStyle])
9595
#endif
9696
}

Tests/RichTextKitTests/RichTextViewRepresentableTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class RichTextViewComponentTests: XCTestCase {
5656
#if iOS || os(tvOS)
5757
XCTAssertEqual(view.spellCheckingType, .no)
5858
XCTAssertEqual(view.textColor, .label)
59-
#elseif os(macOS)
59+
#elseif macOS
6060
XCTAssertEqual(view.textColor, .textColor)
6161
#endif
6262
}
@@ -74,7 +74,7 @@ final class RichTextViewComponentTests: XCTestCase {
7474
#if iOS || os(tvOS)
7575
XCTAssertEqual(view.spellCheckingType, .no)
7676
XCTAssertEqual(view.textColor, nil)
77-
#elseif os(macOS)
77+
#elseif macOS
7878
XCTAssertEqual(view.textColor, nil)
7979
#endif
8080
}

Tests/RichTextKitTests/Styles/RichTextStyleTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class RichTextStyleTests: XCTestCase {
3333
XCTAssertEqual(traits(for: .italic), .traitItalic)
3434
XCTAssertNil(traits(for: .underlined))
3535
}
36-
#elseif os(macOS)
36+
#elseif macOS
3737
func traits(for style: RichTextStyle) -> NSFontDescriptor.SymbolicTraits? {
3838
style.symbolicTraits
3939
}

0 commit comments

Comments
 (0)