https://github.com/meniny/localization
📱A Localization Manager written in Swift.
https://github.com/meniny/localization
Last synced: 11 months ago
JSON representation
📱A Localization Manager written in Swift.
- Host: GitHub
- URL: https://github.com/meniny/localization
- Owner: Meniny
- License: mit
- Created: 2017-07-27T06:13:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-04T07:53:21.000Z (almost 9 years ago)
- Last Synced: 2025-06-15T19:11:36.141Z (about 1 year ago)
- Language: Swift
- Size: 126 KB
- Stars: 7
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## What's this?
`Localization` is a Localization Manager written in Swift.
## Requirements
* iOS 8.0+
* macOS 10.10+
* watchOS 2.0+
* tvOS 9.0+
* Xcode 8 with Swift 3
## Installation
#### CocoaPods
```ruby
use_frameworks!
pod 'Localization'
```
## Contribution
You are welcome to fork and submit pull requests.
## License
`Localization` is open-sourced software, licensed under the `MIT` license.
## Usage
```swift
import Localization
class SomeSettingsClass {
func changeLanguage() {
Localization.preferredLanguage = LocalizableLanguage.french.code // == "fr"
}
}
```
```swift
import Localization
class SomeViewController: UIViewController {
var someLabel: UILabel = UILabel()
override func viewDidLoad() {
super.viewDidLoad()
// ...
Localization.startObserve(with: self, selector: #selector(localizationDidChangeWithPreferredLanguage))
}
deinit {
Localization.stopObserve(with: self)
}
func localizationDidChangeWithPreferredLanguage() {
someLabel.text = "SomeLocalizationKey".localized()
}
}
```