Latest 1.0.1
Homepage https://github.com/istx25/Localized
License MIT
Platforms ios 9.0
Frameworks Foundation
Authors

Localized

A prettier way to localize strings in Swift.

Usage

Just call .localized() or .localize(with: <arguments>) on a string. Literally.

let ❤️ = "about.nameLabel.text".localize(with: "Willow")
print(heart) // Hallo, meine name ist Willow.

No more of this:

let localized = NSLocalized("about.nameLabel.text", comment: "")
let 😭 = String(format: localized, arguments: "Willow")
print(crying_face) // Hello, my name is Willow.

Acknowledgements

I recently attended CocoaHeads Berlin where @MatejBalantic talked about things he learned while building a cross-platform app in Swift. At one point in this talk, he mentioned a better way to localize strings and referenced his String+Localized.swift gist. I have been using this in all of my projects since that talk and wanted to make it easier to integrate. There are a few minor improvements too.

License

Localized is released and distributed under the MIT License.

Latest podspec

{
    "name": "Localized",
    "version": "1.0.1",
    "summary": "A prettier way to localize strings.",
    "homepage": "https://github.com/istx25/Localized",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Willow Alexandra": "[email protected]"
    },
    "source": {
        "git": "https://github.com/istx25/Localized.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://twitter.com/istx25",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "Sources/Localized/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This