SmartQuotes

0.0.1

🗞 Swift String extension for typographically correct quotes & apostrophes
hallee/swift-smart-quotes

What's New

2019-10-26T21:05:28Z

SmartQuotes

A simple Swift String extension for converting straight apostrophes and quotes in to typographically correct curly versions.

This package provides a .withSmartQuotes property on String, which defaults to English conversions.

For other localizations, a locale can be provided to .withSmartQuotes(locale: Locale?). Currently only de, fi, and sv are implemented. I’m open to contributions for other localizations!

Usage

import SmartQuotes

"\"Crime peaked in the '90s\"".withSmartQuotes   // “Crime peaked in the ’90s”

"\"Crime peaked in the '90s\"".withSmartQuotes(  // „Crime peaked in the ‘90s“
    Locale(identifier: "de")
)

Installation

Carthage

# Cartfile
github "hallee/swift-smart-quotes" ~> 0.0.1

CocoaPods

# Podfile
pod 'SmartQuotes'

SwiftPM

dependencies: [
    .package(url: "https://github.com/hallee/swift-smart-quotes", from: "0.0.1")
],
targets: [
    .target(name: "YourTarget", dependencies: ["SmartQuotes"])
]

TODO

  • Localizations

Description

  • Swift Tools 5.0.0
View More Packages from this Author

Dependencies

  • None
Last updated: Wed Mar 20 2024 10:44:58 GMT-0900 (Hawaii-Aleutian Daylight Time)