https://github.com/digipolitan/localization-toolkit
https://github.com/digipolitan/localization-toolkit
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/digipolitan/localization-toolkit
- Owner: Digipolitan
- License: bsd-3-clause
- Created: 2017-10-24T08:08:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-31T11:42:39.000Z (almost 6 years ago)
- Last Synced: 2025-02-17T18:16:26.384Z (3 months ago)
- Language: Swift
- Size: 121 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
LocalizationToolkit
=================================[](https://developer.apple.com/swift/)
[](https://travis-ci.org/Digipolitan/localization-toolkit)
[](https://img.shields.io/cocoapods/v/LocalizationToolkit.svg)
[](https://github.com/Carthage/Carthage)
[](https://swift.org/package-manager/)
[](http://cocoadocs.org/docsets/LocalizationToolkit)
[](http://twitter.com/Digipolitan)LocalizationToolkit Swift is an helper for String Localization
## Installation
### CocoaPods
To install LocalizationToolkit with CocoaPods, add the following lines to your `Podfile`.
```ruby
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!pod 'LocalizationToolkit'
```### Carthage
[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with [Homebrew](http://brew.sh/) using the following command:
```bash
$ brew update
$ brew install carthage
```To integrate LocalizationToolkit into your Xcode project using Carthage, specify it in your `Cartfile`:
```
github 'Digipolitan/localization-toolkit' ~> 1.0
```Run `carthage update` to build the framework and drag the built `LocalizationToolkit.framework` into your Xcode project.
### Swift Package Manager
The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.
Once you have your Swift package set up, adding LocalizationToolkit as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.
```swift
dependencies: [
.package(url: "https://github.com/Digipolitan/localization-toolkit.git", from: "1.0.0")
]
```## The Basics
```swift
let loc = "my_loc_key".localized()
print("\(loc)")
```## Advanced
You can specify the fallback language in the Info.plist as follow:
```xml
LocalizationToolkitFallbackLanguage
fr```
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for more details!
This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report
unacceptable behavior to [[email protected]](mailto:[email protected]).## License
LocalizationToolkit is licensed under the [BSD 3-Clause license](LICENSE).