Releases: devMfawzy/RTLKit
Releases · devMfawzy/RTLKit
Release list
1.0.0
First Release.
RTLKit keeps numbers, dates, and phone numbers reading correctly when they sit inside Arabic or Hebrew text. "0 / 12" has no direction of its own, so in a right-to-left paragraph it renders as 12 / 0. RTLKit wraps it in Unicode isolates (UAX #9) so the fragment resolves on its own without disturbing the text around it.
Text("التقدم: \(done) / \(total)") // التقدم: 12 / 0
Text("التقدم: \(rtlSafe: "\(done) / \(total)")") // التقدم: 0 / 12What's in it
rtlSafeonString, and a\(rtlSafe:)interpolation for values inside a
larger string.isDirectionallyNeutral,firstStrongDirectionandisBidirectionalfor
working out why one string flips and another doesn't.convertingNumerals(to:)andconvertingNumerals(for:)for Western,
Arabic-Indic and Eastern Arabic-Indic digits, following regional convention —
Egypt and the Gulf use ٠١٢, Morocco and Algeria use 012.strippingDirectionalControls()for storing and comparing text that was
isolated for display.Text(rtlSafe:)in RTLKitUI.
Install
.package(url: "https://github.com/devMfawzy/RTLKit.git", from: "1.0.0")pod 'RTLKit' # string API
pod 'RTLKit/UI' # plus SwiftUI helpersRTLKit depends on Foundation alone. iOS 13+, macOS 10.15+, tvOS 13+,
watchOS 6+, visionOS 1+ through SPM; iOS and macOS through CocoaPods.
30 tests, and a demo app under Example/.