Skip to content

CactusSoft/Cactus-Localization

Repository files navigation

CactusLocalization

CI Status Version License Platform

CactusLocalization is a simple wrapper for NSLocalizedString with a swiftier synthax. It uses the same Localizable.strings file, so you don't need to restructure your project.

Usage

Import CactusLocalization in the file:

import CactusLocalization

Then set localized variants of your strings as follows:

exampleLabel.text = "some-key-that-is-in-a-strings-file".localized()

You can of course specify Bundle name, table name and default value - the same as NSLocalizedString, if you want. Under the hood the method falls back to Base.lproj, and then to the value provided in case translation wasn't found.

Installation

CactusLocalization is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CactusLocalization'

Author

PoltoraIvana, ivan.sobolevskiy@cactussoft.biz

License

CactusLocalization is available under the MIT license. See the LICENSE file for more info.