Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/RxSwiftCommunity/RxLocalizer

RxLocalizer allows you to localize your apps, using RxSwift ๐Ÿš€
https://github.com/RxSwiftCommunity/RxLocalizer

Last synced: about 2 months ago
JSON representation

RxLocalizer allows you to localize your apps, using RxSwift ๐Ÿš€

Awesome Lists containing this project

README

        

[![Build Status](https://travis-ci.org/RxSwiftCommunity/RxLocalizer.svg?branch=master)](https://travis-ci.org/RxSwiftCommunity/RxLocalizer)
[![Swift](https://img.shields.io/badge/swift-5.3-orange.svg)](https://github.com/RxSwiftCommunity/RxLocalizer)
[![RxSwift](https://img.shields.io/badge/RxSwift-6.1-red.svg)](https://github.com/ReactiveX/RxSwift)
[![Platform](https://img.shields.io/badge/iOS-12+-blue.svg)](https://github.com/RxSwiftCommunity/RxLocalizer/blob/master/LICENSE)
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/RxSwiftCommunity/RxLocalizer/blob/master/LICENSE)

# ๐Ÿš€ RxLocalizer

RxLocalizer is a framework written in swift which allows you to localize your apps, using RxSwift.

## ๐Ÿ›  Requirements

- Xcode 12.4
- Swift 5+
- iOS 12+

## โš™๏ธ Installation

### Swift Package Manager (requires Xcode 11)

Add package into Project settings -> Swift Packages

### CocoaPods

```ruby
pod 'RxLocalizer'
```

## ๐Ÿ‘จโ€๐Ÿ’ป Usage

### Before all:

```swift
import RxLocalizer
```

### Reactive localized strings

```swift
Localizer.shared.localized("Start")
.drive(startLabel.rx.text)
.disposed(by: disposeBag)
```

### Synchronously localized strings

```swift
startLabel.text = Localizer.shared.localized("Start")
```

### Change language

You are able to set language by language code.
A full list of the codes you can check [here](https://www.ibabbleon.com/iOS-Language-Codes-ISO-639.html).
```swift
Localizer.shared.changeLanguage.accept("en")
```

### Change RxLocalizer configuration

You are able to change default configuration, using `changeConfiguration` property.

```swift
let localizerConfig = LocalizerConfig(defaults: .standard, bundle: .main, tableName: "Localizable")
Localizer.shared.changeConfiguration.accept(localizerConfig)
```

## ๐Ÿ‘ฎโ€โ™‚๏ธLicense

RxLocalizer is available under the MIT license. See the LICENSE file for more info.
Copyright (c) RxSwiftCommunity