ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - PiXeL16/IBLocalizable: Localize your views directly in Interface Builder with IBLocalizable
Localize your views directly in Interface Builder with IBLocalizable - PiXeL16/IBLocalizable
Visit Site

GitHub - PiXeL16/IBLocalizable: Localize your views directly in Interface Builder with IBLocalizable

GitHub - PiXeL16/IBLocalizable: Localize your views directly in Interface Builder with IBLocalizable

IBLocalizable

Localize your views easily in Interface Builder with IBLocalizable.

codecov.io Language CocoaPods Compatible Awesome GitHub license

With IBLocalizable, you can localize your views in Interface Builder easily. Simply set the new Localizable String property that shows up in Interface builder to the value that you added in your Localizable .string file. Most views can be localized this way without a single line of code.

Installation

Swift package manager

Add .Package(url: "https://github.com/PiXeL16/IBLocalizable.git",majorVersion: 1) to your Package.swift

CocoaPods

Add pod 'IBLocalizable' to your Podfile.

Carthage

Add github "PiXeL16/IBLocalizable" to your Cartfile.

Manual Installation

  • Please note, installation via CocoaPods or Carthage is much simpler and recommended.

Download and drop /IBLocalizable in your project.

Supported Views

  • UILabel
  • UIButton
  • UINavigationItem (Navigation titles)
  • UIBarItem (BarButton, TabBarItem, etc)
  • UITextField
  • UITextView
  • UISearchBar

Supporting custom views

Custom views can be supported easily. Just create an extension and implement the Localizable Protocol.

If your custom view extends from UIView you only need to extend your custom view and implement the localizableProperty.

For example: lets say that I have a custom view that contains several UILabel and a UIImageView. I will like to localize one of the UILabel.

import UIKit
extension MyCustomView {

    public override var localizableProperty: String?{

        get{
            return self.label.text
        }
        set{
            self.label.text = newValue
        }
    }
}

Thats it! :smile:.

Usage

After the package its installed simply open your Storyboard or Interface Builder. All of the supported views will show a new Localizable String property.

interfaceBuilder

Since everything is extension based, IBLocalizable should play nice with other libraries or pods that you are using.

Build Performance

Since IBLocalizable only uses IBInspectable and never IBDesignable, your incremental builds will continue to work. (http://www.openradar.me/20690594)

Sample Project

In the Xcode Project you can find a sample project of a simple Login view controller. All of this is automatically localizable in English and Spanish by just using IBLocalizable.

English

english

Spanish

spanish

To do

  • Support more views (TableView Cells, etc)
  • Improve sample project.

Author

Chris Jimenez - http://code.chrisjimenez.net, @chrisjimeneznat

:beer: Donate

If you want to buy me a beer, you can donate to my coin addresses below:

BTC

1BeGBew4CBdLgUSmvoyiU1LrM99GpkXgkj

ETH

0xa59a3793E3Cb5f3B1AdE6887783D225EDf67192d

LTC

Ld6FB3Tqjf6B8iz9Gn9sMr7BnowAjSUXaV

License

IBLocalizable is released under the MIT license. See LICENSE for details.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory