RxLocalization allows you to easily localize your application with Rx. You will never care again about complexity of user-driven language changes.
Define your Localizable.strings as always. But instead of
@IBOutlet weak vardoneButton:UIBarButtonItem!...
doneButton.title =NSLocalizedString("STR_DONE", comment:"")you are able to write
import RxL10n
...@IBOutlet weak vardoneButton:UIBarButtonItem!...L("STR_DONE").bind(to: doneButton.rx.title).disposed(by: disposeBag)And when your user wants to change language of the application just do:
Localization.current.value =Localization(langCode:"pl")All other magic Rx will do for you for free.
This library depends on RxSwift and Foundation.
Add this to Cartfile
github "RollnCode/RxLocalization"
And run
$ carthage updateRxLocalization is available under the MIT license. See the LICENSE file for more info.