Giter Club home page Giter Club logo

nhlocalize's Introduction

NHLocalize

##What is? NHLocalize help you to localize your apps, without coding for all propreties like this:

[_mylabel setText:NSLocalizedString(@"key", @"comment")];

Using NHLocalize you can do it through Storyboard....

##How Install?

Installation with CocoaPods

I recommend you to take a look at CocoaPods and use it for dependency management in your iOS projects.

To add NHLocalize to your project it is necessary that the following lines are in your Podfile:

platform :ios, '7.0'
pod "NHLocalize", "~> 1.1.0"

Installation without CocoaPods

  1. Download NHLocalize;
  2. Drag an drop NHLocalize folder into your project;

##How to use? ###Create Localizable.strings Create the Localizable.strings, as you know. If you don't read it first: (http://www.raywenderlich.com/2876/localization-tutorial-for-ios)

###Let's get start
Now, go to your Storyboard, select you object (in my case is an UILabel) and open Identity Inspector. On Key Path add the tag nhlLabel. Type change to String. And in Value you need to add the key you've created on Localizable.strings, in this case I added LABEL.

Localize UIButton

With UIButton you can localize in all ControlStates. For UIControlStateNormal use: nhlButtonNormalTitle on Key Path.

For UIControlStateHighlighted use: nhlButtonHighlightedTitle on Key Path.

For UIControlStateDisabled use: nhlButtonDisabledTitle on Key Path.

For UIControlStateSelected use: nhlButtonSelectedTitle on Key Path.

For UIControlStateApplication use: nhlButtonApplicationTitle on Key Path.

For UIControlStateReserved use: nhlButtonReservedTitle on Key Path.

Localize UIImageView

For UIImageView you need use nhlImageView on Key Path.

Localize UILabel

For UILabel you need use nhlLabel on Key Path.

Localize UISegmentedControl

To Localize an UISegmentedControl you need follow step "Create Localizable.strings" and add a sufix on your KEY in Localizable.string and VALUE on Storyboard, like this: "-0" or "-1" or "-2" (without quotes), where the number is relative to index from your SegmentControl.

Example: MYKEY-0 or MYOTHERKEY-1

Localize UITextField

You can localize the text and the placeholder. For text use nhlTextField on Key Path. For placeholder use nhlTextFieldPlaceholder on Key Path.

Localize UITextView

For UITextView use nhlTextView on Key Path

##Note You can use it with UILabel, UIButton, UITextField, UITextView, UIImageView and UISegmentedControl. Test and working on iOS 6 and iOS 7.

Enjoy :)

nhlocalize's People

Contributors

nthegedus avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.